notherbase-fs 1.5.3 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/controllers/creation.js +90 -0
- package/controllers/spirit-world.js +110 -0
- package/controllers/spirits/attribute.js +47 -0
- package/controllers/spirits/contact.js +16 -0
- package/controllers/spirits/inventory.js +71 -0
- package/controllers/spirits/item.js +41 -0
- package/controllers/spirits/serve.js +33 -0
- package/controllers/spirits/user.js +130 -0
- package/controllers/spirits/util.js +39 -0
- package/models/index.js +130 -14
- package/models/spirit.js +159 -0
- package/notherbase-fs.js +23 -73
- package/package.json +2 -2
- package/public/js/commune.js +22 -0
- package/public/js/establishment.js +44 -0
- package/public/js/memories.js +29 -30
- package/public/styles/main.css +9 -99
- package/test/explorer/coast/tall-beach/nono-cove/server-scripts/emailTime.js +7 -3
- package/test/explorer/coast/tall-beach/nono-cove/views/index.ejs +38 -60
- package/test/pages/server-scripts/emailTime.js +15 -0
- package/test/pages/test.ejs +30 -3
- package/test/the-front/server-scripts/emailTime.js +7 -3
- package/test/the-front/server-scripts/migrateBig.js +3 -0
- package/test/the-front/views/check.ejs +88 -2
- package/test/the-front/views/index.ejs +43 -101
- package/test-index.js +5 -0
- package/views/account.ejs +25 -36
- package/views/explorer.ejs +48 -1
- package/views/inventory.ejs +41 -99
- package/views/menu.ejs +8 -2
- package/views/more.ejs +8 -14
- package/views/player.ejs +37 -24
- package/controllers/authCheck.js +0 -18
- package/controllers/contact.js +0 -22
- package/controllers/explorer.js +0 -150
- package/controllers/game.js +0 -59
- package/controllers/index.js +0 -10
- package/controllers/inventory.js +0 -116
- package/controllers/item.js +0 -70
- package/controllers/pages.js +0 -33
- package/controllers/the-front.js +0 -70
- package/controllers/user.js +0 -413
- package/controllers/void.js +0 -16
- package/models/chat.js +0 -9
- package/models/contact.js +0 -14
- package/models/detail.js +0 -16
- package/models/game.js +0 -8
- package/models/inventory.js +0 -19
- package/models/item.js +0 -12
- package/models/page.js +0 -14
- package/models/user.js +0 -25
- package/test/test-index.js +0 -5
package/controllers/user.js
DELETED
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
const router = express.Router();
|
|
3
|
-
import bcrypt from "bcrypt";
|
|
4
|
-
|
|
5
|
-
// Import my Data
|
|
6
|
-
import { user, inventory, sendMail } from "../models/index.js";
|
|
7
|
-
|
|
8
|
-
import authCheck from "./authCheck.js";
|
|
9
|
-
|
|
10
|
-
let getAttributes = async function getAttributes(userID) {
|
|
11
|
-
try {
|
|
12
|
-
let foundUser = await user.findById(userID, 'attributes');
|
|
13
|
-
|
|
14
|
-
if (!foundUser.attributes || foundUser.attributes == {}) {
|
|
15
|
-
foundUser.attributes = {
|
|
16
|
-
translation: 0,
|
|
17
|
-
strength: 0,
|
|
18
|
-
agility: 0,
|
|
19
|
-
defense: 0
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
await foundUser.save();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return foundUser;
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
console.log(err);
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
router.get("/basic", async function(req, res) {
|
|
34
|
-
try {
|
|
35
|
-
if (req.session.currentUser) {
|
|
36
|
-
let foundUser = await user.findById(req.session.currentUser, 'username email');
|
|
37
|
-
|
|
38
|
-
res.status(200).send(foundUser);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
res.status(401).send("Please login first!");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch(err) {
|
|
45
|
-
console.log(err);
|
|
46
|
-
res.status(500).end();
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
router.get("/logout", authCheck, async function(req, res) {
|
|
51
|
-
try {
|
|
52
|
-
await req.session.destroy();
|
|
53
|
-
|
|
54
|
-
res.redirect(`/`);
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
console.log(err);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
router.post("/logout", authCheck, async function(req, res) {
|
|
62
|
-
try {
|
|
63
|
-
await req.session.destroy();
|
|
64
|
-
|
|
65
|
-
res.send("done");
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
console.log(err);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
router.get("/all", async function(req, res) {
|
|
73
|
-
try {
|
|
74
|
-
let foundUsers = await user.find({}, 'username coin home authLevels location attributes email');
|
|
75
|
-
|
|
76
|
-
res.status(200).send({ foundUsers: foundUsers });
|
|
77
|
-
}
|
|
78
|
-
catch(err) {
|
|
79
|
-
res.status(500).end();
|
|
80
|
-
console.log(err);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
router.get("/password-reset", async function(req, res) {
|
|
85
|
-
try {
|
|
86
|
-
let foundUser = await user.findOne({ email: req.query.email });
|
|
87
|
-
|
|
88
|
-
if (foundUser) {
|
|
89
|
-
foundUser.reset.token = Math.floor(Math.random() * 9999);
|
|
90
|
-
foundUser.reset.exp = Date.now() + (1000 * 60 * 30);
|
|
91
|
-
|
|
92
|
-
await foundUser.save();
|
|
93
|
-
|
|
94
|
-
sendMail.passwordReset(req.query.email, foundUser.reset.token);
|
|
95
|
-
|
|
96
|
-
res.status(200).send("Reset link sent!");
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
res.status(401).send("Failed: user not found!");
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
catch(err) {
|
|
103
|
-
console.log(err);
|
|
104
|
-
|
|
105
|
-
res.status(500).send("Update Failed: Database error!");
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
router.post("/password-reset", async function(req, res) {
|
|
110
|
-
try {
|
|
111
|
-
const foundUser = await user.findOne({ "reset.token": req.body.token });
|
|
112
|
-
|
|
113
|
-
if (foundUser) {
|
|
114
|
-
if (foundUser.reset.exp > Date.now()) {
|
|
115
|
-
if (req.body.password !== req.body.confirmation) res.status(400).send("Passwords must match!");
|
|
116
|
-
else {
|
|
117
|
-
foundUser.reset = {};
|
|
118
|
-
|
|
119
|
-
const salt = await bcrypt.genSalt(10);
|
|
120
|
-
const hash = await bcrypt.hash(req.body.password, salt);
|
|
121
|
-
|
|
122
|
-
foundUser.password = hash;
|
|
123
|
-
await foundUser.save();
|
|
124
|
-
|
|
125
|
-
res.status(200).send("Password changed successfully!");
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
else res.status(498).send("Reset token expired!");
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
res.status(404).send("Reset token not valid!");
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
catch(err) {
|
|
135
|
-
console.log(err);
|
|
136
|
-
|
|
137
|
-
res.status(500).send("Internal Server Error!");
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
router.get("/attributes", async function(req, res) {
|
|
142
|
-
try {
|
|
143
|
-
if (req.session.currentUser) {
|
|
144
|
-
let foundUser = await getAttributes(req.session.currentUser);
|
|
145
|
-
|
|
146
|
-
res.status(200).send(foundUser.attributes);
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
res.status(401).send("Please login first!");
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
catch(err) {
|
|
153
|
-
res.status(500).end();
|
|
154
|
-
console.log(err);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
router.get("/attributes/check", authCheck, async function(req, res) {
|
|
159
|
-
try {
|
|
160
|
-
if (req.session.currentUser) {
|
|
161
|
-
let foundUser = await getAttributes(req.session.currentUser);
|
|
162
|
-
|
|
163
|
-
if (foundUser.attributes[req.query.check] >= parseInt(req.query.against)) {
|
|
164
|
-
res.status(200).send("Pass");
|
|
165
|
-
}
|
|
166
|
-
else res.status(200).send("Fail");
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
res.status(401).send("Please login first!");
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
catch(err) {
|
|
173
|
-
res.status(500).end();
|
|
174
|
-
console.log(err);
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
router.post("/register", async function(req, res) {
|
|
179
|
-
try {
|
|
180
|
-
let foundAccount = await user.findOne({ username: req.body.username });
|
|
181
|
-
|
|
182
|
-
if (!foundAccount) {
|
|
183
|
-
const salt = await bcrypt.genSalt(10);
|
|
184
|
-
const hash = await bcrypt.hash(req.body.password, salt);
|
|
185
|
-
|
|
186
|
-
let qAuth = await user.create({
|
|
187
|
-
username: req.body.username,
|
|
188
|
-
password: hash,
|
|
189
|
-
email: req.body.email,
|
|
190
|
-
coin: 0,
|
|
191
|
-
home: "/",
|
|
192
|
-
authLevels: [ "Basic" ],
|
|
193
|
-
location: "/the-front",
|
|
194
|
-
attributes: {
|
|
195
|
-
translation: 0,
|
|
196
|
-
strength: 0,
|
|
197
|
-
agility: 0,
|
|
198
|
-
defense: 0
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
await inventory.create({
|
|
203
|
-
user: qAuth._id,
|
|
204
|
-
items: []
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
res.status(200).send("Registration Successful!");
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
res.status(400).send("Registration Failed: username taken!");
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
catch(err) {
|
|
214
|
-
console.log(err);
|
|
215
|
-
|
|
216
|
-
res.status(500).send("Registration Failed: Database error!");
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
router.post("/login", async function(req, res) {
|
|
221
|
-
try {
|
|
222
|
-
const foundAccount = await user.findOne({ email: req.body.email });
|
|
223
|
-
|
|
224
|
-
if (foundAccount) {
|
|
225
|
-
if (await bcrypt.compare(req.body.password, foundAccount.password)) {
|
|
226
|
-
req.session.currentUser = foundAccount._id;
|
|
227
|
-
|
|
228
|
-
res.status(200).send("Login successful!");
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
res.status(401).send("Login Failed: Password incorrect!");
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
res.status(401).send("Login Failed: Email not found!");
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
catch(err) {
|
|
239
|
-
console.log(err);
|
|
240
|
-
|
|
241
|
-
res.status(500).send("Login Failed: Database error!");
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
router.post("/email", async function(req, res) {
|
|
246
|
-
try {
|
|
247
|
-
if (req.session.currentUser) {
|
|
248
|
-
let foundAccount = await user.findOne({ email: req.body.email });
|
|
249
|
-
|
|
250
|
-
if (!foundAccount) {
|
|
251
|
-
let foundUser = await user.findById(req.session.currentUser);
|
|
252
|
-
|
|
253
|
-
if (foundUser) {
|
|
254
|
-
foundUser.email = req.body.email;
|
|
255
|
-
await foundUser.save();
|
|
256
|
-
|
|
257
|
-
res.status(200).send("Update successful!");
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
res.status(401).send("Update Failed: user not found!");
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
res.status(401).send("Update Failed: email already in use!");
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
res.status(401).send("Please login first!");
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
catch(err) {
|
|
272
|
-
console.log(err);
|
|
273
|
-
|
|
274
|
-
res.status(500).send("Update Failed: Database error!");
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
router.post("/username", async function(req, res) {
|
|
279
|
-
try {
|
|
280
|
-
if (req.session.currentUser) {
|
|
281
|
-
let foundAccount = await user.findOne({ username: req.body.username });
|
|
282
|
-
|
|
283
|
-
if (!foundAccount) {
|
|
284
|
-
let foundUser = await user.findById(req.session.currentUser);
|
|
285
|
-
|
|
286
|
-
if (foundUser) {
|
|
287
|
-
foundUser.username = req.body.username;
|
|
288
|
-
await foundUser.save();
|
|
289
|
-
|
|
290
|
-
res.status(200).send("Update successful!");
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
res.status(401).send("Update Failed: user not found!");
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
res.status(401).send("Update Failed: username taken!");
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
res.status(401).send("Please login first!");
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
catch(err) {
|
|
305
|
-
console.log(err);
|
|
306
|
-
|
|
307
|
-
res.status(500).send("Update Failed: Database error!");
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
router.post("/password", async function(req, res) {
|
|
312
|
-
try {
|
|
313
|
-
if (req.session.currentUser) {
|
|
314
|
-
let foundUser = await user.findById(req.session.currentUser);
|
|
315
|
-
|
|
316
|
-
if (foundUser) {
|
|
317
|
-
const salt = await bcrypt.genSalt(10);
|
|
318
|
-
const hash = await bcrypt.hash(req.body.password, salt);
|
|
319
|
-
foundUser.password = hash;
|
|
320
|
-
await foundUser.save();
|
|
321
|
-
|
|
322
|
-
res.status(200).send("Update successful!");
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
res.status(401).send("Update Failed: user not found!");
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
res.status(401).send("Please login first!");
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
catch(err) {
|
|
333
|
-
console.log(err);
|
|
334
|
-
|
|
335
|
-
res.status(500).send("Update Failed: Database error!");
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
router.post("/attributes", async function(req, res) {
|
|
340
|
-
try {
|
|
341
|
-
if (req.session.currentUser) {
|
|
342
|
-
let foundUser = await getAttributes(req.session.currentUser);
|
|
343
|
-
|
|
344
|
-
if (foundUser) {
|
|
345
|
-
foundUser.attributes[req.body.change] = parseInt(req.body.to);
|
|
346
|
-
await foundUser.save();
|
|
347
|
-
|
|
348
|
-
res.status(200).send("AttUp successful!");
|
|
349
|
-
}
|
|
350
|
-
else {
|
|
351
|
-
res.status(401).send("AttUp Failed: user not found!");
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
res.status(401).send("Please login first!");
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
catch(err) {
|
|
359
|
-
console.log(err);
|
|
360
|
-
|
|
361
|
-
res.status(500).send("AttUp Failed: Database error!");
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
router.post("/attributes/increment", async function(req, res) {
|
|
366
|
-
try {
|
|
367
|
-
if (req.session.currentUser) {
|
|
368
|
-
let foundUser = await getAttributes(req.session.currentUser);
|
|
369
|
-
|
|
370
|
-
if (foundUser) {
|
|
371
|
-
if (foundUser.attributes[req.body.change] < req.body.max) {
|
|
372
|
-
foundUser.attributes[req.body.change]++;
|
|
373
|
-
await foundUser.save();
|
|
374
|
-
res.status(200).send({ newLevel: foundUser.attributes[req.body.change] });
|
|
375
|
-
}
|
|
376
|
-
else {
|
|
377
|
-
res.status(304).send({ newLevel: foundUser.attributes[req.body.change] });
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
res.status(401).send("AttUp Failed: user not found!");
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
res.status(401).send("Please login first!");
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
catch(err) {
|
|
389
|
-
console.log(err);
|
|
390
|
-
|
|
391
|
-
res.status(500).send("AttUp Failed: Database error!");
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
router.delete("/", authCheck, async function(req, res) {
|
|
396
|
-
try {
|
|
397
|
-
if (req.session.currentUser) {
|
|
398
|
-
await user.findByIdAndDelete(req.session.currentUser);
|
|
399
|
-
await req.session.destroy();
|
|
400
|
-
|
|
401
|
-
res.redirect("/");
|
|
402
|
-
}
|
|
403
|
-
else {
|
|
404
|
-
res.status(401).send("Please login first!");
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
catch {
|
|
408
|
-
console.log(err);
|
|
409
|
-
res.status(500).send("Delete Failed: Database error!");
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
export default router;
|
package/controllers/void.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
let router = express.Router();
|
|
3
|
-
|
|
4
|
-
//the void
|
|
5
|
-
router.use(function(req, res){
|
|
6
|
-
res.render(`explorer`,
|
|
7
|
-
{
|
|
8
|
-
siteTitle: "NotherBase | The Void",
|
|
9
|
-
user: null,
|
|
10
|
-
inventory: null,
|
|
11
|
-
main: `${req.voidDir}/index`,
|
|
12
|
-
route: `/void`
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export default router;
|
package/models/chat.js
DELETED
package/models/contact.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
// This shows the kind of documents we're interacting with in the db
|
|
4
|
-
const contact = mongoose.model('contacts', new mongoose.Schema({
|
|
5
|
-
user: {
|
|
6
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
7
|
-
ref: "users",
|
|
8
|
-
required: true
|
|
9
|
-
},
|
|
10
|
-
location: String,
|
|
11
|
-
content: String
|
|
12
|
-
}));
|
|
13
|
-
|
|
14
|
-
export default contact;
|
package/models/detail.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
const detail = mongoose.model('details', new mongoose.Schema({
|
|
4
|
-
_lastUpdate: Number,
|
|
5
|
-
route: String,
|
|
6
|
-
service: String,
|
|
7
|
-
scope: String,
|
|
8
|
-
user: {
|
|
9
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
10
|
-
ref: "users",
|
|
11
|
-
required: false
|
|
12
|
-
},
|
|
13
|
-
data: {}
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
export default detail;
|
package/models/game.js
DELETED
package/models/inventory.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
// This shows the kind of documents we're interacting with in the db
|
|
4
|
-
const inventory = mongoose.model('inventories', new mongoose.Schema({
|
|
5
|
-
user: {
|
|
6
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
7
|
-
ref: "users",
|
|
8
|
-
required: true
|
|
9
|
-
},
|
|
10
|
-
items: [{
|
|
11
|
-
item: {
|
|
12
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
13
|
-
ref: "items"
|
|
14
|
-
},
|
|
15
|
-
amount: Number
|
|
16
|
-
}]
|
|
17
|
-
}));
|
|
18
|
-
|
|
19
|
-
export default inventory;
|
package/models/item.js
DELETED
package/models/page.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
const page = mongoose.model('pages', new mongoose.Schema({
|
|
4
|
-
name: String,
|
|
5
|
-
type: String,
|
|
6
|
-
user: {
|
|
7
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
8
|
-
ref: "users",
|
|
9
|
-
required: false
|
|
10
|
-
},
|
|
11
|
-
data: {}
|
|
12
|
-
}));
|
|
13
|
-
|
|
14
|
-
export default page;
|
package/models/user.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
//convert schema to model
|
|
4
|
-
const user = mongoose.model('users', new mongoose.Schema({
|
|
5
|
-
username: String,
|
|
6
|
-
password: String,
|
|
7
|
-
email: String,
|
|
8
|
-
coin: Number,
|
|
9
|
-
home: String,
|
|
10
|
-
authLevels: [ String ],
|
|
11
|
-
location: String,
|
|
12
|
-
attributes: {
|
|
13
|
-
translation: Number,
|
|
14
|
-
strength: Number,
|
|
15
|
-
agility: Number,
|
|
16
|
-
defense: Number
|
|
17
|
-
},
|
|
18
|
-
reset: {
|
|
19
|
-
token: Number,
|
|
20
|
-
exp: Number
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
export default user;
|
package/test/test-index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import NotherBaseFS from "../notherbase-fs.js";
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
|
-
const __dirname = fileURLToPath(new URL('./', import.meta.url));
|
|
4
|
-
|
|
5
|
-
const notherBaseFS = new NotherBaseFS(`${__dirname}explorer`, `${__dirname}void`, `${__dirname}the-front`, `${__dirname}pages`);
|