dispatch-node
Advanced tools
Comparing version 1.1.0 to 1.1.1
const { | ||
_retrieveDelivery, | ||
_listDeliveries, | ||
_createDelivery, | ||
_purchaseDelivery, | ||
_refundDelivery, | ||
_updateDelivery, | ||
retrieveDelivery, | ||
listDeliveries, | ||
createDelivery, | ||
purchaseDelivery, | ||
refundDelivery, | ||
updateDelivery, | ||
} = require("./modules/deliveries"); | ||
const { _retrieveLocation } = require("./modules/locations"); | ||
const { _retrieveProfile } = require("./modules/profile"); | ||
const { retrieveLocation } = require("./modules/locations"); | ||
const { retrieveProfile } = require("./modules/profile"); | ||
@@ -53,3 +53,3 @@ const _createNetworkConfig = require("./util/network-config"); | ||
const _config = _createNetworkConfig(apikey, env); | ||
_retrieveDelivery(id, _config) | ||
retrieveDelivery(id, _config) | ||
.then((data) => { | ||
@@ -94,3 +94,3 @@ resolve(data); | ||
const _config = _createNetworkConfig(apikey, env); | ||
_listDeliveries(options, _config) | ||
listDeliveries(options, _config) | ||
.then((data) => { | ||
@@ -226,3 +226,3 @@ resolve(data); | ||
const _config = _createNetworkConfig(apikey, env); | ||
_createDelivery(sender, recipient, parcels, options, _config) | ||
createDelivery(sender, recipient, parcels, options, _config) | ||
.then((data) => { | ||
@@ -266,3 +266,3 @@ resolve(data); | ||
const _config = _createNetworkConfig(apikey, env); | ||
_purchaseDelivery(delivery_id, rate_id, options, _config) | ||
purchaseDelivery(delivery_id, rate_id, options, _config) | ||
.then((data) => { | ||
@@ -298,3 +298,3 @@ resolve(data); | ||
const _config = _createNetworkConfig(apikey, env); | ||
_refundDelivery(delivery_id, _config) | ||
refundDelivery(delivery_id, _config) | ||
.then((data) => { | ||
@@ -358,3 +358,3 @@ resolve(data); | ||
const _config = _createNetworkConfig(apikey, env); | ||
_updateDelivery(delivery_id, update, _config) | ||
updateDelivery(delivery_id, update, _config) | ||
.then((data) => { | ||
@@ -392,3 +392,3 @@ resolve(data); | ||
const _config = _createNetworkConfig(apikey, env); | ||
_retrieveLocation(id, _config) | ||
retrieveLocation(id, _config) | ||
.then((data) => { | ||
@@ -425,3 +425,3 @@ resolve(data); | ||
const _config = _createNetworkConfig(apikey, env); | ||
_retrieveProfile(id, _config) | ||
retrieveProfile(_config) | ||
.then((data) => { | ||
@@ -428,0 +428,0 @@ resolve(data); |
const axios = require("axios").default; | ||
function _retrieveDelivery(id, _config) { | ||
function retrieveDelivery(id, _config) { | ||
return new Promise((resolve, reject) => { | ||
@@ -21,3 +21,3 @@ axios({ | ||
function _listDeliveries(options, _config) { | ||
function listDeliveries(options, _config) { | ||
return new Promise((resolve, reject) => { | ||
@@ -58,3 +58,3 @@ let url = `${_config.base_url}/deliveries?`; | ||
function _createDelivery(sender, recipient, parcels, options, _config) { | ||
function createDelivery(sender, recipient, parcels, options, _config) { | ||
return new Promise((resolve, reject) => { | ||
@@ -83,3 +83,3 @@ axios({ | ||
function _purchaseDelivery(delivery_id, rate_id, options, _config) { | ||
function purchaseDelivery(delivery_id, rate_id, options, _config) { | ||
return new Promise((resolve, reject) => { | ||
@@ -106,3 +106,3 @@ axios({ | ||
function _refundDelivery(delivery_id, _config) { | ||
function refundDelivery(delivery_id, _config) { | ||
return new Promise((resolve, reject) => { | ||
@@ -125,3 +125,3 @@ axios({ | ||
function _updateDelivery(delivery_id, update, _config) { | ||
function updateDelivery(delivery_id, update, _config) { | ||
return new Promise((resolve, reject) => { | ||
@@ -146,8 +146,8 @@ axios({ | ||
module.exports = { | ||
_retrieveDelivery, | ||
_listDeliveries, | ||
_createDelivery, | ||
_purchaseDelivery, | ||
_refundDelivery, | ||
_updateDelivery, | ||
retrieveDelivery, | ||
listDeliveries, | ||
createDelivery, | ||
purchaseDelivery, | ||
refundDelivery, | ||
updateDelivery, | ||
}; |
const axios = require("axios").default; | ||
function _retrieveLocation(id, networkConfig) { | ||
function retrieveLocation(id, networkConfig) { | ||
return new Promise((resolve, reject) => { | ||
@@ -23,94 +23,4 @@ axios({ | ||
// function _listDeliveries() { | ||
// return new Promise((resolve, reject) => { | ||
// axios({ | ||
// method: "GET", | ||
// url: `${networkConfig.base_url}/deliveries/`, | ||
// headers: { | ||
// Authorization: "apikey " + networkConfig.api_key, | ||
// }, | ||
// }) | ||
// .then((res) => { | ||
// console.log(res.data); | ||
// resolve(res.data); | ||
// }) | ||
// .catch((err) => { | ||
// console.error(err); | ||
// reject(err); | ||
// }); | ||
// }); | ||
// } | ||
// function _createDelivery(sender, recipient, parcels, options, _config) { | ||
// return new Promise((resolve, reject) => { | ||
// axios({ | ||
// method: "POST", | ||
// url: `${networkConfig.base_url}/deliveries/`, | ||
// headers: { | ||
// Authorization: "apikey " + networkConfig.api_key, | ||
// }, | ||
// data: { | ||
// sender: sender, | ||
// recipient: recipient, | ||
// parcels: parcels, | ||
// options: options, | ||
// }, | ||
// }) | ||
// .then((res) => { | ||
// console.log(res.data); | ||
// resolve(res.data); | ||
// }) | ||
// .catch((err) => { | ||
// console.error(err); | ||
// reject(err); | ||
// }); | ||
// }); | ||
// } | ||
// function _purchaseDelivery(delivery_id, rate_id, options, _config) { | ||
// return new Promise((resolve, reject) => { | ||
// axios({ | ||
// method: "POST", | ||
// url: `${networkConfig.base_url}/deliveries/${delivery_id}`, | ||
// headers: { | ||
// Authorization: "apikey " + networkConfig.api_key, | ||
// }, | ||
// data: { | ||
// rate_id: rate_id, | ||
// payment_method: options.payment_method ? options.payment_method : null, | ||
// }, | ||
// }) | ||
// .then((res) => { | ||
// console.log(res.data); | ||
// resolve(res.data); | ||
// }) | ||
// .catch((err) => { | ||
// console.error(err); | ||
// reject(err); | ||
// }); | ||
// }); | ||
// } | ||
// function _refundDelivery(delivery_id, _config) { | ||
// return new Promise((resolve, reject) => { | ||
// axios({ | ||
// method: "POST", | ||
// url: `${networkConfig.base_url}/deliveries/${delivery_id}/refund`, | ||
// headers: { | ||
// Authorization: "apikey " + networkConfig.api_key, | ||
// }, | ||
// }) | ||
// .then((res) => { | ||
// console.log(res.data); | ||
// resolve(res.data); | ||
// }) | ||
// .catch((err) => { | ||
// console.error(err); | ||
// reject(err); | ||
// }); | ||
// }); | ||
// } | ||
module.exports = { | ||
_retrieveLocation, | ||
retrieveLocation, | ||
}; |
const axios = require("axios").default; | ||
function _retrieveProfile(networkConfig) { | ||
function retrieveProfile(networkConfig) { | ||
return new Promise((resolve, reject) => { | ||
@@ -23,3 +23,3 @@ axios({ | ||
module.exports = { | ||
_retrieveProfile, | ||
retrieveProfile, | ||
}; |
{ | ||
"name": "dispatch-node", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "The node wrapper for the dispatch Sender API.", | ||
"main": "lib/dispatch.js", | ||
"scripts": { | ||
"doc": "jsdoc -c jsdoc.json --readme ./README.md" | ||
"doc": "jsdoc -c jsdoc.json --readme ./README.md", | ||
"deliveries.list": "node ./bin/index deliveries.list", | ||
"deliveries.create": "node ./bin/index deliveries.create", | ||
"deliveries.buy": "node ./bin/index deliveries.buy", | ||
"deliveries.retrieve": "node ./bin/index deliveries.retrieve", | ||
"deliveries.refund": "node ./bin/index deliveries.refund", | ||
"profile.retrieve": "node ./bin/index profile.retrieve", | ||
"test": "node ./bin/index test", | ||
"publish": "node ./bin/index test && npm publish" | ||
}, | ||
@@ -36,4 +44,8 @@ "repository": { | ||
"better-docs": "^2.3.2", | ||
"colors": "^1.4.0", | ||
"commander": "^8.0.0", | ||
"dotenv": "^10.0.0", | ||
"jsdoc": "^3.6.6", | ||
"jsdoc-http-plugin": "^0.3.2" | ||
"jsdoc-http-plugin": "^0.3.2", | ||
"log-symbols": "^2.2.0" | ||
}, | ||
@@ -40,0 +52,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
2358107
175
6426
7
15