quickonline
Advanced tools
Comparing version 1.0.9 to 1.1.0
{ | ||
"name": "quickonline", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Simple package makes quick.db, online data (it's simple)!", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"start": "node index.js", | ||
"dev": "nodemon index.js" | ||
"dev": "nodemon app.js" | ||
}, | ||
@@ -15,7 +15,7 @@ "keywords": [ | ||
], | ||
"author": "Darkboy", | ||
"author": "Darkboy + AzizJaber", | ||
"license": "ISC", | ||
"dependencies": { | ||
"superagent": "^6.1.0" | ||
} | ||
} |
@@ -43,3 +43,4 @@ # quickonline | ||
- Fast and easy to use | ||
- This Package Is Made With 💖 By ! Darkboy🍭#9966 | ||
- This Package Is Made With 💖 By ! Darkboy🍭#9966 + AzizJaber.#5414 | ||
@@ -0,1 +1,2 @@ | ||
const { json } = require("express"); | ||
const superagent = require("superagent"); | ||
@@ -22,2 +23,11 @@ class bot { | ||
if (!valuekey) throw new Error('[Value] Missing data\n need help? join http://discord.gg/devs') | ||
// so simpley i made this fuction to check if the data , is an object or no so u can set and add object values | ||
if(typeof valuekey === "object") { | ||
// here we simlpey just make the object into json data then send it to url to make it again object there then save it on the database. | ||
let data = superagent.get(`${this.url}/quickonline/setobject?set=${key}&value=${JSON.stringify(valuekey)}&username=${this.username}&password=${this.password}`) // here we send arequest into our Database. | ||
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ') | ||
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs") | ||
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs") | ||
return data; | ||
} | ||
let data = superagent.get(`${this.url}/quickonline/set?set=${key}&value=${valuekey}&username=${this.username}&password=${this.password}`) | ||
@@ -42,6 +52,10 @@ if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ') | ||
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs") | ||
return (await data).body; | ||
try { | ||
let dataing = JSON.parse((await data).body) | ||
return dataing | ||
} catch(err) { | ||
return (await data).body | ||
} | ||
} | ||
/** | ||
@@ -110,3 +124,8 @@ * delete adata from the database | ||
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs") | ||
return (await data).body | ||
try{ | ||
let datating = JSON.parse((await data).body) | ||
return datating | ||
} catch(err) { | ||
return (await data).body | ||
} | ||
} | ||
@@ -113,0 +132,0 @@ /** |
@@ -59,2 +59,6 @@ class host { | ||
let data = db.get(key) | ||
if(typeof data === "object"){ | ||
return res.json(JSON.stringify(data) || null); | ||
} | ||
await res.json(`${data || null}`) | ||
@@ -160,9 +164,33 @@ }) | ||
let data = db.get(key) | ||
let pog = { | ||
key: key | ||
, data: data | ||
if(typeof data === 'object') { | ||
return res.json(JSON.stringify(data)) | ||
} | ||
let pogchamp = { | ||
key: key, | ||
data: data | ||
} | ||
return await res.json(pogchamp) | ||
}) | ||
return await res.json(pog) | ||
}) | ||
app.get('/quickonline/setobject', async (req,res) =>{ | ||
let Key = req.query.set | ||
let value = req.query.value | ||
let username = req.query.username | ||
let password = req.query.password | ||
// so when i use ! nothing happens so i had to do this sorry js | ||
if (username === this.username) {} else { | ||
return res.send(`invaild username`) | ||
} | ||
if (password === this.password) {} else { | ||
return res.send(`invaild password`) | ||
} | ||
if (!value && Key) return res.send(false) | ||
let data = JSON.parse(value) | ||
await db.set(Key, | ||
data | ||
) | ||
}) | ||
app.get('/quickonline/check', async(req, res) => { | ||
@@ -181,5 +209,28 @@ let username = req.query.username | ||
}) | ||
} | ||
/** | ||
* THIS PART IS MADE FOR OUR DASHBOARD SO U CAN TRACK UR DATA FROM IT PLAYING ON THE DATA WONT MAKE UR URL WORKING ON THE DASHBOARD | ||
*/ | ||
// -- Coming soon | ||
app.get("/quickonline/restart", async(req,res)=>{ | ||
// on this fuction we do ask for the username & password for the database | ||
let username = req.query.username | ||
let password = req.query.password | ||
if (username === this.username) {} else { | ||
return res.send(`invaild username`) | ||
} | ||
if (password === this.password) {} else { | ||
return res.send(`invaild password`) | ||
} | ||
await res.send(`Restarting database...`) | ||
await process.exit(1) | ||
}) | ||
// here just afuction of checking if the database are alive or no! we wont ask for password or username bc nothing would get scraped from this | ||
app.get("/quickonline/alive", async(req,res)=>{ | ||
await res.send(true) | ||
}) | ||
} | ||
} | ||
module.exports = host; |
26169
6
353
46
1
+ Addedsuperagent@^6.1.0
+ Addedasynckit@0.4.0(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedcookiejar@2.1.4(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedes-set-tostringtag@2.1.0(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedform-data@3.0.3(transitive)
+ Addedformidable@1.2.6(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@2.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.1.3(transitive)
+ Addedobject-inspect@1.13.4(transitive)
+ Addedqs@6.14.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsemver@7.7.1(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedsuperagent@6.1.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)