Work towards fixing openapi spec

This commit is contained in:
Madeline
2023-03-24 04:16:58 +11:00
parent 1fd01fa000
commit 0f928e479c
14 changed files with 8029 additions and 261 deletions
-11
View File
@@ -22,17 +22,6 @@ import { route, RouteOptions } from "@fosscord/api";
const router = Router();
export interface GatewayBotResponse {
url: string;
shards: number;
session_start_limit: {
total: number;
remaining: number;
reset_after: number;
max_concurrency: number;
};
}
const options: RouteOptions = {
test: {
response: {
-4
View File
@@ -22,10 +22,6 @@ import { route, RouteOptions } from "@fosscord/api";
const router = Router();
export interface GatewayResponse {
url: string;
}
const options: RouteOptions = {
test: {
response: {
-9
View File
@@ -18,9 +18,7 @@
import { Router, Request, Response } from "express";
import {
PublicConnectedAccount,
User,
UserPublic,
Member,
UserProfileModifySchema,
handleFile,
@@ -32,13 +30,6 @@ import { route } from "@fosscord/api";
const router: Router = Router();
export interface UserProfileResponse {
user: UserPublic;
connected_accounts: PublicConnectedAccount;
premium_guild_since?: Date;
premium_since?: Date;
}
router.get(
"/",
route({ test: { response: { body: "UserProfileResponse" } } }),
-10
View File
@@ -22,16 +22,6 @@ import { route } from "@fosscord/api";
const router: Router = Router();
export interface UserRelationsResponse {
object: {
id?: string;
username?: string;
avatar?: string;
discriminator?: string;
public_flags?: number;
};
}
router.get(
"/",
route({ test: { response: { body: "UserRelationsResponse" } } }),
+1 -1
View File
@@ -111,7 +111,7 @@ export class User extends BaseClass {
banner?: string; // hash of the user banner
@Column({ nullable: true, type: "simple-array" })
theme_colors?: number[]; // TODO: Separate `User` and `UserProfile` models
theme_colors?: [number, number]; // TODO: Separate `User` and `UserProfile` models
@Column({ nullable: true })
pronouns?: string;
+10
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;
};
}
+3
View File
@@ -0,0 +1,3 @@
export interface GatewayResponse {
url: string;
}
+8
View File
@@ -0,0 +1,8 @@
import { PublicConnectedAccount, UserPublic } from "..";
export interface UserProfileResponse {
user: UserPublic;
connected_accounts: PublicConnectedAccount;
premium_guild_since?: Date;
premium_since?: Date;
}
@@ -0,0 +1,9 @@
export interface UserRelationsResponse {
object: {
id?: string;
username?: string;
avatar?: string;
discriminator?: string;
public_flags?: number;
};
}
+4
View File
@@ -76,3 +76,7 @@ export * from "./VoiceVideoSchema";
export * from "./WebAuthnSchema";
export * from "./WebhookCreateSchema";
export * from "./WidgetModifySchema";
export * from "./UserRelationsResponse";
export * from "./GatewayResponse";
export * from "./GatewayBotResponse";
export * from "./UserProfileResponse";