Missed some schemas
This commit is contained in:
parent
f75a7bac16
commit
7818e8dd3c
13761
assets/schemas.json
13761
assets/schemas.json
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
Channel,
|
Channel,
|
||||||
ChannelPermissionOverwrite,
|
ChannelPermissionOverwrite,
|
||||||
ChannelPermissionOverwriteType,
|
|
||||||
ChannelUpdateEvent,
|
ChannelUpdateEvent,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
getPermission,
|
|
||||||
Member,
|
Member,
|
||||||
Role,
|
Role,
|
||||||
|
ChannelPermissionOverwriteSchema
|
||||||
} from "@fosscord/util";
|
} from "@fosscord/util";
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
@ -16,9 +15,6 @@ const router: Router = Router();
|
|||||||
|
|
||||||
// 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)
|
// 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)
|
||||||
|
|
||||||
export interface ChannelPermissionOverwriteSchema
|
|
||||||
extends ChannelPermissionOverwrite {}
|
|
||||||
|
|
||||||
router.put(
|
router.put(
|
||||||
"/:overwrite_id",
|
"/:overwrite_id",
|
||||||
route({
|
route({
|
||||||
|
@ -8,29 +8,13 @@ import {
|
|||||||
GuildUpdateEvent,
|
GuildUpdateEvent,
|
||||||
handleFile,
|
handleFile,
|
||||||
Member,
|
Member,
|
||||||
GuildCreateSchema,
|
GuildUpdateSchema,
|
||||||
} from "@fosscord/util";
|
} from "@fosscord/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@fosscord/api";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
export interface GuildUpdateSchema extends Omit<GuildCreateSchema, "channels"> {
|
|
||||||
banner?: string | null;
|
|
||||||
splash?: string | null;
|
|
||||||
description?: string;
|
|
||||||
features?: string[];
|
|
||||||
verification_level?: number;
|
|
||||||
default_message_notifications?: number;
|
|
||||||
system_channel_flags?: number;
|
|
||||||
explicit_content_filter?: number;
|
|
||||||
public_updates_channel_id?: string;
|
|
||||||
afk_timeout?: number;
|
|
||||||
afk_channel_id?: string;
|
|
||||||
preferred_locale?: string;
|
|
||||||
premium_progress_bar_enabled?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||||
const { guild_id } = req.params;
|
const { guild_id } = req.params;
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@ import { route } from "@fosscord/api";
|
|||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
export interface UserSettingsSchema extends Partial<UserSettings> {}
|
|
||||||
|
|
||||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||||
const user = await User.findOneOrFail({
|
const user = await User.findOneOrFail({
|
||||||
where: { id: req.user_id },
|
where: { id: req.user_id },
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
import { CLOSECODES, OPCODES } from "../util/Constants";
|
import { WebSocket, Payload, CLOSECODES, OPCODES } from "@fosscord/gateway";
|
||||||
import { WebSocket, Payload } from "@fosscord/gateway";
|
import OPCodeHandlers from "../opcodes";
|
||||||
|
import { check } from "../opcodes/instanceOf";
|
||||||
|
import WS from "ws";
|
||||||
|
import { PayloadSchema } from "@fosscord/util";
|
||||||
|
import * as Sentry from "@sentry/node";
|
||||||
|
import BigIntJson from "json-bigint";
|
||||||
|
const bigIntJson = BigIntJson({ storeAsString: true });
|
||||||
|
|
||||||
var erlpack: any;
|
var erlpack: any;
|
||||||
try {
|
try {
|
||||||
erlpack = require("@yukikaze-bot/erlpack");
|
erlpack = require("@yukikaze-bot/erlpack");
|
||||||
} catch (error) {}
|
} catch (error) { }
|
||||||
import OPCodeHandlers from "../opcodes";
|
|
||||||
import { Tuple } from "lambert-server";
|
|
||||||
import { check } from "../opcodes/instanceOf";
|
|
||||||
import WS from "ws";
|
|
||||||
import BigIntJson from "json-bigint";
|
|
||||||
import * as Sentry from "@sentry/node";
|
|
||||||
const bigIntJson = BigIntJson({ storeAsString: true });
|
|
||||||
|
|
||||||
const PayloadSchema = {
|
|
||||||
op: Number,
|
|
||||||
$d: new Tuple(Object, Number), // or number for heartbeat sequence
|
|
||||||
$s: Number,
|
|
||||||
$t: String,
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function Message(this: WebSocket, buffer: WS.Data) {
|
export async function Message(this: WebSocket, buffer: WS.Data) {
|
||||||
// TODO: compression
|
// TODO: compression
|
||||||
|
4
src/util/schemas/ChannelPermissionOverwriteSchema.ts
Normal file
4
src/util/schemas/ChannelPermissionOverwriteSchema.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import { ChannelPermissionOverwrite } from "@fosscord/util";
|
||||||
|
|
||||||
|
export interface ChannelPermissionOverwriteSchema
|
||||||
|
extends ChannelPermissionOverwrite {}
|
8
src/util/schemas/GatewayPayloadSchema.ts
Normal file
8
src/util/schemas/GatewayPayloadSchema.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { Tuple } from "lambert-server";
|
||||||
|
|
||||||
|
export const PayloadSchema = {
|
||||||
|
op: Number,
|
||||||
|
$d: new Tuple(Object, Number), // or number for heartbeat sequence
|
||||||
|
$s: Number,
|
||||||
|
$t: String,
|
||||||
|
};
|
17
src/util/schemas/GuildUpdateSchema.ts
Normal file
17
src/util/schemas/GuildUpdateSchema.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { GuildCreateSchema } from "@fosscord/util";
|
||||||
|
|
||||||
|
export interface GuildUpdateSchema extends Omit<GuildCreateSchema, "channels"> {
|
||||||
|
banner?: string | null;
|
||||||
|
splash?: string | null;
|
||||||
|
description?: string;
|
||||||
|
features?: string[];
|
||||||
|
verification_level?: number;
|
||||||
|
default_message_notifications?: number;
|
||||||
|
system_channel_flags?: number;
|
||||||
|
explicit_content_filter?: number;
|
||||||
|
public_updates_channel_id?: string;
|
||||||
|
afk_timeout?: number;
|
||||||
|
afk_channel_id?: string;
|
||||||
|
preferred_locale?: string;
|
||||||
|
premium_progress_bar_enabled?: boolean;
|
||||||
|
}
|
9
src/util/schemas/UserGuildSettingsSchema.ts
Normal file
9
src/util/schemas/UserGuildSettingsSchema.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { UserGuildSettings, ChannelOverride } from "@fosscord/util";
|
||||||
|
|
||||||
|
// This sucks. I would use a DeepPartial, my own or typeorms, but they both generate inncorect schema
|
||||||
|
export interface UserGuildSettingsSchema
|
||||||
|
extends Partial<Omit<UserGuildSettings, "channel_overrides">> {
|
||||||
|
channel_overrides: {
|
||||||
|
[channel_id: string]: Partial<ChannelOverride>;
|
||||||
|
};
|
||||||
|
}
|
3
src/util/schemas/UserSettingsSchema.ts
Normal file
3
src/util/schemas/UserSettingsSchema.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { UserSettings } from "@fosscord/util";
|
||||||
|
|
||||||
|
export interface UserSettingsSchema extends Partial<UserSettings> {}
|
@ -39,3 +39,7 @@ export * from "./VoiceVideoSchema";
|
|||||||
export * from "./IdentifySchema";
|
export * from "./IdentifySchema";
|
||||||
export * from "./ActivitySchema";
|
export * from "./ActivitySchema";
|
||||||
export * from "./LazyRequestSchema";
|
export * from "./LazyRequestSchema";
|
||||||
|
export * from "./GuildUpdateSchema";
|
||||||
|
export * from "./ChannelPermissionOverwriteSchema";
|
||||||
|
export * from "./UserGuildSettingsSchema";
|
||||||
|
export * from "./GatewayPayloadSchema"
|
Loading…
x
Reference in New Issue
Block a user