clusterfuck

This commit is contained in:
Puyodead1 2023-03-27 15:51:34 -04:00
parent 4824e14661
commit 866eb15d90
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
53 changed files with 113 additions and 123 deletions

Binary file not shown.

Binary file not shown.

View File

@ -79,11 +79,7 @@ function main() {
let schemas = generator
.getUserSymbols()
.filter(
(x) =>
(x.endsWith("Schema") || x.endsWith("Response")) &&
!Excluded.includes(x),
);
.filter((x) => x.endsWith("Schema") && !Excluded.includes(x));
console.log(schemas);
var definitions = {};

View File

@ -32,7 +32,7 @@ router.get(
route({
responses: {
200: {
body: "ApplicationsResponse",
body: "APIApplicationArray",
},
},
}),

View File

@ -96,7 +96,7 @@ router.get(
permission: "MANAGE_CHANNELS",
responses: {
200: {
body: "ChannelInvitesResponse",
body: "APIInviteArray",
},
404: {},
},

View File

@ -94,7 +94,7 @@ router.get(
},
responses: {
200: {
body: "ChannelMessagesResponse",
body: "APIMessageArray",
},
400: {
body: "APIErrorResponse",

View File

@ -138,7 +138,7 @@ router.get(
permission: ["READ_MESSAGE_HISTORY"],
responses: {
200: {
body: "ChannelPinsResponse",
body: "APIMessageArray",
},
400: {
body: "APIErrorResponse",

View File

@ -41,7 +41,7 @@ router.get(
route({
responses: {
200: {
body: "ChannelWebhooksResponse",
body: "APIWebhookArray",
},
},
}),

View File

@ -27,7 +27,7 @@ router.get(
route({
responses: {
200: {
body: "DiscoveryCategoriesResponse",
body: "APIDiscoveryCategoryArray",
},
},
}),

View File

@ -33,7 +33,7 @@ router.get(
route({
responses: {
201: {
body: "GuildChannelsResponse",
body: "APIChannelArray",
},
},
}),

View File

@ -39,7 +39,7 @@ router.get(
route({
responses: {
200: {
body: "GuildEmojisResponse",
body: "APIEmojiArray",
},
403: {
body: "APIErrorResponse",

View File

@ -39,7 +39,7 @@ router.get(
route({
responses: {
"200": {
body: "GuildResponse",
body: "GuildWithJoinedAt",
},
401: {
body: "APIErrorResponse",

View File

@ -28,7 +28,7 @@ router.get(
permission: "MANAGE_GUILD",
responses: {
200: {
body: "GuildInvitesResponse",
body: "APIInviteArray",
},
},
}),

View File

@ -42,7 +42,7 @@ router.get(
},
responses: {
200: {
body: "GuildMembersResponse",
body: "APIMemberArray",
},
403: {
body: "APIErrorResponse",

View File

@ -27,7 +27,7 @@ router.get(
route({
responses: {
200: {
body: "GuildVoiceRegionsResponse",
body: "APIGuildVoiceRegion",
},
404: {
body: "APIErrorResponse",

View File

@ -122,7 +122,7 @@ router.patch(
permission: "MANAGE_ROLES",
responses: {
200: {
body: "GuildRolesResponse",
body: "APIRoleArray",
},
400: {
body: "APIErrorResponse",

View File

@ -38,7 +38,7 @@ router.get(
route({
responses: {
200: {
body: "GuildStickersResponse",
body: "APIStickerArray",
},
403: {
body: "APIErrorResponse",

View File

@ -45,7 +45,7 @@ router.get(
route({
responses: {
200: {
body: "GuildTemplatesResponse",
body: "APITemplateArray",
},
},
}),

View File

@ -26,7 +26,7 @@ router.get(
route({
responses: {
200: {
body: "GeneralConfigurationResponse",
body: "APIGeneralConfiguration",
},
},
}),

View File

@ -26,7 +26,7 @@ router.get(
route({
responses: {
200: {
body: "LimitsConfigurationResponse",
body: "APILimitsConfiguration",
},
},
}),

View File

@ -27,7 +27,7 @@ router.get(
route({
responses: {
200: {
body: "StickerPacksResponse",
body: "APIStickerPackArray",
},
},
}),

View File

@ -27,7 +27,7 @@ router.get(
route({
responses: {
200: {
body: "PublicUserResponse",
body: "APIPublicUser",
},
},
}),

View File

@ -32,7 +32,7 @@ router.get(
route({
responses: {
200: {
body: "UserChannelsResponse",
body: "APIDMChannelArray",
},
},
}),

View File

@ -36,7 +36,7 @@ router.get(
route({
responses: {
200: {
body: "UserGuildsResponse",
body: "APIGuildArray",
},
},
}),

View File

@ -39,7 +39,7 @@ router.get(
route({
responses: {
200: {
body: "PrivateUserResponse",
body: "APIPrivateUser",
},
},
}),

View File

@ -34,7 +34,7 @@ router.post(
requestBody: "CodesVerificationSchema",
responses: {
200: {
body: "UserBackupCodesResponse",
body: "APIBackupCodeArray",
},
400: {
body: "APIErrorResponse",

View File

@ -40,7 +40,7 @@ router.post(
"This route is replaced with users/@me/mfa/codes-verification in newer clients",
responses: {
200: {
body: "UserBackupCodesResponse",
body: "APIBackupCodeArray",
},
400: {
body: "APIErrorResponse",

View File

@ -26,7 +26,7 @@ router.get(
route({
responses: {
200: {
body: "GuildVoiceRegionsResponse",
body: "APIGuildVoiceRegion",
},
},
}),

View File

@ -16,10 +16,10 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { PublicConnectedAccount, PublicUserResponse } from "..";
import { PublicConnectedAccount, PublicUser } from "..";
export interface UserProfileResponse {
user: PublicUserResponse;
user: PublicUser;
connected_accounts: PublicConnectedAccount;
premium_guild_since?: Date;
premium_since?: Date;

View File

@ -1 +0,0 @@
export type ApplicationDetectableResponse = unknown[];

View File

@ -1 +0,0 @@
export type ApplicationEntitlementsResponse = unknown[];

View File

@ -1 +0,0 @@
export type ApplicationSkusResponse = unknown[];

View File

@ -1,3 +0,0 @@
import { Application } from "../../entities";
export type ApplicationsResponse = Application[];

View File

@ -1,3 +0,0 @@
import { Invite } from "../../entities";
export type ChannelInvitesResponse = Invite[];

View File

@ -1,3 +0,0 @@
import { Message } from "../../entities";
export type ChannelMessagesResponse = Message[];

View File

@ -1,3 +0,0 @@
import { Message } from "../../entities";
export type ChannelPinsResponse = Message[];

View File

@ -1,3 +0,0 @@
import { Webhook } from "../../entities";
export type ChannelWebhooksResponse = Webhook[];

View File

@ -1,3 +0,0 @@
import { Categories } from "../../entities";
export type DiscoveryCategoriesResponse = Categories[];

View File

@ -1,3 +0,0 @@
import { GeneralConfiguration } from "../../config";
export type GeneralConfigurationResponse = GeneralConfiguration;

View File

@ -1,3 +0,0 @@
import { Channel } from "../../entities";
export type GuildChannelsResponse = Channel[];

View File

@ -1,3 +0,0 @@
import { Emoji } from "../../entities";
export type GuildEmojisResponse = Emoji[];

View File

@ -1,3 +0,0 @@
import { Invite } from "../../entities";
export type GuildInvitesResponse = Invite[];

View File

@ -1,3 +0,0 @@
import { Member } from "../../entities";
export type GuildMembersResponse = Member[];

View File

@ -1,3 +0,0 @@
import { Guild } from "../../entities";
export type GuildResponse = Guild & { joined_at: string };

View File

@ -1,3 +0,0 @@
import { Role } from "../../entities";
export type GuildRolesResponse = Role[];

View File

@ -1,3 +0,0 @@
import { Sticker } from "../../entities";
export type GuildStickersResponse = Sticker[];

View File

@ -1,3 +0,0 @@
import { Template } from "../../entities";
export type GuildTemplatesResponse = Template[];

View File

@ -5,5 +5,3 @@ export interface GuildVoiceRegion {
deprecated: boolean;
optimal: boolean;
}
export type GuildVoiceRegionsResponse = GuildVoiceRegion[];

View File

@ -1,3 +0,0 @@
import { LimitsConfiguration } from "../../config";
export type LimitsConfigurationResponse = LimitsConfiguration;

View File

@ -1,3 +0,0 @@
import { StickerPack } from "../../entities";
export type StickerPacksResponse = StickerPack[];

View File

@ -0,0 +1,84 @@
import { GeneralConfiguration, LimitsConfiguration } from "../../config";
import { DmChannelDTO } from "../../dtos";
import {
Application,
BackupCode,
Categories,
Channel,
Emoji,
Guild,
Invite,
Member,
Message,
PrivateUser,
PublicUser,
Role,
Sticker,
StickerPack,
Template,
Webhook,
} from "../../entities";
import { GuildVoiceRegion } from "./GuildVoiceRegionsResponse";
// removes internal properties from the guild class
export type APIGuild = Omit<
Guild,
| "afk_channel"
| "template"
| "owner"
| "public_updates_channel"
| "rules_channel"
| "system_channel"
| "widget_channel"
>;
export type APIPublicUser = PublicUser;
export type APIPrivateUser = PrivateUser;
export type APIGuildArray = APIGuild[];
export type APIDMChannelArray = DmChannelDTO[];
export type APIBackupCodeArray = BackupCode[];
export interface UserUpdateResponse extends APIPrivateUser {
newToken?: string;
}
export type ApplicationDetectableResponse = unknown[];
export type ApplicationEntitlementsResponse = unknown[];
export type ApplicationSkusResponse = unknown[];
export type APIApplicationArray = Application[];
export type APIInviteArray = Invite[];
export type APIMessageArray = Message[];
export type APIWebhookArray = Webhook[];
export type APIDiscoveryCategoryArray = Categories[];
export type APIGeneralConfiguration = GeneralConfiguration;
export type APIChannelArray = Channel[];
export type APIEmojiArray = Emoji[];
export type APIMemberArray = Member[];
export type GuildWithJoinedAt = Guild & { joined_at: string };
export type APIRoleArray = Role[];
export type APIStickerArray = Sticker[];
export type APITemplateArray = Template[];
export type APIGuildVoiceRegion = GuildVoiceRegion[];
export type APILimitsConfiguration = LimitsConfiguration;
export type APIStickerPackArray = StickerPack[];

View File

@ -1,15 +0,0 @@
import { DmChannelDTO } from "../../dtos";
import { BackupCode, Guild, PrivateUser, PublicUser } from "../../entities";
export type PublicUserResponse = PublicUser;
export type PrivateUserResponse = PrivateUser;
export interface UserUpdateResponse extends PrivateUserResponse {
newToken?: string;
}
export type UserGuildsResponse = Guild[];
export type UserChannelsResponse = DmChannelDTO[];
export type UserBackupCodesResponse = BackupCode[];

View File

@ -1,34 +1,17 @@
export * from "./APIErrorOrCaptchaResponse";
export * from "./APIErrorResponse";
export * from "./ApplicationDetectableResponse";
export * from "./ApplicationEntitlementsResponse";
export * from "./ApplicationSkusResponse";
export * from "./ApplicationsResponse";
export * from "./BackupCodesChallengeResponse";
export * from "./CaptchaRequiredResponse";
export * from "./ChannelInvitesResponse";
export * from "./ChannelPinsResponse";
export * from "./ChannelWebhooksResponse";
export * from "./DiscoverableGuildsResponse";
export * from "./DiscoveryCategoriesResponse";
export * from "./GatewayBotResponse";
export * from "./GatewayResponse";
export * from "./GeneralConfigurationResponse";
export * from "./GenerateRegistrationTokensResponse";
export * from "./GuildBansResponse";
export * from "./GuildChannelsResponse";
export * from "./GuildCreateResponse";
export * from "./GuildDiscoveryRequirements";
export * from "./GuildEmojisResponse";
export * from "./GuildInvitesResponse";
export * from "./GuildMembersResponse";
export * from "./GuildMessagesSearchResponse";
export * from "./GuildPruneResponse";
export * from "./GuildRecommendationsResponse";
export * from "./GuildResponse";
export * from "./GuildRolesResponse";
export * from "./GuildStickersResponse";
export * from "./GuildTemplatesResponse";
export * from "./GuildVanityUrl";
export * from "./GuildVoiceRegionsResponse";
export * from "./GuildWidgetJsonResponse";
@ -36,18 +19,16 @@ export * from "./GuildWidgetSettingsResponse";
export * from "./InstanceDomainsResponse";
export * from "./InstancePingResponse";
export * from "./InstanceStatsResponse";
export * from "./LimitsConfigurationResponse";
export * from "./LocationMetadataResponse";
export * from "./MemberJoinGuildResponse";
export * from "./OAuthAuthorizeResponse";
export * from "./StickerPacksResponse";
export * from "./Tenor";
export * from "./TokenResponse";
export * from "./TypedResponses";
export * from "./UpdatesResponse";
export * from "./UserNoteResponse";
export * from "./UserProfileResponse";
export * from "./UserRelationshipsResponse";
export * from "./UserRelationsResponse";
export * from "./UserResponse";
export * from "./WebAuthnCreateResponse";
export * from "./WebhookCreateResponse";