1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-19 17:21:35 +02:00

Remove ALL fosscord mentions

This commit is contained in:
Madeline 2023-03-31 15:52:33 +11:00
parent 698ad90d3e
commit 095cbf7b20
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47
236 changed files with 443 additions and 431 deletions

2
.github/FUNDING.yml vendored
View File

@ -1 +1 @@
open_collective: fosscord open_collective: spacebar

View File

@ -1,11 +1,11 @@
blank_issues_enabled: true blank_issues_enabled: true
contact_links: contact_links:
- name: Fosscord Documentation - name: Spacebar Documentation
url: https://docs.fosscord.com/ url: https://docs.spacebar.chat/
about: Need documentation and examples for the Fosscord? Head over to Fosscord's official documentation. about: Need documentation and examples for the Spacebar? Head over to Spacebar's official documentation.
- name: Discord's Developer Documentation - name: Discord's Developer Documentation
url: https://discord.com/developers/docs/intro url: https://discord.com/developers/docs/intro
about: Need help with the Discord resources? Head here instead of asking on Fosscord! about: Need help with the Discord resources? Head here instead of asking on Spacebar!
- name: Fosscord' Official Discord server - name: Spacebar' Official Discord server
url: https://discord.com/invite/Ms5Ev7S6bF url: https://discord.com/invite/Ms5Ev7S6bF
about: Need help with the server? Talk with us in our official server. about: Need help with the server? Talk with us in our official server.

View File

@ -24,7 +24,7 @@
<body> <body>
<div style="background-color: #202225;"> <div style="background-color: #202225;">
<img <img
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg" src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
alt="Branding" alt="Branding"
style=" style="
width: 100%; width: 100%;
@ -86,7 +86,7 @@
color: white; color: white;
cursor: pointer; cursor: pointer;
padding: 15px 19px; padding: 15px 19px;
background-color: #ff5f00; background-color: #0185ff;
border-radius: 5px; border-radius: 5px;
" "
>Verify Login</a >Verify Login</a

View File

@ -24,7 +24,7 @@
<body> <body>
<div style="background-color: #202225;"> <div style="background-color: #202225;">
<img <img
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg" src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
alt="Branding" alt="Branding"
style=" style="
width: 100%; width: 100%;

View File

@ -24,7 +24,7 @@
<body> <body>
<div style="background-color: #202225;"> <div style="background-color: #202225;">
<img <img
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg" src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
alt="Branding" alt="Branding"
style=" style="
width: 100%; width: 100%;

View File

@ -24,7 +24,7 @@
<body> <body>
<div style="background-color: #202225;"> <div style="background-color: #202225;">
<img <img
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg" src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
alt="Branding" alt="Branding"
style=" style="
width: 100%; width: 100%;

View File

@ -24,7 +24,7 @@
<body> <body>
<div style="background-color: #202225;"> <div style="background-color: #202225;">
<img <img
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg" src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
alt="Branding" alt="Branding"
style=" style="
width: 100%; width: 100%;

View File

@ -14,7 +14,7 @@
} }
h3.title-jXR8lp.marginBottom8-AtZOdT.base-1x0h_U.size24-RIRrxO::after { h3.title-jXR8lp.marginBottom8-AtZOdT.base-1x0h_U.size24-RIRrxO::after {
margin-top: -32px; margin-top: -32px;
content: "Welcome to Fosscord!"; content: "Welcome to Spacebar!";
visibility: visible; visibility: visible;
display: block; display: block;
} }
@ -22,7 +22,7 @@ h3.title-jXR8lp.marginBottom8-AtZOdT.base-1x0h_U.size24-RIRrxO::after {
/* Logo in top left when bg removed */ /* Logo in top left when bg removed */
#app-mount > div.app-1q1i1E > div > a { #app-mount > div.app-1q1i1E > div > a {
/* replace me: original dimensions: 130x36 */ /* replace me: original dimensions: 130x36 */
background: url(https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Gradient.svg); background: url(https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg);
width: 130px; width: 130px;
height: 23px; height: 23px;
background-size: contain; background-size: contain;

View File

@ -27,7 +27,7 @@
> foreignObject > foreignObject
> div > div
> div { > div {
background-image: url(https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Icon-Rounded-Subtract.svg); background-image: url(https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Icon-Rounded-Subtract.svg);
background-size: contain; background-size: contain;
border-radius: 50%; border-radius: 50%;
} }

View File

@ -5,7 +5,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fosscord Server</title> <title>Spacebar Server</title>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@ -40,24 +40,25 @@
#wordmark { #wordmark {
width: min(500px, 50%); width: min(500px, 50%);
margin-bottom: 20px;
} }
a, a:visited { a, a:visited {
color: #FF6D2E; color: #0185ff;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<img alt="Fosscord Logo" <img alt="Spacebar Logo"
id="wordmark" id="wordmark"
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Gradient.svg" /> src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg" />
<h1>Welcome!</h1> <h1>Welcome!</h1>
<p>If you're viewing this page, that means you've successfully set up your very own Fosscord instance!</p> <p>If you're viewing this page, that means you've successfully set up your very own Spacebar instance!</p>
<p>For information on how to configure your shiny new setup, you should visit <a href="https://docs.fosscord.com">our documentation</a></p> <p>For information on how to configure your shiny new setup, you should visit <a href="https://docs.spacebar.chat">our documentation</a></p>
<p>For information on how to connect and use your instance, <a href="https://docs.fosscord.com/setup/clients">click here</a></p> <p>For information on how to connect and use your instance, <a href="https://docs.spacebar.chat/setup/clients">click here</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
If you want to use it, throw it into the `preload-plugins` folder. If you want to use it, throw it into the `preload-plugins` folder.
TODO: Make it so this file is not required for webrtc. TODO: Make it so this file is not required for webrtc.
Do note that webrtc, as of 17/12/2022, is not implemented yet in fosscord/fosscord-server. Do note that webrtc, as of 17/12/2022, is not implemented yet in spacebarchat/server.
*/ */
(this.webpackChunkdiscord_app = this.webpackChunkdiscord_app || []).push([ (this.webpackChunkdiscord_app = this.webpackChunkdiscord_app || []).push([

View File

@ -1,8 +1,8 @@
# This is an example nginx config for Fosscord. # This is an example nginx config for Spacebar.
server { server {
# Change server_name # Change server_name
server_name fosscord.example.com; server_name spacebar.example.com;
listen 80; listen 80;
location / { location / {

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "fosscord-server", "name": "spacebar-server",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "fosscord-server", "name": "spacebar-server",
"version": "1.0.0", "version": "1.0.0",
"hasInstallScript": true, "hasInstallScript": true,
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",

View File

@ -1,7 +1,7 @@
{ {
"name": "fosscord-server", "name": "spacebar-server",
"version": "1.0.0", "version": "1.0.0",
"description": "A Fosscord server written in Node.js", "description": "A Spacebar server written in Node.js",
"scripts": { "scripts": {
"prepare": "husky install", "prepare": "husky install",
"postinstall": "npx patch-package", "postinstall": "npx patch-package",
@ -26,17 +26,17 @@
"types": "src/bundle/index.ts", "types": "src/bundle/index.ts",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/fosscord/fosscord-server.git" "url": "git+https://github.com/spacebarchat/server.git"
}, },
"author": "Fosscord", "author": "Spacebar",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"bugs": { "bugs": {
"url": "https://github.com/fosscord/fosscord-server/issues" "url": "https://github.com/spacebarchat/server/issues"
}, },
"imports": { "imports": {
"#*": "./dist/*/index.js" "#*": "./dist/*/index.js"
}, },
"homepage": "https://fosscord.com", "homepage": "https://spacebar.chat",
"devDependencies": { "devDependencies": {
"@types/amqplib": "^0.8.2", "@types/amqplib": "^0.8.2",
"@types/bcrypt": "^5.0.0", "@types/bcrypt": "^5.0.0",
@ -108,10 +108,10 @@
"ws": "^8.9.0" "ws": "^8.9.0"
}, },
"_moduleAliases": { "_moduleAliases": {
"@fosscord/api": "dist/api", "@spacebar/api": "dist/api",
"@fosscord/cdn": "dist/cdn", "@spacebar/cdn": "dist/cdn",
"@fosscord/gateway": "dist/gateway", "@spacebar/gateway": "dist/gateway",
"@fosscord/util": "dist/util" "@spacebar/util": "dist/util"
}, },
"optionalDependencies": { "optionalDependencies": {
"erlpack": "^0.1.4", "erlpack": "^0.1.4",

View File

@ -23,9 +23,11 @@
To find which file the changelog is stored in your client, simply grep for the changelog text given by the client, To find which file the changelog is stored in your client, simply grep for the changelog text given by the client,
and update the `CHANGELOG_SCRIPT` variable to use that instead. and update the `CHANGELOG_SCRIPT` variable to use that instead.
This grabs the new changelog from `fosscord-server/assets/changelog.txt` This grabs the new changelog from `spacebarchat/server/assets/changelog.txt`
*/ */
/* eslint-env node */
const fetch = require("node-fetch"); const fetch = require("node-fetch");
const fs = require("fs/promises"); const fs = require("fs/promises");
const path = require("path"); const path = require("path");

View File

@ -5,13 +5,15 @@
Does not prepend is file contains @fc-license-skip Does not prepend is file contains @fc-license-skip
*/ */
/* eslint-env node */
const Path = require("path"); const Path = require("path");
const fs = require("fs"); const fs = require("fs");
const walk = require("./util/walk"); const walk = require("./util/walk");
const FOSSCORD_SOURCE_DIR = Path.join(__dirname, "..", "src"); const SPACEBAR_SOURCE_DIR = Path.join(__dirname, "..", "src");
const FOSSCORD_SCRIPTS_DIR = Path.join(__dirname); const SPACEBAR_SCRIPTS_DIR = Path.join(__dirname);
const FOSSCORD_LICENSE_PREAMBLE = fs const SPACEBAR_LICENSE_PREAMBLE = fs
.readFileSync(Path.join(__dirname, "util", "licensePreamble.txt")) .readFileSync(Path.join(__dirname, "util", "licensePreamble.txt"))
.toString() .toString()
.split("\r") // remove windows bs .split("\r") // remove windows bs
@ -37,7 +39,7 @@ const addToDir = (dir) => {
const preamble = const preamble =
commentStrings[0] + commentStrings[0] +
"\n" + "\n" +
FOSSCORD_LICENSE_PREAMBLE + SPACEBAR_LICENSE_PREAMBLE +
"\n" + "\n" +
commentStrings[1]; commentStrings[1];
@ -56,5 +58,5 @@ const addToDir = (dir) => {
} }
}; };
addToDir(FOSSCORD_SOURCE_DIR); addToDir(SPACEBAR_SOURCE_DIR);
addToDir(FOSSCORD_SCRIPTS_DIR); addToDir(SPACEBAR_SCRIPTS_DIR);

View File

@ -20,6 +20,8 @@
Calculates a discord.com-like rights value. Calculates a discord.com-like rights value.
*/ */
/* eslint-env node */
require("module-alias/register"); require("module-alias/register");
const { Rights } = require(".."); const { Rights } = require("..");

View File

@ -17,7 +17,7 @@
*/ */
/* /*
Regenerates the `fosscord-server/assets/schemas.json` file, used for API/Gateway input validation. Regenerates the `spacebarchat/server/assets/schemas.json` file, used for API/Gateway input validation.
*/ */
/* eslint-env node */ /* eslint-env node */

File diff suppressed because one or more lines are too long

View File

@ -16,13 +16,15 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/* eslint-env node */
const register = require("./src/register"); const register = require("./src/register");
const login = require("./src/login/index"); const login = require("./src/login/index");
const config = require("./config.json"); const config = require("./config.json");
const figlet = require("figlet"); const figlet = require("figlet");
const sendMessage = require("./src/message/send"); const sendMessage = require("./src/message/send");
const fs = require("fs"); const fs = require("fs");
figlet("Fosscord Stress Test :)", function (err, data) { figlet("Spacebar Stress Test :)", function (err, data) {
if (err) { if (err) {
console.log("Something went wrong..."); console.log("Something went wrong...");
console.dir(err); console.dir(err);

View File

@ -16,6 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/* eslint-env node */
const fetch = require("node-fetch"); const fetch = require("node-fetch");
const fs = require("fs"); const fs = require("fs");
var config = require("../../config.json"); var config = require("../../config.json");
@ -36,7 +38,7 @@ async function generate() {
var body = { var body = {
fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw",
email: mail, email: mail,
username: "Fosscord Stress Test", username: "Spacebar Stress Test",
password: password, password: password,
invite: config.invite, invite: config.invite,
consent: true, consent: true,

View File

@ -25,6 +25,8 @@
it doesn't break the below, thus we're left with this :sob: it doesn't break the below, thus we're left with this :sob:
*/ */
/* eslint-env node */
require("module-alias/register"); require("module-alias/register");
require("dotenv").config(); require("dotenv").config();
const { initDatabase } = require(".."); const { initDatabase } = require("..");

View File

@ -25,7 +25,7 @@ import {
registerRoutes, registerRoutes,
Sentry, Sentry,
WebAuthn, WebAuthn,
} from "@fosscord/util"; } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { Server, ServerOptions } from "lambert-server"; import { Server, ServerOptions } from "lambert-server";
import "missing-native-js-functions"; import "missing-native-js-functions";
@ -38,7 +38,6 @@ import { ErrorHandler } from "./middlewares/ErrorHandler";
import { initRateLimits } from "./middlewares/RateLimit"; import { initRateLimits } from "./middlewares/RateLimit";
import { initTranslation } from "./middlewares/Translation"; import { initTranslation } from "./middlewares/Translation";
import { initInstance } from "./util/handlers/Instance"; import { initInstance } from "./util/handlers/Instance";
import express from "express";
const PUBLIC_ASSETS_FOLDER = path.join( const PUBLIC_ASSETS_FOLDER = path.join(
__dirname, __dirname,
@ -48,21 +47,21 @@ const PUBLIC_ASSETS_FOLDER = path.join(
"public", "public",
); );
export type FosscordServerOptions = ServerOptions; export type SpacebarServerOptions = ServerOptions;
declare global { declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace // eslint-disable-next-line @typescript-eslint/no-namespace
namespace Express { namespace Express {
interface Request { interface Request {
server: FosscordServer; server: SpacebarServer;
} }
} }
} }
export class FosscordServer extends Server { export class SpacebarServer extends Server {
public declare options: FosscordServerOptions; public declare options: SpacebarServerOptions;
constructor(opts?: Partial<FosscordServerOptions>) { constructor(opts?: Partial<SpacebarServerOptions>) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
super({ ...opts, errorHandler: false, jsonBody: false }); super({ ...opts, errorHandler: false, jsonBody: false });

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { checkToken, Config, Rights } from "@fosscord/util"; import { checkToken, Config, Rights } from "@spacebar/util";
import * as Sentry from "@sentry/node"; import * as Sentry from "@sentry/node";
import { NextFunction, Request, Response } from "express"; import { NextFunction, Request, Response } from "express";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";

View File

@ -18,7 +18,7 @@
import { NextFunction, Request, Response } from "express"; import { NextFunction, Request, Response } from "express";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { ApiError, FieldError } from "@fosscord/util"; import { ApiError, FieldError } from "@spacebar/util";
const EntityNotFoundErrorRegex = /"(\w+)"/; const EntityNotFoundErrorRegex = /"(\w+)"/;
export function ErrorHandler( export function ErrorHandler(

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { getIpAdress } from "@fosscord/api"; import { getIpAdress } from "@spacebar/api";
import { Config, getRights, listenEvent } from "@fosscord/util"; import { Config, getRights, listenEvent } from "@spacebar/util";
import { NextFunction, Request, Response, Router } from "express"; import { NextFunction, Request, Response, Router } from "express";
import { API_PREFIX_TRAILING_SLASH } from "./Authentication"; import { API_PREFIX_TRAILING_SLASH } from "./Authentication";
@ -27,7 +27,7 @@ import { API_PREFIX_TRAILING_SLASH } from "./Authentication";
/* /*
? bucket limit? Max actions/sec per bucket? ? bucket limit? Max actions/sec per bucket?
(ANSWER: a small fosscord instance might not need a complex rate limiting system) (ANSWER: a small spacebar instance might not need a complex rate limiting system)
TODO: delay database requests to include multiple queries TODO: delay database requests to include multiple queries
TODO: different for methods (GET/POST) TODO: different for methods (GET/POST)
> IP addresses that make too many invalid HTTP requests are automatically and temporarily restricted from accessing the Discord API. Currently, this limit is 10,000 per 10 minutes. An invalid request is one that results in 401, 403, or 429 statuses. > IP addresses that make too many invalid HTTP requests are automatically and temporarily restricted from accessing the Discord API. Currently, this limit is 10,000 per 10 minutes. An invalid request is one that results in 401, 403, or 429 statuses.

View File

@ -17,8 +17,8 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { getDatabase } from "@fosscord/util"; import { getDatabase } from "@spacebar/util";
const router = Router(); const router = Router();

View File

@ -17,8 +17,8 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { getDatabase } from "@fosscord/util"; import { getDatabase } from "@spacebar/util";
const router = Router(); const router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { import {
Application, Application,
generateToken, generateToken,
@ -25,7 +25,7 @@ import {
BotModifySchema, BotModifySchema,
handleFile, handleFile,
DiscordApiErrors, DiscordApiErrors,
} from "@fosscord/util"; } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { verifyToken } from "node-2fa"; import { verifyToken } from "node-2fa";

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -17,12 +17,12 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { import {
Application, Application,
DiscordApiErrors, DiscordApiErrors,
ApplicationModifySchema, ApplicationModifySchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { verifyToken } from "node-2fa"; import { verifyToken } from "node-2fa";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";

View File

@ -17,7 +17,7 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -17,13 +17,13 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { import {
Application, Application,
ApplicationCreateSchema, ApplicationCreateSchema,
trimSpecial, trimSpecial,
User, User,
} from "@fosscord/util"; } from "@spacebar/util";
const router: Router = Router(); const router: Router = Router();

View File

@ -16,14 +16,14 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { getIpAdress, route, verifyCaptcha } from "@fosscord/api"; import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
import { import {
Config, Config,
Email, Email,
FieldErrors, FieldErrors,
ForgotPasswordSchema, ForgotPasswordSchema,
User, User,
} from "@fosscord/util"; } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
const router = Router(); const router = Router();

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { route, random } from "@fosscord/api"; import { route, random } from "@spacebar/api";
import { Config, ValidRegistrationToken } from "@fosscord/util"; import { Config, ValidRegistrationToken } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
const router: Router = Router(); const router: Router = Router();

View File

@ -17,8 +17,8 @@
*/ */
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { getIpAdress, IPAnalysis } from "@fosscord/api"; import { getIpAdress, IPAnalysis } from "@spacebar/api";
const router = Router(); const router = Router();
router.get("/", route({}), async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { getIpAdress, route, verifyCaptcha } from "@fosscord/api"; import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
import { import {
adjustEmail, adjustEmail,
Config, Config,
@ -26,7 +26,7 @@ import {
LoginSchema, LoginSchema,
User, User,
WebAuthn, WebAuthn,
} from "@fosscord/util"; } from "@spacebar/util";
import bcrypt from "bcrypt"; import bcrypt from "bcrypt";
import crypto from "crypto"; import crypto from "crypto";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
const router: Router = Router(); const router: Router = Router();

View File

@ -17,8 +17,8 @@
*/ */
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { BackupCode, generateToken, User, TotpSchema } from "@fosscord/util"; import { BackupCode, generateToken, User, TotpSchema } from "@spacebar/util";
import { verifyToken } from "node-2fa"; import { verifyToken } from "node-2fa";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
const router = Router(); const router = Router();

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { import {
generateToken, generateToken,
SecurityKey, SecurityKey,
@ -24,7 +24,7 @@ import {
verifyWebAuthnToken, verifyWebAuthnToken,
WebAuthn, WebAuthn,
WebAuthnTotpSchema, WebAuthnTotpSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { ExpectedAssertionResult } from "fido2-lib"; import { ExpectedAssertionResult } from "fido2-lib";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";

View File

@ -26,14 +26,14 @@ import {
adjustEmail, adjustEmail,
RegisterSchema, RegisterSchema,
ValidRegistrationToken, ValidRegistrationToken,
} from "@fosscord/util"; } from "@spacebar/util";
import { import {
route, route,
getIpAdress, getIpAdress,
IPAnalysis, IPAnalysis,
isProxy, isProxy,
verifyCaptcha, verifyCaptcha,
} from "@fosscord/api"; } from "@spacebar/api";
import bcrypt from "bcrypt"; import bcrypt from "bcrypt";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { MoreThan } from "typeorm"; import { MoreThan } from "typeorm";
@ -52,7 +52,7 @@ router.post(
// They're a one time use token that bypasses registration limits ( rates, disabled reg, etc ) // They're a one time use token that bypasses registration limits ( rates, disabled reg, etc )
let regTokenUsed = false; let regTokenUsed = false;
if (req.get("Referrer") && req.get("Referrer")?.includes("token=")) { if (req.get("Referrer") && req.get("Referrer")?.includes("token=")) {
// eg theyre on https://staging.fosscord.com/register?token=whatever // eg theyre on https://staging.spacebar.chat/register?token=whatever
const token = req.get("Referrer")?.split("token=")[1].split("&")[0]; const token = req.get("Referrer")?.split("token=")[1].split("&")[0];
if (token) { if (token) {
const regToken = await ValidRegistrationToken.findOneOrFail({ const regToken = await ValidRegistrationToken.findOneOrFail({

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { import {
checkToken, checkToken,
Config, Config,
@ -25,7 +25,7 @@ import {
generateToken, generateToken,
PasswordResetSchema, PasswordResetSchema,
User, User,
} from "@fosscord/util"; } from "@spacebar/util";
import bcrypt from "bcrypt"; import bcrypt from "bcrypt";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";

View File

@ -16,14 +16,14 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { getIpAdress, route, verifyCaptcha } from "@fosscord/api"; import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
import { import {
checkToken, checkToken,
Config, Config,
FieldErrors, FieldErrors,
generateToken, generateToken,
User, User,
} from "@fosscord/util"; } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
const router = Router(); const router = Router();

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Email, User } from "@fosscord/util"; import { Email, User } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
const router = Router(); const router = Router();

View File

@ -17,8 +17,8 @@
*/ */
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { FieldErrors, User, BackupCodesChallengeSchema } from "@fosscord/util"; import { FieldErrors, User, BackupCodesChallengeSchema } from "@spacebar/util";
import bcrypt from "bcrypt"; import bcrypt from "bcrypt";
const router = Router(); const router = Router();

View File

@ -25,9 +25,9 @@ import {
Recipient, Recipient,
handleFile, handleFile,
ChannelModifySchema, ChannelModifySchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();
// TODO: delete channel // TODO: delete channel

View File

@ -18,8 +18,8 @@
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { random } from "@fosscord/api"; import { random } from "@spacebar/api";
import { import {
Channel, Channel,
Invite, Invite,
@ -28,7 +28,7 @@ import {
User, User,
Guild, Guild,
PublicInviteRelation, PublicInviteRelation,
} from "@fosscord/util"; } from "@spacebar/util";
import { isTextChannel } from "./messages"; import { isTextChannel } from "./messages";
const router: Router = Router(); const router: Router = Router();

View File

@ -21,9 +21,9 @@ import {
getPermission, getPermission,
MessageAckEvent, MessageAckEvent,
ReadState, ReadState,
} from "@fosscord/util"; } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -20,7 +20,7 @@ import {
Attachment, Attachment,
Channel, Channel,
emitEvent, emitEvent,
FosscordApiErrors, SpacebarApiErrors,
getPermission, getPermission,
getRights, getRights,
Message, Message,
@ -31,11 +31,11 @@ import {
uploadFile, uploadFile,
MessageCreateSchema, MessageCreateSchema,
MessageEditSchema, MessageEditSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import multer from "multer"; import multer from "multer";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { handleMessage, postHandleMessage } from "@fosscord/api"; import { handleMessage, postHandleMessage } from "@spacebar/api";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
const router = Router(); const router = Router();
@ -163,14 +163,14 @@ router.put(
const snowflake = Snowflake.deconstruct(message_id); const snowflake = Snowflake.deconstruct(message_id);
if (Date.now() < snowflake.timestamp) { if (Date.now() < snowflake.timestamp) {
// message is in the future // message is in the future
throw FosscordApiErrors.CANNOT_BACKFILL_TO_THE_FUTURE; throw SpacebarApiErrors.CANNOT_BACKFILL_TO_THE_FUTURE;
} }
const exists = await Message.findOne({ const exists = await Message.findOne({
where: { id: message_id, channel_id: channel_id }, where: { id: message_id, channel_id: channel_id },
}); });
if (exists) { if (exists) {
throw FosscordApiErrors.CANNOT_REPLACE_BY_BACKFILL; throw SpacebarApiErrors.CANNOT_REPLACE_BY_BACKFILL;
} }
if (req.file) { if (req.file) {

View File

@ -30,8 +30,8 @@ import {
PartialEmoji, PartialEmoji,
PublicUserProjection, PublicUserProjection,
User, User,
} from "@fosscord/util"; } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { In } from "typeorm"; import { In } from "typeorm";

View File

@ -25,9 +25,9 @@ import {
getRights, getRights,
MessageDeleteBulkEvent, MessageDeleteBulkEvent,
Message, Message,
} from "@fosscord/util"; } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -36,9 +36,9 @@ import {
Rights, Rights,
Reaction, Reaction,
User, User,
} from "@fosscord/util"; } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { handleMessage, postHandleMessage, route } from "@fosscord/api"; import { handleMessage, postHandleMessage, route } from "@spacebar/api";
import multer from "multer"; import multer from "multer";
import { FindManyOptions, FindOperator, LessThan, MoreThan } from "typeorm"; import { FindManyOptions, FindOperator, LessThan, MoreThan } from "typeorm";
import { URL } from "url"; import { URL } from "url";
@ -146,7 +146,7 @@ router.get("/", async (req: Request, res: Response) => {
x.author = User.create({ x.author = User.create({
id: "4", id: "4",
discriminator: "0000", discriminator: "0000",
username: "Fosscord Ghost", username: "Spacebar Ghost",
public_flags: 0, public_flags: 0,
}); });
x.attachments?.forEach((y: Attachment) => { x.attachments?.forEach((y: Attachment) => {

View File

@ -24,11 +24,11 @@ import {
Member, Member,
Role, Role,
ChannelPermissionOverwriteSchema, ChannelPermissionOverwriteSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();
// TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel) // TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel)

View File

@ -24,9 +24,9 @@ import {
Message, Message,
MessageUpdateEvent, MessageUpdateEvent,
DiscordApiErrors, DiscordApiErrors,
} from "@fosscord/util"; } from "@spacebar/util";
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { isTextChannel } from "./messages"; import { isTextChannel } from "./messages";
import { FindManyOptions, Between, Not, FindOperator } from "typeorm"; import { FindManyOptions, Between, Not, FindOperator } from "typeorm";
import { import {
@ -28,7 +28,7 @@ import {
Message, Message,
MessageDeleteBulkEvent, MessageDeleteBulkEvent,
PurgeSchema, PurgeSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
const router: Router = Router(); const router: Router = Router();

View File

@ -27,8 +27,8 @@ import {
PublicUserProjection, PublicUserProjection,
Recipient, Recipient,
User, User,
} from "@fosscord/util"; } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Channel, emitEvent, Member, TypingStartEvent } from "@fosscord/util"; import { Channel, emitEvent, Member, TypingStartEvent } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
const router: Router = Router(); const router: Router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { import {
Channel, Channel,
Config, Config,
@ -27,10 +27,10 @@ import {
Webhook, Webhook,
WebhookCreateSchema, WebhookCreateSchema,
WebhookType, WebhookType,
} from "@fosscord/util"; } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { isTextChannel } from "./messages/index"; import { isTextChannel } from "./messages/index";
import { DiscordApiErrors } from "@fosscord/util"; import { DiscordApiErrors } from "@spacebar/util";
import crypto from "crypto"; import crypto from "crypto";
const router: Router = Router(); const router: Router = Router();
@ -63,7 +63,7 @@ router.post(
// TODO: move this // TODO: move this
if (name === "clyde") throw new HTTPError("Invalid name", 400); if (name === "clyde") throw new HTTPError("Invalid name", 400);
if (name === "Fosscord Ghost") throw new HTTPError("Invalid name", 400); if (name === "Spacebar Ghost") throw new HTTPError("Invalid name", 400);
if (avatar) avatar = await handleFile(`/avatars/${channel_id}`, avatar); if (avatar) avatar = await handleFile(`/avatars/${channel_id}`, avatar);

View File

@ -16,10 +16,10 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Guild, Config } from "@fosscord/util"; import { Guild, Config } from "@spacebar/util";
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Like } from "typeorm"; import { Like } from "typeorm";
const router = Router(); const router = Router();

View File

@ -16,9 +16,9 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Categories } from "@fosscord/util"; import { Categories } from "@spacebar/util";
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -17,8 +17,8 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { FieldErrors, Release } from "@fosscord/util"; import { FieldErrors, Release } from "@spacebar/util";
const router = Router(); const router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -16,9 +16,9 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Config } from "@fosscord/util"; import { Config } from "@spacebar/util";
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route, RouteOptions } from "@fosscord/api"; import { route, RouteOptions } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -16,9 +16,9 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Config } from "@fosscord/util"; import { Config } from "@spacebar/util";
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route, RouteOptions } from "@fosscord/api"; import { route, RouteOptions } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -19,7 +19,7 @@
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import fetch from "node-fetch"; import fetch from "node-fetch";
import ProxyAgent from "proxy-agent"; import ProxyAgent from "proxy-agent";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { getGifApiKey, parseGifResult } from "./trending"; import { getGifApiKey, parseGifResult } from "./trending";
const router = Router(); const router = Router();

View File

@ -19,7 +19,7 @@
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import fetch from "node-fetch"; import fetch from "node-fetch";
import ProxyAgent from "proxy-agent"; import ProxyAgent from "proxy-agent";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { getGifApiKey, parseGifResult } from "./trending"; import { getGifApiKey, parseGifResult } from "./trending";
const router = Router(); const router = Router();

View File

@ -19,8 +19,8 @@
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import fetch from "node-fetch"; import fetch from "node-fetch";
import ProxyAgent from "proxy-agent"; import ProxyAgent from "proxy-agent";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Config } from "@fosscord/util"; import { Config } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
const router = Router(); const router = Router();

View File

@ -16,10 +16,10 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Guild, Config } from "@fosscord/util"; import { Guild, Config } from "@spacebar/util";
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Like } from "typeorm"; import { Like } from "typeorm";
const router = Router(); const router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();
//TODO: implement audit logs //TODO: implement audit logs

View File

@ -27,9 +27,9 @@ import {
Member, Member,
BanRegistrySchema, BanRegistrySchema,
BanModeratorSchema, BanModeratorSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { getIpAdress, route } from "@fosscord/api"; import { getIpAdress, route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -23,9 +23,9 @@ import {
emitEvent, emitEvent,
ChannelModifySchema, ChannelModifySchema,
ChannelReorderSchema, ChannelReorderSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();
router.get("/", route({}), async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {

View File

@ -16,10 +16,10 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { emitEvent, GuildDeleteEvent, Guild } from "@fosscord/util"; import { emitEvent, GuildDeleteEvent, Guild } from "@spacebar/util";
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -29,8 +29,8 @@ import {
User, User,
EmojiCreateSchema, EmojiCreateSchema,
EmojiModifySchema, EmojiModifySchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -27,10 +27,10 @@ import {
handleFile, handleFile,
Member, Member,
GuildUpdateSchema, GuildUpdateSchema,
FosscordApiErrors, SpacebarApiErrors,
} from "@fosscord/util"; } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();
@ -113,7 +113,7 @@ router.patch(
for (const feature of diff) { for (const feature of diff) {
if (MUTABLE_FEATURES.includes(feature)) continue; if (MUTABLE_FEATURES.includes(feature)) continue;
throw FosscordApiErrors.FEATURE_IS_IMMUTABLE.withParams( throw SpacebarApiErrors.FEATURE_IS_IMMUTABLE.withParams(
feature, feature,
); );
} }

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();
//TODO: implement integrations list //TODO: implement integrations list

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Invite, PublicInviteRelation } from "@fosscord/util"; import { Invite, PublicInviteRelation } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
const router = Router(); const router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();
router.get("/", route({}), async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {

View File

@ -29,8 +29,8 @@ import {
Guild, Guild,
handleFile, handleFile,
MemberChangeSchema, MemberChangeSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { getPermission, Member, PermissionResolvable } from "@fosscord/util"; import { getPermission, Member, PermissionResolvable } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
const router = Router(); const router = Router();

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Member } from "@fosscord/util"; import { Member } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
const router = Router(); const router = Router();

View File

@ -17,8 +17,8 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { Member, PublicMemberProjection } from "@fosscord/util"; import { Member, PublicMemberProjection } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { MoreThan } from "typeorm"; import { MoreThan } from "typeorm";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";

View File

@ -19,8 +19,8 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */ /* eslint-disable @typescript-eslint/ban-ts-comment */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { getPermission, FieldErrors, Message, Channel } from "@fosscord/util"; import { getPermission, FieldErrors, Message, Channel } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { FindManyOptions, In, Like } from "typeorm"; import { FindManyOptions, In, Like } from "typeorm";

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();
router.get("/subscriptions", route({}), async (req: Request, res: Response) => { router.get("/subscriptions", route({}), async (req: Request, res: Response) => {

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { import {
emitEvent, emitEvent,
GuildMemberUpdateEvent, GuildMemberUpdateEvent,
@ -24,7 +24,7 @@ import {
Member, Member,
MemberChangeProfileSchema, MemberChangeProfileSchema,
OrmUtils, OrmUtils,
} from "@fosscord/util"; } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
const router = Router(); const router = Router();

View File

@ -17,9 +17,9 @@
*/ */
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { Guild, Member, Snowflake } from "@fosscord/util"; import { Guild, Member, Snowflake } from "@spacebar/util";
import { LessThan, IsNull } from "typeorm"; import { LessThan, IsNull } from "typeorm";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();
//Returns all inactive members, respecting role hierarchy //Returns all inactive members, respecting role hierarchy

View File

@ -16,9 +16,9 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Guild } from "@fosscord/util"; import { Guild } from "@spacebar/util";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { getVoiceRegions, route, getIpAdress } from "@fosscord/api"; import { getVoiceRegions, route, getIpAdress } from "@spacebar/api";
const router = Router(); const router = Router();

View File

@ -25,8 +25,8 @@ import {
emitEvent, emitEvent,
handleFile, handleFile,
RoleModifySchema, RoleModifySchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
const router = Router(); const router = Router();

View File

@ -29,8 +29,8 @@ import {
RoleModifySchema, RoleModifySchema,
RolePositionUpdateSchema, RolePositionUpdateSchema,
Snowflake, Snowflake,
} from "@fosscord/util"; } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Not } from "typeorm"; import { Not } from "typeorm";
const router: Router = Router(); const router: Router = Router();

View File

@ -26,9 +26,9 @@ import {
StickerType, StickerType,
uploadFile, uploadFile,
ModifyGuildStickerSchema, ModifyGuildStickerSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import multer from "multer"; import multer from "multer";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
const router = Router(); const router = Router();

View File

@ -17,10 +17,10 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { Guild, Template } from "@fosscord/util"; import { Guild, Template } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { generateCode } from "@fosscord/api"; import { generateCode } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -22,9 +22,9 @@ import {
Guild, Guild,
Invite, Invite,
VanityUrlSchema, VanityUrlSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { Router, Request, Response } from "express"; import { Router, Request, Response } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
const router = Router(); const router = Router();

View File

@ -25,8 +25,8 @@ import {
VoiceState, VoiceState,
VoiceStateUpdateEvent, VoiceStateUpdateEvent,
VoiceStateUpdateSchema, VoiceStateUpdateSchema,
} from "@fosscord/util"; } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
const router = Router(); const router = Router();

View File

@ -17,7 +17,7 @@
*/ */
import { Router, Response, Request } from "express"; import { Router, Response, Request } from "express";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router = Router(); const router = Router();
//TODO: implement webhooks //TODO: implement webhooks

View File

@ -17,9 +17,9 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { Guild, Member, GuildUpdateWelcomeScreenSchema } from "@fosscord/util"; import { Guild, Member, GuildUpdateWelcomeScreenSchema } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -17,9 +17,9 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { Permissions, Guild, Invite, Channel, Member } from "@fosscord/util"; import { Permissions, Guild, Invite, Channel, Member } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { random, route } from "@fosscord/api"; import { random, route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

View File

@ -19,9 +19,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { Guild } from "@fosscord/util"; import { Guild } from "@spacebar/util";
import { HTTPError } from "lambert-server"; import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
@ -58,7 +58,7 @@ router.get("/", route({}), async (req: Request, res: Response) => {
const { loadImage } = require("canvas"); const { loadImage } = require("canvas");
const sizeOf = require("image-size"); const sizeOf = require("image-size");
// TODO: Widget style templates need Fosscord branding // TODO: Widget style templates need Spacebar branding
const source = path.join( const source = path.join(
__dirname, __dirname,
"..", "..",

View File

@ -17,8 +17,8 @@
*/ */
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { Guild, WidgetModifySchema } from "@fosscord/util"; import { Guild, WidgetModifySchema } from "@spacebar/util";
import { route } from "@fosscord/api"; import { route } from "@spacebar/api";
const router: Router = Router(); const router: Router = Router();

Some files were not shown because too many files have changed in this diff Show More