diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/config/types/RegionConfiguration.ts | 2 | ||||
-rw-r--r-- | src/util/entities/BackupCodes.ts | 2 | ||||
-rw-r--r-- | src/util/entities/Channel.ts | 2 | ||||
-rw-r--r-- | src/util/entities/Guild.ts | 2 | ||||
-rw-r--r-- | src/util/entities/Invite.ts | 2 | ||||
-rw-r--r-- | src/util/entities/Member.ts | 2 | ||||
-rw-r--r-- | src/util/entities/Message.ts | 2 | ||||
-rw-r--r-- | src/util/entities/Session.ts | 2 | ||||
-rw-r--r-- | src/util/entities/Sticker.ts | 3 | ||||
-rw-r--r-- | src/util/entities/StickerPack.ts | 2 | ||||
-rw-r--r-- | src/util/entities/Team.ts | 2 | ||||
-rw-r--r-- | src/util/entities/User.ts | 2 | ||||
-rw-r--r-- | src/util/plugin/Plugin.ts | 13 | ||||
-rw-r--r-- | src/util/plugin/PluginLoader.ts | 39 | ||||
-rw-r--r-- | src/util/plugin/PluginManifest.ts | 9 | ||||
-rw-r--r-- | src/util/plugin/index.ts | 3 |
16 files changed, 13 insertions, 76 deletions
diff --git a/src/util/config/types/RegionConfiguration.ts b/src/util/config/types/RegionConfiguration.ts index 418f46f1..c8d8d714 100644 --- a/src/util/config/types/RegionConfiguration.ts +++ b/src/util/config/types/RegionConfiguration.ts @@ -7,7 +7,7 @@ export class RegionConfiguration { { id: "fosscord", name: "Fosscord", - endpoint: undefined, + endpoint: "", vip: false, custom: false, deprecated: false diff --git a/src/util/entities/BackupCodes.ts b/src/util/entities/BackupCodes.ts index 79b60a5e..c4c61af1 100644 --- a/src/util/entities/BackupCodes.ts +++ b/src/util/entities/BackupCodes.ts @@ -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"; diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts index 17a077ba..80e5f599 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts @@ -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"; diff --git a/src/util/entities/Guild.ts b/src/util/entities/Guild.ts index 9efb7e74..137dbb96 100644 --- a/src/util/entities/Guild.ts +++ b/src/util/entities/Guild.ts @@ -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"; diff --git a/src/util/entities/Invite.ts b/src/util/entities/Invite.ts index 383c932b..a04cbf50 100644 --- a/src/util/entities/Invite.ts +++ b/src/util/entities/Invite.ts @@ -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"; diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts index f5329481..de78e324 100644 --- a/src/util/entities/Member.ts +++ b/src/util/entities/Member.ts @@ -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"; diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts index 2b5e6f86..5af3d50d 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -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"; diff --git a/src/util/entities/Session.ts b/src/util/entities/Session.ts index bc9e6906..28735a5a 100644 --- a/src/util/entities/Session.ts +++ b/src/util/entities/Session.ts @@ -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"; diff --git a/src/util/entities/Sticker.ts b/src/util/entities/Sticker.ts index 0879e064..e500b76b 100644 --- a/src/util/entities/Sticker.ts +++ b/src/util/entities/Sticker.ts @@ -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"; diff --git a/src/util/entities/StickerPack.ts b/src/util/entities/StickerPack.ts index ca8b4cad..23794d20 100644 --- a/src/util/entities/StickerPack.ts +++ b/src/util/entities/StickerPack.ts @@ -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"; diff --git a/src/util/entities/Team.ts b/src/util/entities/Team.ts index 48657930..c83e7647 100644 --- a/src/util/entities/Team.ts +++ b/src/util/entities/Team.ts @@ -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"; diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts index 760ef9c7..bf27fc11 100644 --- a/src/util/entities/User.ts +++ b/src/util/entities/User.ts @@ -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"; diff --git a/src/util/plugin/Plugin.ts b/src/util/plugin/Plugin.ts deleted file mode 100644 index ee4fd95c..00000000 --- a/src/util/plugin/Plugin.ts +++ /dev/null @@ -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? - } -} diff --git a/src/util/plugin/PluginLoader.ts b/src/util/plugin/PluginLoader.ts deleted file mode 100644 index 000f3345..00000000 --- a/src/util/plugin/PluginLoader.ts +++ /dev/null @@ -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 = - } -} diff --git a/src/util/plugin/PluginManifest.ts b/src/util/plugin/PluginManifest.ts deleted file mode 100644 index d940f2c8..00000000 --- a/src/util/plugin/PluginManifest.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class PluginManifest { - id: string; - name: string; - authors: string[]; - repository: string; - license: string; - version: string; // semver - versionCode: number; // integer -} diff --git a/src/util/plugin/index.ts b/src/util/plugin/index.ts deleted file mode 100644 index c4c0c2ac..00000000 --- a/src/util/plugin/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./Plugin"; -export * from "./PluginLoader"; -export * from "./PluginManifest"; |