oapi: bug fixes

This commit is contained in:
Puyodead1 2023-03-25 20:21:13 -04:00
parent 3a23842924
commit 0d666732c6
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
10 changed files with 481 additions and 1028 deletions

View File

@ -35,8 +35,7 @@
"properties": { "properties": {
"read_states": { "read_states": {
"type": "array", "type": "array",
"items": [ "items": {
{
"type": "object", "type": "object",
"properties": { "properties": {
"channel_id": { "channel_id": {
@ -56,9 +55,6 @@
"read_state_type" "read_state_type"
] ]
} }
],
"minItems": 1,
"maxItems": 1
} }
}, },
"required": [ "required": [
@ -515,13 +511,9 @@
}, },
"size": { "size": {
"type": "array", "type": "array",
"items": [ "items": {
{
"type": "integer" "type": "integer"
} }
],
"minItems": 1,
"maxItems": 1
} }
}, },
"additionalProperties": false "additionalProperties": false
@ -4474,17 +4466,12 @@
"type": "integer" "type": "integer"
}, },
"shard": { "shard": {
"minItems": 2,
"maxItems": 2,
"type": "array", "type": "array",
"items": [ "items": {
{
"type": "number"
},
{
"type": "number" "type": "number"
} }
],
"minItems": 2,
"maxItems": 2
}, },
"guild_subscriptions": { "guild_subscriptions": {
"type": "boolean" "type": "boolean"
@ -4603,16 +4590,9 @@
"type": "array", "type": "array",
"items": { "items": {
"type": "array", "type": "array",
"items": [ "items": {
{
"type": "integer"
},
{
"type": "integer" "type": "integer"
} }
],
"minItems": 2,
"maxItems": 2
} }
} }
}, },
@ -4687,17 +4667,12 @@
"type": "string" "type": "string"
}, },
"theme_colors": { "theme_colors": {
"minItems": 2,
"maxItems": 2,
"type": "array", "type": "array",
"items": [ "items": {
{
"type": "integer"
},
{
"type": "integer" "type": "integer"
} }
],
"minItems": 2,
"maxItems": 2
} }
} }
}, },
@ -5472,17 +5447,12 @@
"type": "string" "type": "string"
}, },
"theme_colors": { "theme_colors": {
"minItems": 2,
"maxItems": 2,
"type": "array", "type": "array",
"items": [ "items": {
{
"type": "integer"
},
{
"type": "integer" "type": "integer"
} }
],
"minItems": 2,
"maxItems": 2
} }
} }
}, },

File diff suppressed because it is too large Load Diff

View File

@ -135,7 +135,7 @@ function main() {
definitions = { ...definitions, [name]: { ...part } }; definitions = { ...definitions, [name]: { ...part } };
} }
modify(definitions); // modify(definitions);
fs.writeFileSync(schemaPath, JSON.stringify(definitions, null, 4)); fs.writeFileSync(schemaPath, JSON.stringify(definitions, null, 4));
} }

View File

@ -267,7 +267,9 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) {
if (!Array.isArray(ranges)) throw new Error("Not a valid Array"); if (!Array.isArray(ranges)) throw new Error("Not a valid Array");
const member_count = await Member.count({ where: { guild_id } }); 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 // TODO: unsubscribe member_events that are not in op.members

View File

@ -36,7 +36,7 @@ export interface Activity {
}; };
party?: { party?: {
id?: string; 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?: { assets?: {
large_image?: string; // the id for a large asset of the activity, usually a snowflake large_image?: string; // the id for a large asset of the activity, usually a snowflake

View File

@ -17,11 +17,9 @@
*/ */
export interface AckBulkSchema { export interface AckBulkSchema {
read_states: [ read_states: {
{
channel_id: string; channel_id: string;
message_id: string; message_id: string;
read_state_type: number; // WHat is this? read_state_type: number; // WHat is this?
}, }[];
];
} }

View File

@ -109,7 +109,11 @@ export interface IdentifySchema {
compress?: boolean; compress?: boolean;
large_threshold?: number; large_threshold?: number;
largeThreshold?: number; largeThreshold?: number;
shard?: [bigint, bigint]; /**
* @minItems 2
* @maxItems 2
*/
shard?: bigint[]; // puyo: changed from [bigint, bigint] because it breaks openapi
guild_subscriptions?: boolean; guild_subscriptions?: boolean;
capabilities?: number; capabilities?: number;
client_state?: { client_state?: {

View File

@ -19,7 +19,12 @@
export interface LazyRequestSchema { export interface LazyRequestSchema {
guild_id: string; guild_id: string;
channels?: { 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; activities?: boolean;
threads?: boolean; threads?: boolean;

View File

@ -21,9 +21,9 @@ export interface MemberChangeProfileSchema {
nick?: string; nick?: string;
bio?: string; bio?: string;
pronouns?: string; pronouns?: string;
/**
/* * @minItems 2
* @items.type integer * @maxItems 2
*/ */
theme_colors?: [number, number]; theme_colors?: number[]; // puyo: changed from [number, number] because it breaks openapi
} }

View File

@ -21,9 +21,9 @@ export interface UserProfileModifySchema {
accent_color?: number | null; accent_color?: number | null;
banner?: string | null; banner?: string | null;
pronouns?: string; pronouns?: string;
/**
/* * @minItems 2
* @items.type integer * @maxItems 2
*/ */
theme_colors?: [number, number]; theme_colors?: number[]; // puyo: changed from [number, number] because it breaks openapi
} }