summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@proton.me>2023-03-25 20:21:13 -0400
committerPuyodead1 <puyodead@proton.me>2023-04-13 15:41:23 -0400
commit0d666732c61ce98fe775bc5c34ebbef11b839ec2 (patch)
tree82ff6d043c95c446698093cf494b1b5c946883fc /src
parentoapi: root level routes (diff)
downloadserver-0d666732c61ce98fe775bc5c34ebbef11b839ec2.tar.xz
oapi: bug fixes
Diffstat (limited to 'src')
-rw-r--r--src/gateway/opcodes/LazyRequest.ts4
-rw-r--r--src/util/interfaces/Activity.ts2
-rw-r--r--src/util/schemas/AckBulkSchema.ts12
-rw-r--r--src/util/schemas/IdentifySchema.ts6
-rw-r--r--src/util/schemas/LazyRequestSchema.ts7
-rw-r--r--src/util/schemas/MemberChangeProfileSchema.ts8
-rw-r--r--src/util/schemas/UserProfileModifySchema.ts8
7 files changed, 28 insertions, 19 deletions
diff --git a/src/gateway/opcodes/LazyRequest.ts b/src/gateway/opcodes/LazyRequest.ts

index 64e50d92..cde91a75 100644 --- a/src/gateway/opcodes/LazyRequest.ts +++ b/src/gateway/opcodes/LazyRequest.ts
@@ -267,7 +267,9 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { if (!Array.isArray(ranges)) throw new Error("Not a valid Array"); const member_count = await Member.count({ where: { guild_id } }); - const ops = await Promise.all(ranges.map((x) => getMembers(guild_id, x))); + const ops = await Promise.all( + ranges.map((x) => getMembers(guild_id, x as [number, number])), + ); // TODO: unsubscribe member_events that are not in op.members diff --git a/src/util/interfaces/Activity.ts b/src/util/interfaces/Activity.ts
index 7654ba90..0227f242 100644 --- a/src/util/interfaces/Activity.ts +++ b/src/util/interfaces/Activity.ts
@@ -36,7 +36,7 @@ export interface Activity { }; party?: { id?: string; - size?: [number]; // used to show the party's current and maximum size // TODO: array length 2 + size?: number[]; // used to show the party's current and maximum size // TODO: array length 2 }; assets?: { large_image?: string; // the id for a large asset of the activity, usually a snowflake diff --git a/src/util/schemas/AckBulkSchema.ts b/src/util/schemas/AckBulkSchema.ts
index cf6dc597..5604c2fc 100644 --- a/src/util/schemas/AckBulkSchema.ts +++ b/src/util/schemas/AckBulkSchema.ts
@@ -17,11 +17,9 @@ */ export interface AckBulkSchema { - read_states: [ - { - channel_id: string; - message_id: string; - read_state_type: number; // WHat is this? - }, - ]; + read_states: { + channel_id: string; + message_id: string; + read_state_type: number; // WHat is this? + }[]; } diff --git a/src/util/schemas/IdentifySchema.ts b/src/util/schemas/IdentifySchema.ts
index fb48c2a4..cb967aed 100644 --- a/src/util/schemas/IdentifySchema.ts +++ b/src/util/schemas/IdentifySchema.ts
@@ -109,7 +109,11 @@ export interface IdentifySchema { compress?: boolean; large_threshold?: number; largeThreshold?: number; - shard?: [bigint, bigint]; + /** + * @minItems 2 + * @maxItems 2 + */ + shard?: bigint[]; // puyo: changed from [bigint, bigint] because it breaks openapi guild_subscriptions?: boolean; capabilities?: number; client_state?: { diff --git a/src/util/schemas/LazyRequestSchema.ts b/src/util/schemas/LazyRequestSchema.ts
index f69ae1f7..ee52d66c 100644 --- a/src/util/schemas/LazyRequestSchema.ts +++ b/src/util/schemas/LazyRequestSchema.ts
@@ -19,7 +19,12 @@ export interface LazyRequestSchema { guild_id: string; channels?: { - [key: string]: [number, number][]; + /** + * @items.type integer + * @minItems 2 + * @maxItems 2 + */ + [key: string]: number[][]; // puyo: changed from [number, number] because it breaks openapi }; activities?: boolean; threads?: boolean; diff --git a/src/util/schemas/MemberChangeProfileSchema.ts b/src/util/schemas/MemberChangeProfileSchema.ts
index e955a0f1..06505ab9 100644 --- a/src/util/schemas/MemberChangeProfileSchema.ts +++ b/src/util/schemas/MemberChangeProfileSchema.ts
@@ -21,9 +21,9 @@ export interface MemberChangeProfileSchema { nick?: string; bio?: string; pronouns?: string; - - /* - * @items.type integer + /** + * @minItems 2 + * @maxItems 2 */ - theme_colors?: [number, number]; + theme_colors?: number[]; // puyo: changed from [number, number] because it breaks openapi } diff --git a/src/util/schemas/UserProfileModifySchema.ts b/src/util/schemas/UserProfileModifySchema.ts
index d49fe326..6f6777dd 100644 --- a/src/util/schemas/UserProfileModifySchema.ts +++ b/src/util/schemas/UserProfileModifySchema.ts
@@ -21,9 +21,9 @@ export interface UserProfileModifySchema { accent_color?: number | null; banner?: string | null; pronouns?: string; - - /* - * @items.type integer + /** + * @minItems 2 + * @maxItems 2 */ - theme_colors?: [number, number]; + theme_colors?: number[]; // puyo: changed from [number, number] because it breaks openapi }