mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 06:32:34 +00:00
More schema work, moved most stuff from entities to schemas, though messy
This commit is contained in:
1 parent
e52c237326
commit
1632642b0d
74 files changed
+758
-643
No files matched your search
@@ -20,14 +20,13 @@ import { route } from "@spacebar/api";
|
||||
import {
|
||||
Channel,
|
||||
ChannelDeleteEvent,
|
||||
ChannelType,
|
||||
ChannelUpdateEvent,
|
||||
Recipient,
|
||||
emitEvent,
|
||||
handleFile,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { ChannelModifySchema } from "@spacebar/schemas"
|
||||
import { ChannelModifySchema, ChannelType } from "@spacebar/schemas"
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
// TODO: delete channel
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
|
||||
import { randomString, route } from "@spacebar/api";
|
||||
import { Channel, Guild, Invite, InviteCreateEvent, PublicInviteRelation, User, emitEvent, isTextChannel } from "@spacebar/util";
|
||||
import { Channel, Guild, Invite, InviteCreateEvent, PublicInviteRelation, User, emitEvent } from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { InviteCreateSchema } from "@spacebar/schemas"
|
||||
import { InviteCreateSchema, isTextChannel } from "@spacebar/schemas"
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -28,14 +28,12 @@ import {
|
||||
MessageReactionRemoveAllEvent,
|
||||
MessageReactionRemoveEmojiEvent,
|
||||
MessageReactionRemoveEvent,
|
||||
PublicMemberProjection,
|
||||
PublicUserProjection,
|
||||
User,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { In } from "typeorm";
|
||||
import { PartialEmoji } from "@spacebar/schemas"
|
||||
import { PartialEmoji, PublicMemberProjection, PublicUserProjection } from "@spacebar/schemas";
|
||||
|
||||
const router = Router({ mergeParams: true });
|
||||
// TODO: check if emoji is really an unicode emoji or a properly encoded external emoji
|
||||
|
||||
@@ -32,7 +32,6 @@ import {
|
||||
User,
|
||||
emitEvent,
|
||||
getPermission,
|
||||
isTextChannel,
|
||||
getUrlSignature,
|
||||
uploadFile,
|
||||
NewUrlSignatureData,
|
||||
@@ -43,7 +42,7 @@ import { HTTPError } from "lambert-server";
|
||||
import multer from "multer";
|
||||
import { FindManyOptions, FindOperator, LessThan, MoreThan, MoreThanOrEqual } from "typeorm";
|
||||
import { URL } from "url";
|
||||
import { MessageCreateAttachment, MessageCreateCloudAttachment, MessageCreateSchema, Reaction } from "@spacebar/schemas"
|
||||
import { isTextChannel, MessageCreateAttachment, MessageCreateCloudAttachment, MessageCreateSchema, Reaction } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Channel, ChannelPermissionOverwrite, ChannelPermissionOverwriteType, ChannelUpdateEvent, emitEvent, Member, Role } from "@spacebar/util";
|
||||
import { Channel, ChannelUpdateEvent, emitEvent, Member, Role } from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
|
||||
import { route } from "@spacebar/api";
|
||||
import { ChannelPermissionOverwriteSchema } from "@spacebar/schemas"
|
||||
import { ChannelPermissionOverwriteSchema, ChannelPermissionOverwrite, ChannelPermissionOverwriteType } from "@spacebar/schemas"
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
// 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)
|
||||
|
||||
@@ -24,12 +24,11 @@ import {
|
||||
emitEvent,
|
||||
getPermission,
|
||||
getRights,
|
||||
isTextChannel,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { Between, FindManyOptions, FindOperator, Not } from "typeorm";
|
||||
import { PurgeSchema } from "@spacebar/schemas"
|
||||
import { isTextChannel, PurgeSchema } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -20,15 +20,14 @@ import { route } from "@spacebar/api";
|
||||
import {
|
||||
Channel,
|
||||
ChannelRecipientAddEvent,
|
||||
ChannelType,
|
||||
DiscordApiErrors,
|
||||
DmChannelDTO,
|
||||
emitEvent,
|
||||
PublicUserProjection,
|
||||
Recipient,
|
||||
User,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { ChannelType, PublicUserProjection } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -23,16 +23,14 @@ import {
|
||||
DiscordApiErrors,
|
||||
User,
|
||||
Webhook,
|
||||
WebhookType,
|
||||
handleFile,
|
||||
isTextChannel,
|
||||
trimSpecial,
|
||||
ValidateName,
|
||||
} from "@spacebar/util";
|
||||
import crypto from "crypto";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { WebhookCreateSchema } from "@spacebar/schemas"
|
||||
import { isTextChannel, WebhookCreateSchema, WebhookType } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -27,13 +27,11 @@ import {
|
||||
GuildMemberUpdateEvent,
|
||||
handleFile,
|
||||
Member,
|
||||
PublicMemberProjection,
|
||||
PublicUserProjection,
|
||||
Role,
|
||||
Sticker,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { MemberChangeSchema } from "@spacebar/schemas"
|
||||
import { MemberChangeSchema, PublicMemberProjection, PublicUserProjection } from "@spacebar/schemas";
|
||||
|
||||
const router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
*/
|
||||
|
||||
import { route } from "@spacebar/api";
|
||||
import { Member, PublicMemberProjection } from "@spacebar/util";
|
||||
import { Member } from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { MoreThan } from "typeorm";
|
||||
import { PublicMemberProjection } from "@spacebar/schemas";
|
||||
|
||||
const router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ import {
|
||||
Member,
|
||||
Snowflake,
|
||||
Sticker,
|
||||
StickerFormatType,
|
||||
StickerType,
|
||||
emitEvent,
|
||||
uploadFile,
|
||||
Config,
|
||||
@@ -32,7 +30,7 @@ import {
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import multer from "multer";
|
||||
import { ModifyGuildStickerSchema } from "@spacebar/schemas"
|
||||
import { ModifyGuildStickerSchema, StickerFormatType, StickerType } from "@spacebar/schemas";
|
||||
const router = Router({ mergeParams: true });
|
||||
|
||||
router.get(
|
||||
|
||||
@@ -19,13 +19,12 @@
|
||||
import { route } from "@spacebar/api";
|
||||
import {
|
||||
Channel,
|
||||
ChannelType,
|
||||
Guild,
|
||||
Invite,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { VanityUrlSchema } from "@spacebar/schemas"
|
||||
import { ChannelType, VanityUrlSchema } from "@spacebar/schemas";
|
||||
|
||||
const router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
import { route } from "@spacebar/api";
|
||||
import {
|
||||
Channel,
|
||||
ChannelType,
|
||||
DiscordApiErrors,
|
||||
emitEvent,
|
||||
getPermission,
|
||||
@@ -27,7 +26,7 @@ import {
|
||||
VoiceStateUpdateEvent,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { VoiceStateUpdateSchema } from "@spacebar/schemas"
|
||||
import { ChannelType, VoiceStateUpdateSchema } from "@spacebar/schemas";
|
||||
|
||||
const router = Router({ mergeParams: true });
|
||||
//TODO need more testing when community guild and voice stage channel are working
|
||||
|
||||
@@ -20,9 +20,9 @@ import { route } from "@spacebar/api";
|
||||
import {
|
||||
Application,
|
||||
DiscordApiErrors,
|
||||
PublicUserProjection,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { PublicUserProjection } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -21,12 +21,10 @@ import { route } from "@spacebar/api";
|
||||
import {
|
||||
Team,
|
||||
TeamMember,
|
||||
TeamMemberRole,
|
||||
TeamMemberState,
|
||||
User,
|
||||
} from "@spacebar/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { TeamCreateSchema } from "@spacebar/schemas"
|
||||
import { TeamCreateSchema, TeamMemberRole, TeamMemberState } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ import { route } from "@spacebar/api";
|
||||
import {
|
||||
emitEvent,
|
||||
Member,
|
||||
PrivateUserProjection,
|
||||
User,
|
||||
UserDeleteEvent,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { PrivateUserProjection } from "@spacebar/schemas";
|
||||
|
||||
const router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -24,16 +24,13 @@ import {
|
||||
FieldErrors,
|
||||
handleFile,
|
||||
Member,
|
||||
PrivateUserProjection,
|
||||
PublicUser,
|
||||
PublicUserProjection,
|
||||
Relationship,
|
||||
User,
|
||||
UserUpdateEvent,
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { In } from "typeorm";
|
||||
import { RelationshipType, UserProfileModifySchema } from "@spacebar/schemas"
|
||||
import { PrivateUserProjection, PublicUser, PublicUserProjection, RelationshipType, UserProfileModifySchema } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -23,13 +23,12 @@ import {
|
||||
FieldErrors,
|
||||
generateToken,
|
||||
handleFile,
|
||||
PrivateUserProjection,
|
||||
User,
|
||||
UserUpdateEvent,
|
||||
} from "@spacebar/util";
|
||||
import bcrypt from "bcrypt";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { UserModifySchema } from "@spacebar/schemas"
|
||||
import { PrivateUserProjection, UserModifySchema } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import { route } from "@spacebar/api";
|
||||
import {
|
||||
Config,
|
||||
DiscordApiErrors,
|
||||
PublicUserProjection,
|
||||
Relationship,
|
||||
RelationshipAddEvent,
|
||||
RelationshipRemoveEvent,
|
||||
@@ -29,7 +28,7 @@ import {
|
||||
} from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { RelationshipType } from "@spacebar/schemas"
|
||||
import { PublicUserProjection, RelationshipType } from "@spacebar/schemas";
|
||||
|
||||
const router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
Reference in new issue
Block a user