mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-26 04:03:03 +01:00
Fix merge conflicts
This commit is contained in:
parent
feca7a5d62
commit
05f6a0d6de
2
.gitignore
vendored
2
.gitignore
vendored
@ -32,3 +32,5 @@ yarn.lock
|
||||
dbconf.json
|
||||
|
||||
migrations.db
|
||||
|
||||
package-lock.json
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -7,7 +7,7 @@ export class RegionConfiguration {
|
||||
{
|
||||
id: "fosscord",
|
||||
name: "Fosscord",
|
||||
endpoint: undefined,
|
||||
endpoint: "",
|
||||
vip: false,
|
||||
custom: false,
|
||||
deprecated: false
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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?
|
||||
}
|
||||
}
|
@ -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 =
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
export class PluginManifest {
|
||||
id: string;
|
||||
name: string;
|
||||
authors: string[];
|
||||
repository: string;
|
||||
license: string;
|
||||
version: string; // semver
|
||||
versionCode: number; // integer
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
export * from "./Plugin";
|
||||
export * from "./PluginLoader";
|
||||
export * from "./PluginManifest";
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user