summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-24 12:49:12 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-24 12:49:12 +0200
commitfe8a1c10005cc3becacf0c9601ecdc17f2a86e30 (patch)
tree5b406a7f497d05eb137ea8a0374e813a7bb904e1 /src/util
parent:bug: fix type in Channel Messages (diff)
parentUpdate channels.ts (diff)
downloadserver-fe8a1c10005cc3becacf0c9601ecdc17f2a86e30.tar.xz
Merge branch 'master' of https://github.com/fosscord/fosscord-api
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Captcha.ts1
-rw-r--r--src/util/Config.ts8
-rw-r--r--src/util/Event.ts2
-rw-r--r--src/util/Member.ts2
-rw-r--r--src/util/User.ts2
-rw-r--r--src/util/instanceOf.ts3
6 files changed, 11 insertions, 7 deletions
diff --git a/src/util/Captcha.ts b/src/util/Captcha.ts

index e69de29b..cb0ff5c3 100644 --- a/src/util/Captcha.ts +++ b/src/util/Captcha.ts
@@ -0,0 +1 @@ +export {}; diff --git a/src/util/Config.ts b/src/util/Config.ts
index 60d83e1a..e500197f 100644 --- a/src/util/Config.ts +++ b/src/util/Config.ts
@@ -1,4 +1,4 @@ -import { Config, Snowflake } from "fosscord-server-util"; +import { Config, Snowflake } from "@fosscord/server-util"; import crypto from "crypto"; import fs from "fs"; @@ -16,7 +16,7 @@ export default { setAll: Config.setAll, }; -export interface RateLimit { +export interface RateLimitOptions { count: number; timespan: number; } @@ -62,8 +62,8 @@ export interface DefaultOptions { }; routes: { auth?: { - login?: RateLimit; - register?: RateLimit; + login?: RateLimitOptions; + register?: RateLimitOptions; }; channel?: {}; // TODO: rate limit configuration for all routes diff --git a/src/util/Event.ts b/src/util/Event.ts
index 8a24e4bb..5ff027e5 100644 --- a/src/util/Event.ts +++ b/src/util/Event.ts
@@ -1,4 +1,4 @@ -import { Event, EventModel } from "fosscord-server-util"; +import { Event, EventModel } from "@fosscord/server-util"; export async function emitEvent(payload: Omit<Event, "created_at">) { const obj = { diff --git a/src/util/Member.ts b/src/util/Member.ts
index 4d1b8ac5..2be9686e 100644 --- a/src/util/Member.ts +++ b/src/util/Member.ts
@@ -7,7 +7,7 @@ import { GuildModel, MemberModel, UserModel, -} from "fosscord-server-util"; +} from "@fosscord/server-util"; import { HTTPError } from "lambert-server"; import Config from "./Config"; import { emitEvent } from "./Event"; diff --git a/src/util/User.ts b/src/util/User.ts
index 05213642..0f3768cc 100644 --- a/src/util/User.ts +++ b/src/util/User.ts
@@ -1,4 +1,4 @@ -import { toObject, UserModel } from "fosscord-server-util"; +import { toObject, UserModel } from "@fosscord/server-util"; import { HTTPError } from "lambert-server"; export const PublicUserProjection = { diff --git a/src/util/instanceOf.ts b/src/util/instanceOf.ts
index b4a231ba..e4e58092 100644 --- a/src/util/instanceOf.ts +++ b/src/util/instanceOf.ts
@@ -34,6 +34,9 @@ export function FieldErrors(fields: Record<string, { code?: string; message: str ); } +// TODO: implement Image data type: Data URI scheme that supports JPG, GIF, and PNG formats. An example Data URI format is: data:image/jpeg;base64,BASE64_ENCODED_JPEG_IMAGE_DATA +// Ensure you use the proper content type (image/jpeg, image/png, image/gif) that matches the image data being provided. + export class FieldError extends Error { constructor(public code: string | number, public message: string, public errors?: any) { super(message);