1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 10:22:39 +01:00

Fix merge conflicts

This commit is contained in:
TheArcaneBrony 2022-08-27 07:22:01 +02:00
parent feca7a5d62
commit 05f6a0d6de
No known key found for this signature in database
GPG Key ID: 32FC5AAADAD75A22
22 changed files with 4432 additions and 4874 deletions

2
.gitignore vendored
View File

@ -32,3 +32,5 @@ yarn.lock
dbconf.json
migrations.db
package-lock.json

View File

@ -80,6 +80,7 @@
"jest": "^28.1.3",
"jsonwebtoken": "^8.5.1",
"lambert-server": "^1.2.12",
"medooze-media-server": "^0.119.21",
"missing-native-js-functions": "^1.2.18",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
@ -90,6 +91,7 @@
"prettier": "^2.7.1",
"proxy-agent": "^5.0.0",
"reflect-metadata": "^0.1.13",
"semantic-sdp": "^3.25.0",
"typeorm": "^0.3.7",
"typescript": "^4.2.3",
"ws": "^8.8.1"

View File

@ -43,6 +43,6 @@ module.exports = function (config) {
error.stdout.replaceAll(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "")
);
}
throw error;
if(config.throwOnError) throw error;
}
};

View File

@ -223,7 +223,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
const d: ReadyEventData = {
v: 8,
application: { id: application?.id ?? "", flags: application?.flags ?? "" }, //TODO: check this code!
application: { id: application?.id ?? "", flags: application?.flags ?? 0 }, //TODO: check this code!
user: privateUser,
user_settings: user.settings,
// @ts-ignore

View File

@ -7,7 +7,7 @@ export class RegionConfiguration {
{
id: "fosscord",
name: "Fosscord",
endpoint: undefined,
endpoint: "",
vip: false,
custom: false,
deprecated: false

View File

@ -1,4 +1,4 @@
import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, Relation } from "typeorm";
import { BaseClass } from "./BaseClass";
import { User } from "./User";

View File

@ -1,4 +1,4 @@
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, Relation, RelationId } from "typeorm";
import { DmChannelDTO } from "../dtos";
import { ChannelCreateEvent, ChannelRecipientRemoveEvent } from "../interfaces";
import { containsAll, emitEvent, getPermission, InvisibleCharacters, Snowflake, trimSpecial } from "../util";

View File

@ -1,4 +1,4 @@
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, Relation, RelationId } from "typeorm";
import { Config, handleFile, Snowflake } from "..";
import { OrmUtils } from "../util/imports/OrmUtils";
import { Ban } from "./Ban";

View File

@ -1,5 +1,5 @@
import { random } from "@fosscord/api";
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn, Relation, RelationId } from "typeorm";
import { BaseClassWithoutId } from "./BaseClass";
import { Channel } from "./Channel";
import { Guild } from "./Guild";

View File

@ -1,4 +1,4 @@
import { Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, PrimaryGeneratedColumn, RelationId } from "typeorm";
import { Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, PrimaryGeneratedColumn, Relation, RelationId } from "typeorm";
import { Ban, PublicGuildRelations } from ".";
import { GuildCreateEvent, GuildDeleteEvent, GuildMemberAddEvent, GuildMemberRemoveEvent, GuildMemberUpdateEvent } from "../interfaces";
import { Config, emitEvent } from "../util";

View File

@ -1,4 +1,4 @@
import { Column, CreateDateColumn, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, RelationId } from "typeorm";
import { Column, CreateDateColumn, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, Relation, RelationId } from "typeorm";
import { InteractionType } from "../interfaces/Interaction";
import { Application } from "./Application";
import { Attachment } from "./Attachment";

View File

@ -1,4 +1,4 @@
import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, Relation, RelationId } from "typeorm";
import { Activity } from "../interfaces/Activity";
import { Status } from "../interfaces/Status";
import { BaseClass } from "./BaseClass";

View File

@ -1,4 +1,5 @@
import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, Relation, RelationId } from "typeorm";
import { StickerPack } from ".";
import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild";
import { User } from "./User";

View File

@ -1,4 +1,4 @@
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, Relation, RelationId } from "typeorm";
import { Sticker } from ".";
import { BaseClass } from "./BaseClass";

View File

@ -1,4 +1,4 @@
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, RelationId } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, Relation, RelationId } from "typeorm";
import { BaseClass } from "./BaseClass";
import { TeamMember } from "./TeamMember";
import { User } from "./User";

View File

@ -1,4 +1,4 @@
import { Column, Entity, FindOneOptions, FindOptionsSelectByString, JoinColumn, OneToMany, OneToOne } from "typeorm";
import { Column, Entity, FindOneOptions, FindOptionsSelectByString, JoinColumn, OneToMany, OneToOne, Relation } from "typeorm";
import { Member, Session, UserSettings } from ".";
import { Config, FieldErrors, Snowflake, trimSpecial } from "..";
import { BitField } from "../util/BitField";

View File

@ -1,13 +0,0 @@
import { TypedEventEmitter } from "@fosscord/util";
import EventEmitter from "events";
type PluginEvents = {
error: (error: Error | unknown) => void;
loaded: () => void;
};
export class Plugin extends (EventEmitter as new () => TypedEventEmitter<PluginEvents>) {
async init() {
// insert default config into database?
}
}

View File

@ -1,39 +0,0 @@
import fs from "fs";
import path from "path";
import { Plugin, PluginManifest } from "./";
const root = process.env.PLUGIN_LOCATION || "../plugins";
let pluginsLoaded = false;
export class PluginLoader {
public static loadPlugins() {
console.log(`Plugin root directory: ${path.resolve(root)}`);
const dirs = fs.readdirSync(root).filter((x) => {
try {
fs.readdirSync(path.join(root, x));
return true;
} catch (e) {
return false;
}
});
console.log(dirs);
dirs.forEach(async (x) => {
let modPath = path.resolve(path.join(root, x));
console.log(`Trying to load plugin: ${modPath}`);
const manifest = require(path.join(modPath, "plugin.json")) as PluginManifest;
console.log(
`Plugin info: ${manifest.name} (${manifest.id}), written by ${manifest.authors}, available at ${manifest.repository}`
);
const module_ = require(path.join(modPath, "dist", "index.js")) as Plugin;
try {
await module_.init();
module_.emit("loaded");
} catch (error) {
module_.emit("error", error);
}
});
//
//module_.pluginPath =
}
}

View File

@ -1,9 +0,0 @@
export class PluginManifest {
id: string;
name: string;
authors: string[];
repository: string;
license: string;
version: string; // semver
versionCode: number; // integer
}

View File

@ -1,3 +0,0 @@
export * from "./Plugin";
export * from "./PluginLoader";
export * from "./PluginManifest";

View File

@ -71,7 +71,7 @@
"@fosscord/api": ["./api/index"],
"@fosscord/gateway": ["./gateway/index"],
"@fosscord/cdn": ["./cdn/index"],
"@fosscord/util": ["./util/index"]
"@fosscord/util": ["./util/index"],
"@fosscord/webrtc": ["./webrtc/index"]
},
"noEmitHelpers": true,

9207
yarn.lock

File diff suppressed because it is too large Load Diff