From e6b2da048144ca67b9f7613101f1d4ca7aa26fb5 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Thu, 21 Apr 2022 17:07:06 +0100 Subject: [PATCH] feat: update API spec --- OpenAPI.json | 30 +++++++++--------------------- package.json | 2 +- src/schema.ts | 6 +++--- src/types.ts | 1 - 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/OpenAPI.json b/OpenAPI.json index 04a58bf..89bbdca 100644 --- a/OpenAPI.json +++ b/OpenAPI.json @@ -5881,8 +5881,7 @@ "required": [ "_id", "author", - "channel", - "content" + "channel" ], "properties": { "_id": { @@ -5904,11 +5903,17 @@ }, "content": { "description": "Message content", + "type": "string", + "nullable": true + }, + "system": { + "description": "System message", "allOf": [ { - "$ref": "#/components/schemas/Content" + "$ref": "#/components/schemas/SystemMessage" } - ] + ], + "nullable": true }, "attachments": { "description": "Array of attachments", @@ -5962,23 +5967,6 @@ } } }, - "Content": { - "description": "Untagged enum representing message content", - "anyOf": [ - { - "description": "Message contains text content", - "type": "string" - }, - { - "description": "Message is a system event", - "allOf": [ - { - "$ref": "#/components/schemas/SystemMessage" - } - ] - } - ] - }, "SystemMessage": { "description": "Representation of a system event message", "oneOf": [ diff --git a/package.json b/package.json index 8515cf3..6b729bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revolt-api", - "version": "0.5.3-rc.12", + "version": "0.5.3-rc.13", "description": "Revolt API Library", "main": "dist/index.js", "homepage": "https://developers.revolt.chat", diff --git a/src/schema.ts b/src/schema.ts index 0361766..348768a 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -1028,7 +1028,9 @@ export interface components { /** @description Id of the user that sent this message */ author: string; /** @description Message content */ - content: components["schemas"]["Content"]; + content?: string | null; + /** @description System message */ + system?: components["schemas"]["SystemMessage"] | null; /** @description Array of attachments */ attachments?: components["schemas"]["File"][] | null; /** @description Time at which this message was last edited */ @@ -1042,8 +1044,6 @@ export interface components { /** @description Name and / or avatar overrides for this message */ masquerade?: components["schemas"]["Masquerade"] | null; }; - /** @description Untagged enum representing message content */ - Content: string | components["schemas"]["SystemMessage"]; /** @description Representation of a system event message */ SystemMessage: | { diff --git a/src/types.ts b/src/types.ts index de5dcc1..d48739c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -37,7 +37,6 @@ export type DataEditChannel = components['schemas']['DataEditChannel']; export type FieldsChannel = components['schemas']['FieldsChannel']; export type Invite = components['schemas']['Invite']; export type Message = components['schemas']['Message']; -export type Content = components['schemas']['Content']; export type SystemMessage = components['schemas']['SystemMessage']; export type ISO8601_Timestamp = components['schemas']['ISO8601 Timestamp']; export type Embed = components['schemas']['Embed'];