medusa-interfaces
Advanced tools
Comparing version 1.0.10 to 1.0.11-alpha.421
@@ -54,5 +54,27 @@ "use strict"; | ||
} | ||
/** | ||
* Called before a shipping option is created in Admin. The method should | ||
* return all of the options that the fulfillment provider can be used with, | ||
* and it is here the distinction between different shipping options are | ||
* enforced. For example, a fulfillment provider may offer Standard Shipping | ||
* and Express Shipping as fulfillment options, it is up to the store operator | ||
* to create shipping options in Medusa that can be chosen between by the | ||
* customer. | ||
*/ | ||
}, { | ||
key: "getFulfillmentOptions", | ||
value: function getFulfillmentOptions() {} | ||
/** | ||
* Called before a shipping method is set on a cart to ensure that the data | ||
* sent with the shipping method is valid. The data object may contain extra | ||
* data about the shipment such as an id of a drop point. It is up to the | ||
* fulfillment provider to enforce that the correct data is being sent | ||
* through. | ||
* @param {object} data - the data to validate | ||
* @param {object} cart - the cart to which the shipping method will be applied | ||
* @return {object} the data to populate `cart.shipping_methods.$.data` this | ||
* is usually important for future actions like generating shipping labels | ||
*/ | ||
}, { | ||
@@ -63,2 +85,7 @@ key: "validateFulfillmentData", | ||
} | ||
/** | ||
* Called before a shipping option is created in Admin. Use this to ensure | ||
* that a fulfillment option does in fact exist. | ||
*/ | ||
}, { | ||
@@ -74,5 +101,9 @@ key: "validateOption", | ||
} | ||
/** | ||
* Used to calculate a price for a given shipping option. | ||
*/ | ||
}, { | ||
key: "calculatePrice", | ||
value: function calculatePrice(data) { | ||
value: function calculatePrice(data, cart) { | ||
throw Error("calculatePrice must be overridden by the child class"); | ||
@@ -79,0 +110,0 @@ } |
{ | ||
"name": "medusa-interfaces", | ||
"version": "1.0.10", | ||
"version": "1.0.11-alpha.421+306099b", | ||
"description": "Core interfaces for Medusa", | ||
@@ -39,3 +39,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "cd39798b4b7c4932ea8e684eab9c584eb2c1d08c" | ||
"gitHead": "306099b6a2a71765b2331ac033376376818ea6fa" | ||
} |
@@ -18,4 +18,24 @@ import BaseService from "./base-service" | ||
/** | ||
* Called before a shipping option is created in Admin. The method should | ||
* return all of the options that the fulfillment provider can be used with, | ||
* and it is here the distinction between different shipping options are | ||
* enforced. For example, a fulfillment provider may offer Standard Shipping | ||
* and Express Shipping as fulfillment options, it is up to the store operator | ||
* to create shipping options in Medusa that can be chosen between by the | ||
* customer. | ||
*/ | ||
getFulfillmentOptions() {} | ||
/** | ||
* Called before a shipping method is set on a cart to ensure that the data | ||
* sent with the shipping method is valid. The data object may contain extra | ||
* data about the shipment such as an id of a drop point. It is up to the | ||
* fulfillment provider to enforce that the correct data is being sent | ||
* through. | ||
* @param {object} data - the data to validate | ||
* @param {object} cart - the cart to which the shipping method will be applied | ||
* @return {object} the data to populate `cart.shipping_methods.$.data` this | ||
* is usually important for future actions like generating shipping labels | ||
*/ | ||
validateFulfillmentData(data, cart) { | ||
@@ -25,2 +45,6 @@ throw Error("validateFulfillmentData must be overridden by the child class") | ||
/** | ||
* Called before a shipping option is created in Admin. Use this to ensure | ||
* that a fulfillment option does in fact exist. | ||
*/ | ||
validateOption(data) { | ||
@@ -34,3 +58,6 @@ throw Error("validateOption must be overridden by the child class") | ||
calculatePrice(data) { | ||
/** | ||
* Used to calculate a price for a given shipping option. | ||
*/ | ||
calculatePrice(data, cart) { | ||
throw Error("calculatePrice must be overridden by the child class") | ||
@@ -37,0 +64,0 @@ } |
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
48555
1015
2
1