From 2042dedebfe9947447ed519d7ebf034d169199c2 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 10 Apr 2024 13:41:35 +0200 Subject: [PATCH] refactor(OpenAPI): Use proper type inheritance for chat messages Signed-off-by: provokateurin --- lib/Model/ProxyCacheMessage.php | 4 +- lib/ResponseDefinitions.php | 28 +- openapi-backend-sipbridge.json | 248 ++++++++---------- openapi-federation.json | 248 ++++++++---------- openapi-full.json | 248 ++++++++---------- openapi.json | 248 ++++++++---------- .../openapi/openapi-backend-sipbridge.ts | 42 ++- src/types/openapi/openapi-federation.ts | 42 ++- src/types/openapi/openapi-full.ts | 42 ++- src/types/openapi/openapi.ts | 42 ++- 10 files changed, 521 insertions(+), 671 deletions(-) diff --git a/lib/Model/ProxyCacheMessage.php b/lib/Model/ProxyCacheMessage.php index 7e3e7dec5a6..a4f1a23ff24 100644 --- a/lib/Model/ProxyCacheMessage.php +++ b/lib/Model/ProxyCacheMessage.php @@ -59,7 +59,7 @@ * @method void setMetaData(?string $metaData) * @method string|null getMetaData() * - * @psalm-import-type TalkRoomProxyMessage from ResponseDefinitions + * @psalm-import-type TalkChatProxyMessage from ResponseDefinitions */ class ProxyCacheMessage extends Entity implements \JsonSerializable { public const METADATA_REPLY_TO_ACTOR_TYPE = 'replyToActorType'; @@ -108,7 +108,7 @@ public function getParsedMetaData(): array { } /** - * @return TalkRoomProxyMessage + * @return TalkChatProxyMessage */ public function jsonSerialize(): array { $expirationTimestamp = 0; diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 263f3deb244..0348c76c319 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -93,21 +93,24 @@ * conversation?: string, * } * - * @psalm-type TalkChatMessage = array{ + * @psalm-type TalkBaseMessage = array{ * actorDisplayName: string, * actorId: string, * actorType: string, - * deleted?: true, * expirationTimestamp: int, - * id: int, - * isReplyable: bool, - * markdown: bool, * message: string, * messageParameters: array, * messageType: string, + * systemMessage: string, + * } + * + * @psalm-type TalkChatMessage = TalkBaseMessage&array{ + * deleted?: true, + * id: int, + * isReplyable: bool, + * markdown: bool, * reactions: array|\stdClass, * referenceId: string, - * systemMessage: string, * timestamp: int, * token: string, * lastEditActorDisplayName?: string, @@ -117,18 +120,9 @@ * silent?: bool, * } * - * @psalm-type TalkRoomProxyMessage = array{ - * actorDisplayName: string, - * actorId: string, - * actorType: string, - * expirationTimestamp: int, - * message: string, - * messageParameters: array, - * messageType: string, - * systemMessage: string, - * } + * @psalm-type TalkChatProxyMessage = TalkBaseMessage * - * @psalm-type TalkRoomLastMessage = TalkChatMessage|TalkRoomProxyMessage + * @psalm-type TalkRoomLastMessage = TalkChatMessage|TalkChatProxyMessage * * @psalm-type TalkChatMessageWithParent = TalkChatMessage&array{parent?: TalkChatMessage} * diff --git a/openapi-backend-sipbridge.json b/openapi-backend-sipbridge.json index 4d9fee9b107..f5d83638b1b 100644 --- a/openapi-backend-sipbridge.json +++ b/openapi-backend-sipbridge.json @@ -20,6 +20,49 @@ } }, "schemas": { + "BaseMessage": { + "type": "object", + "required": [ + "actorDisplayName", + "actorId", + "actorType", + "expirationTimestamp", + "message", + "messageParameters", + "messageType", + "systemMessage" + ], + "properties": { + "actorDisplayName": { + "type": "string" + }, + "actorId": { + "type": "string" + }, + "actorType": { + "type": "string" + }, + "expirationTimestamp": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + }, + "messageParameters": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RichObjectParameter" + } + }, + "messageType": { + "type": "string" + }, + "systemMessage": { + "type": "string" + } + } + }, "Capabilities": { "type": "object", "required": [ @@ -209,103 +252,77 @@ } }, "ChatMessage": { - "type": "object", - "required": [ - "actorDisplayName", - "actorId", - "actorType", - "expirationTimestamp", - "id", - "isReplyable", - "markdown", - "message", - "messageParameters", - "messageType", - "reactions", - "referenceId", - "systemMessage", - "timestamp", - "token" - ], - "properties": { - "actorDisplayName": { - "type": "string" - }, - "actorId": { - "type": "string" - }, - "actorType": { - "type": "string" - }, - "deleted": { - "type": "boolean", - "enum": [ - true - ] - }, - "expirationTimestamp": { - "type": "integer", - "format": "int64" - }, - "id": { - "type": "integer", - "format": "int64" - }, - "isReplyable": { - "type": "boolean" - }, - "markdown": { - "type": "boolean" - }, - "message": { - "type": "string" - }, - "messageParameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/RichObjectParameter" - } - }, - "messageType": { - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/BaseMessage" }, - "reactions": { + { "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int64" + "required": [ + "id", + "isReplyable", + "markdown", + "reactions", + "referenceId", + "timestamp", + "token" + ], + "properties": { + "deleted": { + "type": "boolean", + "enum": [ + true + ] + }, + "id": { + "type": "integer", + "format": "int64" + }, + "isReplyable": { + "type": "boolean" + }, + "markdown": { + "type": "boolean" + }, + "reactions": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" + } + }, + "referenceId": { + "type": "string" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "token": { + "type": "string" + }, + "lastEditActorDisplayName": { + "type": "string" + }, + "lastEditActorId": { + "type": "string" + }, + "lastEditActorType": { + "type": "string" + }, + "lastEditTimestamp": { + "type": "integer", + "format": "int64" + }, + "silent": { + "type": "boolean" + } } - }, - "referenceId": { - "type": "string" - }, - "systemMessage": { - "type": "string" - }, - "timestamp": { - "type": "integer", - "format": "int64" - }, - "token": { - "type": "string" - }, - "lastEditActorDisplayName": { - "type": "string" - }, - "lastEditActorId": { - "type": "string" - }, - "lastEditActorType": { - "type": "string" - }, - "lastEditTimestamp": { - "type": "integer", - "format": "int64" - }, - "silent": { - "type": "boolean" } - } + ] + }, + "ChatProxyMessage": { + "$ref": "#/components/schemas/BaseMessage" }, "OCSMeta": { "type": "object", @@ -712,52 +729,9 @@ "$ref": "#/components/schemas/ChatMessage" }, { - "$ref": "#/components/schemas/RoomProxyMessage" + "$ref": "#/components/schemas/ChatProxyMessage" } ] - }, - "RoomProxyMessage": { - "type": "object", - "required": [ - "actorDisplayName", - "actorId", - "actorType", - "expirationTimestamp", - "message", - "messageParameters", - "messageType", - "systemMessage" - ], - "properties": { - "actorDisplayName": { - "type": "string" - }, - "actorId": { - "type": "string" - }, - "actorType": { - "type": "string" - }, - "expirationTimestamp": { - "type": "integer", - "format": "int64" - }, - "message": { - "type": "string" - }, - "messageParameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/RichObjectParameter" - } - }, - "messageType": { - "type": "string" - }, - "systemMessage": { - "type": "string" - } - } } } }, diff --git a/openapi-federation.json b/openapi-federation.json index 26404c9559d..3107c12b6c6 100644 --- a/openapi-federation.json +++ b/openapi-federation.json @@ -20,6 +20,49 @@ } }, "schemas": { + "BaseMessage": { + "type": "object", + "required": [ + "actorDisplayName", + "actorId", + "actorType", + "expirationTimestamp", + "message", + "messageParameters", + "messageType", + "systemMessage" + ], + "properties": { + "actorDisplayName": { + "type": "string" + }, + "actorId": { + "type": "string" + }, + "actorType": { + "type": "string" + }, + "expirationTimestamp": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + }, + "messageParameters": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RichObjectParameter" + } + }, + "messageType": { + "type": "string" + }, + "systemMessage": { + "type": "string" + } + } + }, "Capabilities": { "type": "object", "required": [ @@ -209,103 +252,77 @@ } }, "ChatMessage": { - "type": "object", - "required": [ - "actorDisplayName", - "actorId", - "actorType", - "expirationTimestamp", - "id", - "isReplyable", - "markdown", - "message", - "messageParameters", - "messageType", - "reactions", - "referenceId", - "systemMessage", - "timestamp", - "token" - ], - "properties": { - "actorDisplayName": { - "type": "string" - }, - "actorId": { - "type": "string" - }, - "actorType": { - "type": "string" - }, - "deleted": { - "type": "boolean", - "enum": [ - true - ] - }, - "expirationTimestamp": { - "type": "integer", - "format": "int64" - }, - "id": { - "type": "integer", - "format": "int64" - }, - "isReplyable": { - "type": "boolean" - }, - "markdown": { - "type": "boolean" - }, - "message": { - "type": "string" - }, - "messageParameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/RichObjectParameter" - } - }, - "messageType": { - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/BaseMessage" }, - "reactions": { + { "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int64" + "required": [ + "id", + "isReplyable", + "markdown", + "reactions", + "referenceId", + "timestamp", + "token" + ], + "properties": { + "deleted": { + "type": "boolean", + "enum": [ + true + ] + }, + "id": { + "type": "integer", + "format": "int64" + }, + "isReplyable": { + "type": "boolean" + }, + "markdown": { + "type": "boolean" + }, + "reactions": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" + } + }, + "referenceId": { + "type": "string" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "token": { + "type": "string" + }, + "lastEditActorDisplayName": { + "type": "string" + }, + "lastEditActorId": { + "type": "string" + }, + "lastEditActorType": { + "type": "string" + }, + "lastEditTimestamp": { + "type": "integer", + "format": "int64" + }, + "silent": { + "type": "boolean" + } } - }, - "referenceId": { - "type": "string" - }, - "systemMessage": { - "type": "string" - }, - "timestamp": { - "type": "integer", - "format": "int64" - }, - "token": { - "type": "string" - }, - "lastEditActorDisplayName": { - "type": "string" - }, - "lastEditActorId": { - "type": "string" - }, - "lastEditActorType": { - "type": "string" - }, - "lastEditTimestamp": { - "type": "integer", - "format": "int64" - }, - "silent": { - "type": "boolean" } - } + ] + }, + "ChatProxyMessage": { + "$ref": "#/components/schemas/BaseMessage" }, "FederationInvite": { "type": "object", @@ -766,52 +783,9 @@ "$ref": "#/components/schemas/ChatMessage" }, { - "$ref": "#/components/schemas/RoomProxyMessage" + "$ref": "#/components/schemas/ChatProxyMessage" } ] - }, - "RoomProxyMessage": { - "type": "object", - "required": [ - "actorDisplayName", - "actorId", - "actorType", - "expirationTimestamp", - "message", - "messageParameters", - "messageType", - "systemMessage" - ], - "properties": { - "actorDisplayName": { - "type": "string" - }, - "actorId": { - "type": "string" - }, - "actorType": { - "type": "string" - }, - "expirationTimestamp": { - "type": "integer", - "format": "int64" - }, - "message": { - "type": "string" - }, - "messageParameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/RichObjectParameter" - } - }, - "messageType": { - "type": "string" - }, - "systemMessage": { - "type": "string" - } - } } } }, diff --git a/openapi-full.json b/openapi-full.json index 8cc1e159c92..58607cae4aa 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -20,6 +20,49 @@ } }, "schemas": { + "BaseMessage": { + "type": "object", + "required": [ + "actorDisplayName", + "actorId", + "actorType", + "expirationTimestamp", + "message", + "messageParameters", + "messageType", + "systemMessage" + ], + "properties": { + "actorDisplayName": { + "type": "string" + }, + "actorId": { + "type": "string" + }, + "actorType": { + "type": "string" + }, + "expirationTimestamp": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + }, + "messageParameters": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RichObjectParameter" + } + }, + "messageType": { + "type": "string" + }, + "systemMessage": { + "type": "string" + } + } + }, "Bot": { "type": "object", "required": [ @@ -370,103 +413,74 @@ } }, "ChatMessage": { - "type": "object", - "required": [ - "actorDisplayName", - "actorId", - "actorType", - "expirationTimestamp", - "id", - "isReplyable", - "markdown", - "message", - "messageParameters", - "messageType", - "reactions", - "referenceId", - "systemMessage", - "timestamp", - "token" - ], - "properties": { - "actorDisplayName": { - "type": "string" - }, - "actorId": { - "type": "string" - }, - "actorType": { - "type": "string" - }, - "deleted": { - "type": "boolean", - "enum": [ - true - ] - }, - "expirationTimestamp": { - "type": "integer", - "format": "int64" - }, - "id": { - "type": "integer", - "format": "int64" - }, - "isReplyable": { - "type": "boolean" - }, - "markdown": { - "type": "boolean" - }, - "message": { - "type": "string" - }, - "messageParameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/RichObjectParameter" - } - }, - "messageType": { - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/BaseMessage" }, - "reactions": { + { "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int64" + "required": [ + "id", + "isReplyable", + "markdown", + "reactions", + "referenceId", + "timestamp", + "token" + ], + "properties": { + "deleted": { + "type": "boolean", + "enum": [ + true + ] + }, + "id": { + "type": "integer", + "format": "int64" + }, + "isReplyable": { + "type": "boolean" + }, + "markdown": { + "type": "boolean" + }, + "reactions": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" + } + }, + "referenceId": { + "type": "string" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "token": { + "type": "string" + }, + "lastEditActorDisplayName": { + "type": "string" + }, + "lastEditActorId": { + "type": "string" + }, + "lastEditActorType": { + "type": "string" + }, + "lastEditTimestamp": { + "type": "integer", + "format": "int64" + }, + "silent": { + "type": "boolean" + } } - }, - "referenceId": { - "type": "string" - }, - "systemMessage": { - "type": "string" - }, - "timestamp": { - "type": "integer", - "format": "int64" - }, - "token": { - "type": "string" - }, - "lastEditActorDisplayName": { - "type": "string" - }, - "lastEditActorId": { - "type": "string" - }, - "lastEditActorType": { - "type": "string" - }, - "lastEditTimestamp": { - "type": "integer", - "format": "int64" - }, - "silent": { - "type": "boolean" } - } + ] }, "ChatMessageWithParent": { "allOf": [ @@ -483,6 +497,9 @@ } ] }, + "ChatProxyMessage": { + "$ref": "#/components/schemas/BaseMessage" + }, "ChatReminder": { "type": "object", "required": [ @@ -1231,53 +1248,10 @@ "$ref": "#/components/schemas/ChatMessage" }, { - "$ref": "#/components/schemas/RoomProxyMessage" + "$ref": "#/components/schemas/ChatProxyMessage" } ] }, - "RoomProxyMessage": { - "type": "object", - "required": [ - "actorDisplayName", - "actorId", - "actorType", - "expirationTimestamp", - "message", - "messageParameters", - "messageType", - "systemMessage" - ], - "properties": { - "actorDisplayName": { - "type": "string" - }, - "actorId": { - "type": "string" - }, - "actorType": { - "type": "string" - }, - "expirationTimestamp": { - "type": "integer", - "format": "int64" - }, - "message": { - "type": "string" - }, - "messageParameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/RichObjectParameter" - } - }, - "messageType": { - "type": "string" - }, - "systemMessage": { - "type": "string" - } - } - }, "SignalingSession": { "type": "object", "required": [ diff --git a/openapi.json b/openapi.json index a352fd839b4..18c2abe4d49 100644 --- a/openapi.json +++ b/openapi.json @@ -20,6 +20,49 @@ } }, "schemas": { + "BaseMessage": { + "type": "object", + "required": [ + "actorDisplayName", + "actorId", + "actorType", + "expirationTimestamp", + "message", + "messageParameters", + "messageType", + "systemMessage" + ], + "properties": { + "actorDisplayName": { + "type": "string" + }, + "actorId": { + "type": "string" + }, + "actorType": { + "type": "string" + }, + "expirationTimestamp": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + }, + "messageParameters": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RichObjectParameter" + } + }, + "messageType": { + "type": "string" + }, + "systemMessage": { + "type": "string" + } + } + }, "Bot": { "type": "object", "required": [ @@ -311,103 +354,74 @@ } }, "ChatMessage": { - "type": "object", - "required": [ - "actorDisplayName", - "actorId", - "actorType", - "expirationTimestamp", - "id", - "isReplyable", - "markdown", - "message", - "messageParameters", - "messageType", - "reactions", - "referenceId", - "systemMessage", - "timestamp", - "token" - ], - "properties": { - "actorDisplayName": { - "type": "string" - }, - "actorId": { - "type": "string" - }, - "actorType": { - "type": "string" - }, - "deleted": { - "type": "boolean", - "enum": [ - true - ] - }, - "expirationTimestamp": { - "type": "integer", - "format": "int64" - }, - "id": { - "type": "integer", - "format": "int64" - }, - "isReplyable": { - "type": "boolean" - }, - "markdown": { - "type": "boolean" - }, - "message": { - "type": "string" - }, - "messageParameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/RichObjectParameter" - } - }, - "messageType": { - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/BaseMessage" }, - "reactions": { + { "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int64" + "required": [ + "id", + "isReplyable", + "markdown", + "reactions", + "referenceId", + "timestamp", + "token" + ], + "properties": { + "deleted": { + "type": "boolean", + "enum": [ + true + ] + }, + "id": { + "type": "integer", + "format": "int64" + }, + "isReplyable": { + "type": "boolean" + }, + "markdown": { + "type": "boolean" + }, + "reactions": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" + } + }, + "referenceId": { + "type": "string" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "token": { + "type": "string" + }, + "lastEditActorDisplayName": { + "type": "string" + }, + "lastEditActorId": { + "type": "string" + }, + "lastEditActorType": { + "type": "string" + }, + "lastEditTimestamp": { + "type": "integer", + "format": "int64" + }, + "silent": { + "type": "boolean" + } } - }, - "referenceId": { - "type": "string" - }, - "systemMessage": { - "type": "string" - }, - "timestamp": { - "type": "integer", - "format": "int64" - }, - "token": { - "type": "string" - }, - "lastEditActorDisplayName": { - "type": "string" - }, - "lastEditActorId": { - "type": "string" - }, - "lastEditActorType": { - "type": "string" - }, - "lastEditTimestamp": { - "type": "integer", - "format": "int64" - }, - "silent": { - "type": "boolean" } - } + ] }, "ChatMessageWithParent": { "allOf": [ @@ -424,6 +438,9 @@ } ] }, + "ChatProxyMessage": { + "$ref": "#/components/schemas/BaseMessage" + }, "ChatReminder": { "type": "object", "required": [ @@ -1118,53 +1135,10 @@ "$ref": "#/components/schemas/ChatMessage" }, { - "$ref": "#/components/schemas/RoomProxyMessage" + "$ref": "#/components/schemas/ChatProxyMessage" } ] }, - "RoomProxyMessage": { - "type": "object", - "required": [ - "actorDisplayName", - "actorId", - "actorType", - "expirationTimestamp", - "message", - "messageParameters", - "messageType", - "systemMessage" - ], - "properties": { - "actorDisplayName": { - "type": "string" - }, - "actorId": { - "type": "string" - }, - "actorType": { - "type": "string" - }, - "expirationTimestamp": { - "type": "integer", - "format": "int64" - }, - "message": { - "type": "string" - }, - "messageParameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/RichObjectParameter" - } - }, - "messageType": { - "type": "string" - }, - "systemMessage": { - "type": "string" - } - } - }, "SignalingSession": { "type": "object", "required": [ diff --git a/src/types/openapi/openapi-backend-sipbridge.ts b/src/types/openapi/openapi-backend-sipbridge.ts index f3e8913655b..9c84f364867 100644 --- a/src/types/openapi/openapi-backend-sipbridge.ts +++ b/src/types/openapi/openapi-backend-sipbridge.ts @@ -40,6 +40,19 @@ export type webhooks = Record; export type components = { schemas: { + BaseMessage: { + actorDisplayName: string; + actorId: string; + actorType: string; + /** Format: int64 */ + expirationTimestamp: number; + message: string; + messageParameters: { + [key: string]: components["schemas"]["RichObjectParameter"]; + }; + messageType: string; + systemMessage: string; + }; Capabilities: { features: string[]; config: { @@ -90,28 +103,17 @@ export type components = { }; version: string; }; - ChatMessage: { - actorDisplayName: string; - actorId: string; - actorType: string; + ChatMessage: components["schemas"]["BaseMessage"] & { /** @enum {boolean} */ deleted?: true; /** Format: int64 */ - expirationTimestamp: number; - /** Format: int64 */ id: number; isReplyable: boolean; markdown: boolean; - message: string; - messageParameters: { - [key: string]: components["schemas"]["RichObjectParameter"]; - }; - messageType: string; reactions: { [key: string]: number; }; referenceId: string; - systemMessage: string; /** Format: int64 */ timestamp: number; token: string; @@ -122,6 +124,7 @@ export type components = { lastEditTimestamp?: number; silent?: boolean; }; + ChatProxyMessage: components["schemas"]["BaseMessage"]; OCSMeta: { status: string; statuscode: number; @@ -246,20 +249,7 @@ export type components = { /** Format: int64 */ unreadMessages: number; }; - RoomLastMessage: components["schemas"]["ChatMessage"] | components["schemas"]["RoomProxyMessage"]; - RoomProxyMessage: { - actorDisplayName: string; - actorId: string; - actorType: string; - /** Format: int64 */ - expirationTimestamp: number; - message: string; - messageParameters: { - [key: string]: components["schemas"]["RichObjectParameter"]; - }; - messageType: string; - systemMessage: string; - }; + RoomLastMessage: components["schemas"]["ChatMessage"] | components["schemas"]["ChatProxyMessage"]; }; responses: never; parameters: never; diff --git a/src/types/openapi/openapi-federation.ts b/src/types/openapi/openapi-federation.ts index e971f60d30b..0cdcd9d8fca 100644 --- a/src/types/openapi/openapi-federation.ts +++ b/src/types/openapi/openapi-federation.ts @@ -55,6 +55,19 @@ export type webhooks = Record; export type components = { schemas: { + BaseMessage: { + actorDisplayName: string; + actorId: string; + actorType: string; + /** Format: int64 */ + expirationTimestamp: number; + message: string; + messageParameters: { + [key: string]: components["schemas"]["RichObjectParameter"]; + }; + messageType: string; + systemMessage: string; + }; Capabilities: { features: string[]; config: { @@ -105,28 +118,17 @@ export type components = { }; version: string; }; - ChatMessage: { - actorDisplayName: string; - actorId: string; - actorType: string; + ChatMessage: components["schemas"]["BaseMessage"] & { /** @enum {boolean} */ deleted?: true; /** Format: int64 */ - expirationTimestamp: number; - /** Format: int64 */ id: number; isReplyable: boolean; markdown: boolean; - message: string; - messageParameters: { - [key: string]: components["schemas"]["RichObjectParameter"]; - }; - messageType: string; reactions: { [key: string]: number; }; referenceId: string; - systemMessage: string; /** Format: int64 */ timestamp: number; token: string; @@ -137,6 +139,7 @@ export type components = { lastEditTimestamp?: number; silent?: boolean; }; + ChatProxyMessage: components["schemas"]["BaseMessage"]; FederationInvite: { /** Format: int64 */ id: number; @@ -277,20 +280,7 @@ export type components = { /** Format: int64 */ unreadMessages: number; }; - RoomLastMessage: components["schemas"]["ChatMessage"] | components["schemas"]["RoomProxyMessage"]; - RoomProxyMessage: { - actorDisplayName: string; - actorId: string; - actorType: string; - /** Format: int64 */ - expirationTimestamp: number; - message: string; - messageParameters: { - [key: string]: components["schemas"]["RichObjectParameter"]; - }; - messageType: string; - systemMessage: string; - }; + RoomLastMessage: components["schemas"]["ChatMessage"] | components["schemas"]["ChatProxyMessage"]; }; responses: never; parameters: never; diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index c785ed3c4e1..f090c1f7ec2 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -532,6 +532,19 @@ export type webhooks = Record; export type components = { schemas: { + BaseMessage: { + actorDisplayName: string; + actorId: string; + actorType: string; + /** Format: int64 */ + expirationTimestamp: number; + message: string; + messageParameters: { + [key: string]: components["schemas"]["RichObjectParameter"]; + }; + messageType: string; + systemMessage: string; + }; Bot: { description: string | null; /** Format: int64 */ @@ -624,28 +637,17 @@ export type components = { statusIcon: string | null; statusMessage: string | null; }; - ChatMessage: { - actorDisplayName: string; - actorId: string; - actorType: string; + ChatMessage: components["schemas"]["BaseMessage"] & { /** @enum {boolean} */ deleted?: true; /** Format: int64 */ - expirationTimestamp: number; - /** Format: int64 */ id: number; isReplyable: boolean; markdown: boolean; - message: string; - messageParameters: { - [key: string]: components["schemas"]["RichObjectParameter"]; - }; - messageType: string; reactions: { [key: string]: number; }; referenceId: string; - systemMessage: string; /** Format: int64 */ timestamp: number; token: string; @@ -659,6 +661,7 @@ export type components = { ChatMessageWithParent: components["schemas"]["ChatMessage"] & { parent?: components["schemas"]["ChatMessage"]; }; + ChatProxyMessage: components["schemas"]["BaseMessage"]; ChatReminder: { /** Format: int64 */ messageId: number; @@ -884,20 +887,7 @@ export type components = { /** Format: int64 */ unreadMessages: number; }; - RoomLastMessage: components["schemas"]["ChatMessage"] | components["schemas"]["RoomProxyMessage"]; - RoomProxyMessage: { - actorDisplayName: string; - actorId: string; - actorType: string; - /** Format: int64 */ - expirationTimestamp: number; - message: string; - messageParameters: { - [key: string]: components["schemas"]["RichObjectParameter"]; - }; - messageType: string; - systemMessage: string; - }; + RoomLastMessage: components["schemas"]["ChatMessage"] | components["schemas"]["ChatProxyMessage"]; SignalingSession: { /** Format: int64 */ inCall: number; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 4a6845fe3b7..26b91ed24ef 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -385,6 +385,19 @@ export type webhooks = Record; export type components = { schemas: { + BaseMessage: { + actorDisplayName: string; + actorId: string; + actorType: string; + /** Format: int64 */ + expirationTimestamp: number; + message: string; + messageParameters: { + [key: string]: components["schemas"]["RichObjectParameter"]; + }; + messageType: string; + systemMessage: string; + }; Bot: { description: string | null; /** Format: int64 */ @@ -463,28 +476,17 @@ export type components = { statusIcon: string | null; statusMessage: string | null; }; - ChatMessage: { - actorDisplayName: string; - actorId: string; - actorType: string; + ChatMessage: components["schemas"]["BaseMessage"] & { /** @enum {boolean} */ deleted?: true; /** Format: int64 */ - expirationTimestamp: number; - /** Format: int64 */ id: number; isReplyable: boolean; markdown: boolean; - message: string; - messageParameters: { - [key: string]: components["schemas"]["RichObjectParameter"]; - }; - messageType: string; reactions: { [key: string]: number; }; referenceId: string; - systemMessage: string; /** Format: int64 */ timestamp: number; token: string; @@ -498,6 +500,7 @@ export type components = { ChatMessageWithParent: components["schemas"]["ChatMessage"] & { parent?: components["schemas"]["ChatMessage"]; }; + ChatProxyMessage: components["schemas"]["BaseMessage"]; ChatReminder: { /** Format: int64 */ messageId: number; @@ -707,20 +710,7 @@ export type components = { /** Format: int64 */ unreadMessages: number; }; - RoomLastMessage: components["schemas"]["ChatMessage"] | components["schemas"]["RoomProxyMessage"]; - RoomProxyMessage: { - actorDisplayName: string; - actorId: string; - actorType: string; - /** Format: int64 */ - expirationTimestamp: number; - message: string; - messageParameters: { - [key: string]: components["schemas"]["RichObjectParameter"]; - }; - messageType: string; - systemMessage: string; - }; + RoomLastMessage: components["schemas"]["ChatMessage"] | components["schemas"]["ChatProxyMessage"]; SignalingSession: { /** Format: int64 */ inCall: number;