@incodelang/accounts
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@incodelang/accounts", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An API for simple Account Management", | ||
@@ -33,4 +33,5 @@ "main": "src/index.js", | ||
"express": "^4.17.1", | ||
"node-fetch": "^3.0.0", | ||
"typescript": "^4.4.3" | ||
} | ||
} |
@@ -16,2 +16,4 @@ /** | ||
const sampleApp = require('./lib/module/sampleApp') | ||
const postboxes = require('./lib/module/postboxes') | ||
const {WebClient} = require('./lib/module/WebClient') | ||
@@ -23,3 +25,5 @@ module.exports = { | ||
users, | ||
sampleApp | ||
sampleApp, | ||
postboxes, | ||
WebClient | ||
} |
@@ -10,2 +10,3 @@ /** | ||
const data = require('./module/data') | ||
const postboxes = require('./module/postboxes'); | ||
@@ -15,6 +16,6 @@ const bodyParser = require("body-parser"); | ||
module.exports = function(options = { | ||
module.exports = function (options = { | ||
app: null | ||
}) { | ||
options.app.use(cors()); | ||
@@ -123,2 +124,52 @@ options.app.use(bodyParser()); | ||
options.app.post("/api/v1/user/postboxes/create", (req, res) => { | ||
if (req.body.username && req.body.password && req.body.name) { | ||
res.end(JSON.stringify( | ||
postboxes.createBox(req.body.username, req.body.password, req.body.name) | ||
)); | ||
} else { | ||
res.end("{\"error\": true, \"message\": \"Invalid Request body.\"}") | ||
} | ||
}); | ||
options.app.post("/api/v1/user/postboxes/delete", (req, res) => { | ||
if (req.body.username && req.body.password && req.body.name) { | ||
res.end(JSON.stringify( | ||
postboxes.deleteBox(req.body.username, req.body.password, req.body.name) | ||
)); | ||
} else { | ||
res.end("{\"error\": true, \"message\": \"Invalid Request body.\"}") | ||
} | ||
}) | ||
options.app.post("/api/v1/user/postboxes/add", (req, res) => { | ||
if (req.body.username && req.body.password && req.body.name && req.body.owner && req.body.entry) { | ||
res.end(JSON.stringify( | ||
postboxes.addToBox(req.body.username, req.body.password, req.body.name, req.body.owner, req.body.entry) | ||
)); | ||
} else { | ||
res.end("{\"error\": true, \"message\": \"Invalid Request body.\"}") | ||
} | ||
}) | ||
options.app.post("/api/v1/user/postboxes/clear", (req, res) => { | ||
if (req.body.username && req.body.password && req.body.name) { | ||
res.end(JSON.stringify( | ||
postboxes.clearBox(req.body.username, req.body.password, req.body.name) | ||
)); | ||
} else { | ||
res.end("{\"error\": true, \"message\": \"Invalid Request body.\"}") | ||
} | ||
}) | ||
options.app.post("/api/v1/user/postboxes/read", (req, res) => { | ||
if (req.body.username && req.body.password && req.body.name) { | ||
res.end(JSON.stringify( | ||
postboxes.readBox(req.body.username, req.body.password, req.body.name) | ||
)); | ||
} else { | ||
res.end("{\"error\": true, \"message\": \"Invalid Request body.\"}") | ||
} | ||
}) | ||
options.app.post('/api/v1/user/users/data/all', (req, res) => { | ||
@@ -125,0 +176,0 @@ if (req.body.username && req.body.password) { |
@@ -10,2 +10,3 @@ /** | ||
const checkfile = require('./checkfile'); | ||
const {data} = require("./data"); | ||
@@ -199,2 +200,13 @@ checkfile(path.join(process.env.ACC_PRIV_PATH, "users.json"), "{}") | ||
module.exports = {existsUser, createUser, deleteUser, login, updateUsername, updatePassword, storeData, getData, getAllData} | ||
module.exports = { | ||
existsUser, | ||
createUser, | ||
deleteUser, | ||
login, | ||
updateUsername, | ||
updatePassword, | ||
storeData, | ||
getData, | ||
getAllData | ||
} |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
79294
25
1047
5
15
1
+ Addednode-fetch@^3.0.0
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)