1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-05 10:22:31 +01:00
This commit is contained in:
Puyodead1 2023-03-23 13:51:29 -04:00
parent 6347a77a79
commit 777e7208dc
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
10 changed files with 18643 additions and 29 deletions

File diff suppressed because it is too large Load Diff

View File

@ -22,17 +22,6 @@ import { Request, Response, Router } from "express";
const router = Router();
export interface GatewayBotResponse {
url: string;
shards: number;
session_start_limit: {
total: number;
remaining: number;
reset_after: number;
max_concurrency: number;
};
}
router.get(
"/",
route({

View File

@ -22,10 +22,6 @@ import { Request, Response, Router } from "express";
const router = Router();
export interface GatewayResponse {
url: string;
}
router.get(
"/",
route({

View File

@ -16,23 +16,23 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Router, Request, Response } from "express";
import {
User,
Member,
UserProfileModifySchema,
handleFile,
PrivateUserProjection,
emitEvent,
UserUpdateEvent,
} from "@spacebar/util";
import { route } from "@spacebar/api";
import {
Member,
PrivateUserProjection,
User,
UserProfileModifySchema,
UserUpdateEvent,
emitEvent,
handleFile,
} from "@spacebar/util";
import { Request, Response, Router } from "express";
const router: Router = Router();
router.get(
"/",
route({ test: { response: { body: "UserProfileResponse" } } }),
route({ responses: { 200: { body: "UserProfileResponse" } } }),
async (req: Request, res: Response) => {
if (req.params.id === "@me") req.params.id = req.user_id;

View File

@ -16,15 +16,15 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Router, Request, Response } from "express";
import { User } from "@spacebar/util";
import { route } from "@spacebar/api";
import { User } from "@spacebar/util";
import { Request, Response, Router } from "express";
const router: Router = Router();
router.get(
"/",
route({ test: { response: { body: "UserRelationsResponse" } } }),
route({ responses: { 200: { body: "UserRelationsResponse" } } }),
async (req: Request, res: Response) => {
const mutual_relations: object[] = [];
const requested_relations = await User.findOneOrFail({

View File

@ -0,0 +1,10 @@
export interface GatewayBotResponse {
url: string;
shards: number;
session_start_limit: {
total: number;
remaining: number;
reset_after: number;
max_concurrency: number;
};
}

View File

@ -0,0 +1,3 @@
export interface GatewayResponse {
url: string;
}

View File

@ -0,0 +1,8 @@
import { PublicConnectedAccount, UserPublic } from "../../entities";
export interface UserProfileResponse {
user: UserPublic;
connected_accounts: PublicConnectedAccount;
premium_guild_since?: Date;
premium_since?: Date;
}

View File

@ -0,0 +1,9 @@
export interface UserRelationsResponse {
object: {
id?: string;
username?: string;
avatar?: string;
discriminator?: string;
public_flags?: number;
};
}

View File

@ -9,7 +9,11 @@ export * from "./CaptchaRequiredResponse";
export * from "./ChannelInvitesResponse";
export * from "./ChannelPinsResponse";
export * from "./ChannelWebhooksResponse";
export * from "./GatewayBotResponse";
export * from "./GatewayResponse";
export * from "./GenerateRegistrationTokensResponse";
export * from "./LocationMetadataResponse";
export * from "./TokenResponse";
export * from "./UserProfileResponse";
export * from "./UserRelationsResponse";
export * from "./WebhookCreateResponse";