Compare commits

...

2 Commits

Author SHA1 Message Date
214e00d291
fix registration again 2023-05-06 23:17:10 +03:00
286165548f
upgrade yarn 2023-05-04 22:10:53 +03:00
9 changed files with 7286 additions and 5058 deletions

4
.gitignore vendored
View File

@ -8,4 +8,6 @@ build
# files/build is a symlink to the build directory of the frontend
files/build
files/avatars/*
!files/avatars/default.png
!files/avatars/default.png
.yarn

View File

@ -1,3 +1,5 @@
npmScopes:
navy.gif:
npmRegistryServer: https://registry.corgi.wtf
nodeLinker: node-modules
npmRegistryServer: "https://registry.corgi.wtf"
yarnPath: .yarn/releases/yarn-3.5.1.cjs

View File

@ -5,7 +5,6 @@
"main": "index.js",
"author": "Navy.gif",
"license": "MIT",
"private": false,
"type": "module",
"repository": {
"url": "https://git.corgi.wtf/Navy.gif/webserver-framework",
@ -13,8 +12,8 @@
},
"dependencies": {
"@discordjs/collection": "^1.2.0",
"@navy.gif/commandparser": "^1.4.3",
"@navy.gif/logger": "^2.3.2",
"@navy.gif/commandparser": "^1.4.5",
"@navy.gif/logger": "^2.3.3",
"@navy.gif/passport-discord": "^0.2.2-b",
"@navy.gif/wrappers": "^1.3.9",
"@types/cors": "^2.8.13",
@ -60,5 +59,6 @@
},
"engines": {
"node": ">=18.0.0"
}
},
"packageManager": "yarn@3.5.1"
}

View File

@ -191,9 +191,11 @@ class Controller extends EventEmitter {
const { command, ...rest } = result;
if (rest.args.help)
// return this.#_logger.info(`COMMAND HELP\n${command.help}`);
return this.#_logger.info(`Command help unavailable at this time`);
if (rest.args.help) {
if (command.help)
return command.help;
return this.#_logger.info(`Help for ${command.name} unavailable at this time`);
}
let response = null;
try {

View File

@ -245,8 +245,10 @@ class Shard extends EventEmitter {
if (this.#_awaitingShutdown)
this.#_awaitingShutdown();
if (code !== 0)
this.#_crashes.push(Date.now() - this.spawnedAt);
if (code !== 0) {
this.#_crashes.push(Date.now() - this.spawnedAt);
this.emit('warn', `Shard exited with non-zero exit code`);
}
this.#_ready = false;
this.#_process = null;

View File

@ -16,8 +16,7 @@ class RegisterEndpoint extends ApiEndpoint {
super(server, {
name: 'register',
path: '/register',
auth: true
path: '/register'
});
this.methods = [

View File

@ -15,7 +15,7 @@ class ApiEndpoint extends Endpoint {
path: `/api${opts.path}`
});
// this._middleware.push(this.rateLimiter.throttle({ limit: 5, time: 5, path: this.path.replace(opts.path, ''), endpoint: this }));
// this._middleware.push(this.rateLimiter.throttle({ limit: 5, time: 1, path: this.path.replace(opts.path, ''), endpoint: this }));
}

View File

@ -13,7 +13,7 @@ import { LoggerClient } from '@navy.gif/logger';
import session from 'express-session';
import passport from "passport";
import MongoStore from "connect-mongo";
import { AuthFunction, Request, Response } from "../../../@types/Server.js";
import { MiddlewareFunction, Request, Response } from "../../../@types/Server.js";
import { NextFunction } from "express";
import { User } from "../structures/index.js";
@ -38,7 +38,7 @@ type OAuthParams = {
*/
class Authenticator {
[key: string]: AuthFunction | unknown
[key: string]: MiddlewareFunction | unknown
#_userdb: UserDatabaseInterface;
#_cookieName: string;

12301
yarn.lock

File diff suppressed because it is too large Load Diff