Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@incodelang/accounts

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@incodelang/accounts - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

src/lib/module/postboxes.js

3

package.json
{
"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
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc