From 1ce7879ee85ea5bb5efaff3cf950e65513098d3c Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sat, 25 Mar 2023 16:09:04 -0400 Subject: oapi: users progress --- src/util/schemas/UserNoteUpdateSchema.ts | 3 +++ src/util/schemas/UserProfileResponse.ts | 4 ++-- src/util/schemas/index.ts | 1 + src/util/schemas/responses/UserNoteResponse.ts | 5 +++++ src/util/schemas/responses/UserProfileResponse.ts | 4 ++-- .../schemas/responses/UserRelationshipsResponse.ts | 8 ++++++++ src/util/schemas/responses/UserResponse.ts | 22 ++++++++++++++++++++++ src/util/schemas/responses/index.ts | 3 +++ 8 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 src/util/schemas/UserNoteUpdateSchema.ts create mode 100644 src/util/schemas/responses/UserNoteResponse.ts create mode 100644 src/util/schemas/responses/UserRelationshipsResponse.ts create mode 100644 src/util/schemas/responses/UserResponse.ts (limited to 'src/util/schemas') diff --git a/src/util/schemas/UserNoteUpdateSchema.ts b/src/util/schemas/UserNoteUpdateSchema.ts new file mode 100644 index 00000000..0a731279 --- /dev/null +++ b/src/util/schemas/UserNoteUpdateSchema.ts @@ -0,0 +1,3 @@ +export interface UserNoteUpdateSchema { + note: string; +} diff --git a/src/util/schemas/UserProfileResponse.ts b/src/util/schemas/UserProfileResponse.ts index 699d6a29..4ef6431e 100644 --- a/src/util/schemas/UserProfileResponse.ts +++ b/src/util/schemas/UserProfileResponse.ts @@ -16,10 +16,10 @@ along with this program. If not, see . */ -import { PublicConnectedAccount, UserPublic } from ".."; +import { PublicConnectedAccount, PublicUserResponse } from ".."; export interface UserProfileResponse { - user: UserPublic; + user: PublicUserResponse; connected_accounts: PublicConnectedAccount; premium_guild_since?: Date; premium_since?: Date; diff --git a/src/util/schemas/index.ts b/src/util/schemas/index.ts index 23d03190..44a504cd 100644 --- a/src/util/schemas/index.ts +++ b/src/util/schemas/index.ts @@ -69,6 +69,7 @@ export * from "./TotpSchema"; export * from "./UserDeleteSchema"; export * from "./UserGuildSettingsSchema"; export * from "./UserModifySchema"; +export * from "./UserNoteUpdateSchema"; export * from "./UserProfileModifySchema"; export * from "./UserSettingsSchema"; export * from "./Validator"; diff --git a/src/util/schemas/responses/UserNoteResponse.ts b/src/util/schemas/responses/UserNoteResponse.ts new file mode 100644 index 00000000..b142811e --- /dev/null +++ b/src/util/schemas/responses/UserNoteResponse.ts @@ -0,0 +1,5 @@ +export interface UserNoteResponse { + note: string; + note_user_id: string; + user_id: string; +} diff --git a/src/util/schemas/responses/UserProfileResponse.ts b/src/util/schemas/responses/UserProfileResponse.ts index 4e5cd8a6..bd1f46dd 100644 --- a/src/util/schemas/responses/UserProfileResponse.ts +++ b/src/util/schemas/responses/UserProfileResponse.ts @@ -1,7 +1,7 @@ -import { PublicConnectedAccount, UserPublic } from "../../entities"; +import { PublicConnectedAccount, PublicUser } from "../../entities"; export interface UserProfileResponse { - user: UserPublic; + user: PublicUser; connected_accounts: PublicConnectedAccount; premium_guild_since?: Date; premium_since?: Date; diff --git a/src/util/schemas/responses/UserRelationshipsResponse.ts b/src/util/schemas/responses/UserRelationshipsResponse.ts new file mode 100644 index 00000000..dff2f118 --- /dev/null +++ b/src/util/schemas/responses/UserRelationshipsResponse.ts @@ -0,0 +1,8 @@ +import { PublicUser, RelationshipType } from "../../entities"; + +export interface UserRelationshipsResponse { + id: string; + type: RelationshipType; + nickname: null; + user: PublicUser; +} diff --git a/src/util/schemas/responses/UserResponse.ts b/src/util/schemas/responses/UserResponse.ts new file mode 100644 index 00000000..21c30cd5 --- /dev/null +++ b/src/util/schemas/responses/UserResponse.ts @@ -0,0 +1,22 @@ +import { DmChannelDTO } from "../../dtos"; +import { Guild, PrivateUser, PublicUser, User } 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 interface UserBackupCodesResponse { + expired: unknown; + user: User; + code: string; + consumed: boolean; + id: string; +} +[]; diff --git a/src/util/schemas/responses/index.ts b/src/util/schemas/responses/index.ts index 3f29b779..1f0e2aed 100644 --- a/src/util/schemas/responses/index.ts +++ b/src/util/schemas/responses/index.ts @@ -39,6 +39,9 @@ export * from "./OAuthAuthorizeResponse"; export * from "./StickerPacksResponse"; export * from "./Tenor"; export * from "./TokenResponse"; +export * from "./UserNoteResponse"; export * from "./UserProfileResponse"; +export * from "./UserRelationshipsResponse"; export * from "./UserRelationsResponse"; +export * from "./UserResponse"; export * from "./WebhookCreateResponse"; -- cgit 1.4.1