1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-16 15:52:25 +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
contact_links:
- name: Fosscord Documentation
url: https://docs.fosscord.com/
about: Need documentation and examples for the Fosscord? Head over to Fosscord's official documentation.
- name: Spacebar Documentation
url: https://docs.spacebar.chat/
about: Need documentation and examples for the Spacebar? Head over to Spacebar's official documentation.
- name: Discord's Developer Documentation
url: https://discord.com/developers/docs/intro
about: Need help with the Discord resources? Head here instead of asking on Fosscord!
- name: Fosscord' Official Discord server
about: Need help with the Discord resources? Head here instead of asking on Spacebar!
- name: Spacebar' Official Discord server
url: https://discord.com/invite/Ms5Ev7S6bF
about: Need help with the server? Talk with us in our official server.

View File

@ -24,7 +24,7 @@
<body>
<div style="background-color: #202225;">
<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"
style="
width: 100%;
@ -86,7 +86,7 @@
color: white;
cursor: pointer;
padding: 15px 19px;
background-color: #ff5f00;
background-color: #0185ff;
border-radius: 5px;
"
>Verify Login</a

View File

@ -24,7 +24,7 @@
<body>
<div style="background-color: #202225;">
<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"
style="
width: 100%;

View File

@ -24,7 +24,7 @@
<body>
<div style="background-color: #202225;">
<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"
style="
width: 100%;

View File

@ -24,7 +24,7 @@
<body>
<div style="background-color: #202225;">
<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"
style="
width: 100%;

View File

@ -24,7 +24,7 @@
<body>
<div style="background-color: #202225;">
<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"
style="
width: 100%;

View File

@ -14,7 +14,7 @@
}
h3.title-jXR8lp.marginBottom8-AtZOdT.base-1x0h_U.size24-RIRrxO::after {
margin-top: -32px;
content: "Welcome to Fosscord!";
content: "Welcome to Spacebar!";
visibility: visible;
display: block;
}
@ -22,7 +22,7 @@ h3.title-jXR8lp.marginBottom8-AtZOdT.base-1x0h_U.size24-RIRrxO::after {
/* Logo in top left when bg removed */
#app-mount > div.app-1q1i1E > div > a {
/* 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;
height: 23px;
background-size: contain;

View File

@ -27,7 +27,7 @@
> foreignObject
> 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;
border-radius: 50%;
}

View File

@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<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.gstatic.com" crossorigin>
@ -40,24 +40,25 @@
#wordmark {
width: min(500px, 50%);
margin-bottom: 20px;
}
a, a:visited {
color: #FF6D2E;
color: #0185ff;
}
</style>
</head>
<body>
<div class="container">
<img alt="Fosscord Logo"
<img alt="Spacebar Logo"
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>
<p>If you're viewing this page, that means you've successfully set up your very own Fosscord 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 connect and use your instance, <a href="https://docs.fosscord.com/setup/clients">click here</a></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.spacebar.chat">our documentation</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>
</body>

View File

@ -3,7 +3,7 @@
If you want to use it, throw it into the `preload-plugins` folder.
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([

View File

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

4
package-lock.json generated
View File

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

View File

@ -1,7 +1,7 @@
{
"name": "fosscord-server",
"name": "spacebar-server",
"version": "1.0.0",
"description": "A Fosscord server written in Node.js",
"description": "A Spacebar server written in Node.js",
"scripts": {
"prepare": "husky install",
"postinstall": "npx patch-package",
@ -26,17 +26,17 @@
"types": "src/bundle/index.ts",
"repository": {
"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",
"bugs": {
"url": "https://github.com/fosscord/fosscord-server/issues"
"url": "https://github.com/spacebarchat/server/issues"
},
"imports": {
"#*": "./dist/*/index.js"
},
"homepage": "https://fosscord.com",
"homepage": "https://spacebar.chat",
"devDependencies": {
"@types/amqplib": "^0.8.2",
"@types/bcrypt": "^5.0.0",
@ -108,10 +108,10 @@
"ws": "^8.9.0"
},
"_moduleAliases": {
"@fosscord/api": "dist/api",
"@fosscord/cdn": "dist/cdn",
"@fosscord/gateway": "dist/gateway",
"@fosscord/util": "dist/util"
"@spacebar/api": "dist/api",
"@spacebar/cdn": "dist/cdn",
"@spacebar/gateway": "dist/gateway",
"@spacebar/util": "dist/util"
},
"optionalDependencies": {
"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,
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 fs = require("fs/promises");
const path = require("path");

View File

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

View File

@ -20,6 +20,8 @@
Calculates a discord.com-like rights value.
*/
/* eslint-env node */
require("module-alias/register");
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 */

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/>.
*/
/* eslint-env node */
const register = require("./src/register");
const login = require("./src/login/index");
const config = require("./config.json");
const figlet = require("figlet");
const sendMessage = require("./src/message/send");
const fs = require("fs");
figlet("Fosscord Stress Test :)", function (err, data) {
figlet("Spacebar Stress Test :)", function (err, data) {
if (err) {
console.log("Something went wrong...");
console.dir(err);

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@
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 { NextFunction, Request, Response } from "express";
import { HTTPError } from "lambert-server";

View File

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

View File

@ -16,8 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { getIpAdress } from "@fosscord/api";
import { Config, getRights, listenEvent } from "@fosscord/util";
import { getIpAdress } from "@spacebar/api";
import { Config, getRights, listenEvent } from "@spacebar/util";
import { NextFunction, Request, Response, Router } from "express";
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?
(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: 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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,14 +16,14 @@
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 {
Config,
Email,
FieldErrors,
ForgotPasswordSchema,
User,
} from "@fosscord/util";
} from "@spacebar/util";
import { Request, Response, Router } from "express";
import { HTTPError } from "lambert-server";
const router = Router();

View File

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

View File

@ -17,8 +17,8 @@
*/
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
import { getIpAdress, IPAnalysis } from "@fosscord/api";
import { route } from "@spacebar/api";
import { getIpAdress, IPAnalysis } from "@spacebar/api";
const router = Router();
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/>.
*/
import { getIpAdress, route, verifyCaptcha } from "@fosscord/api";
import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
import {
adjustEmail,
Config,
@ -26,7 +26,7 @@ import {
LoginSchema,
User,
WebAuthn,
} from "@fosscord/util";
} from "@spacebar/util";
import bcrypt from "bcrypt";
import crypto from "crypto";
import { Request, Response, Router } from "express";

View File

@ -16,7 +16,7 @@
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";
const router: Router = Router();

View File

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

View File

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

View File

@ -26,14 +26,14 @@ import {
adjustEmail,
RegisterSchema,
ValidRegistrationToken,
} from "@fosscord/util";
} from "@spacebar/util";
import {
route,
getIpAdress,
IPAnalysis,
isProxy,
verifyCaptcha,
} from "@fosscord/api";
} from "@spacebar/api";
import bcrypt from "bcrypt";
import { HTTPError } from "lambert-server";
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 )
let regTokenUsed = false;
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];
if (token) {
const regToken = await ValidRegistrationToken.findOneOrFail({

View File

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

View File

@ -16,14 +16,14 @@
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 {
checkToken,
Config,
FieldErrors,
generateToken,
User,
} from "@fosscord/util";
} from "@spacebar/util";
import { Request, Response, Router } from "express";
const router = Router();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,11 +24,11 @@ import {
Member,
Role,
ChannelPermissionOverwriteSchema,
} from "@fosscord/util";
} from "@spacebar/util";
import { Router, Response, Request } from "express";
import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api";
import { route } from "@spacebar/api";
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)

View File

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

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@
*/
import { Router, Response, Request } from "express";
import { route } from "@fosscord/api";
import { route } from "@spacebar/api";
import {
Channel,
Config,
@ -27,10 +27,10 @@ import {
Webhook,
WebhookCreateSchema,
WebhookType,
} from "@fosscord/util";
} from "@spacebar/util";
import { HTTPError } from "lambert-server";
import { isTextChannel } from "./messages/index";
import { DiscordApiErrors } from "@fosscord/util";
import { DiscordApiErrors } from "@spacebar/util";
import crypto from "crypto";
const router: Router = Router();
@ -63,7 +63,7 @@ router.post(
// TODO: move this
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);

View File

@ -16,10 +16,10 @@
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 { route } from "@fosscord/api";
import { route } from "@spacebar/api";
import { Like } from "typeorm";
const router = Router();

View File

@ -16,9 +16,9 @@
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 { route } from "@fosscord/api";
import { route } from "@spacebar/api";
const router = Router();

View File

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

View File

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

View File

@ -16,9 +16,9 @@
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 { route, RouteOptions } from "@fosscord/api";
import { route, RouteOptions } from "@spacebar/api";
const router = Router();

View File

@ -16,9 +16,9 @@
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 { route, RouteOptions } from "@fosscord/api";
import { route, RouteOptions } from "@spacebar/api";
const router = Router();

View File

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

View File

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

View File

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

View File

@ -16,10 +16,10 @@
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 { route } from "@fosscord/api";
import { route } from "@spacebar/api";
import { Like } from "typeorm";
const router = Router();

View File

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

View File

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

View File

@ -23,9 +23,9 @@ import {
emitEvent,
ChannelModifySchema,
ChannelReorderSchema,
} from "@fosscord/util";
} from "@spacebar/util";
import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api";
import { route } from "@spacebar/api";
const router = Router();
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/>.
*/
import { emitEvent, GuildDeleteEvent, Guild } from "@fosscord/util";
import { emitEvent, GuildDeleteEvent, Guild } from "@spacebar/util";
import { Router, Request, Response } from "express";
import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api";
import { route } from "@spacebar/api";
const router = Router();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@
*/
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
import { route } from "@spacebar/api";
const router = Router();
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/>.
*/
import { route } from "@fosscord/api";
import { route } from "@spacebar/api";
import {
emitEvent,
GuildMemberUpdateEvent,
@ -24,7 +24,7 @@ import {
Member,
MemberChangeProfileSchema,
OrmUtils,
} from "@fosscord/util";
} from "@spacebar/util";
import { Request, Response, Router } from "express";
const router = Router();

View File

@ -17,9 +17,9 @@
*/
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 { route } from "@fosscord/api";
import { route } from "@spacebar/api";
const router = Router();
//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/>.
*/
import { Guild } from "@fosscord/util";
import { Guild } from "@spacebar/util";
import { Request, Response, Router } from "express";
import { getVoiceRegions, route, getIpAdress } from "@fosscord/api";
import { getVoiceRegions, route, getIpAdress } from "@spacebar/api";
const router = Router();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,9 +17,9 @@
*/
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 { route } from "@fosscord/api";
import { route } from "@spacebar/api";
const router: Router = Router();

View File

@ -17,9 +17,9 @@
*/
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 { random, route } from "@fosscord/api";
import { random, route } from "@spacebar/api";
const router: Router = Router();

View File

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

View File

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

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