From 1c0c2ba2e3af05cad06b9b93923a02a46b7b0351 Mon Sep 17 00:00:00 2001 From: Steven Lindsay Date: Wed, 9 Oct 2024 18:16:59 +0100 Subject: [PATCH] update the MessageAction fields. --- ably.d.ts | 14 +++++++------- src/common/lib/types/message.ts | 25 ++++++++++++------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ably.d.ts b/ably.d.ts index a60ca1024..0b2d31b9b 100644 --- a/ably.d.ts +++ b/ably.d.ts @@ -2457,34 +2457,34 @@ export enum MessageAction { /** * Message action has not been set. */ - MessageUnset = 'message_unset', + MESSAGE_UNSET = 'MESSAGE_UNSET', /** * Message action for a newly created message. */ - MessageCreate = 'message_create', + MESSAGE_CREATE = 'MESSAGE_CREATE', /** * Message action for an updated message. */ - MessageUpdate = 'message_update', + MESSAGE_UPDATE = 'MESSAGE_UPDATE', /** * Message action for a deleted message. */ - MessageDelete = 'message_delete', + MESSAGE_DELETE = 'MESSAGE_DELETE', /** * Message action for a newly created annotation. */ - MessageAnnotationCreate = 'message_annotation_create', + MESSAGE_ANNOTATION_CREATE = 'MESSAGE_ANNOTATION_CREATE', /** * Message action for a deleted annotation. */ - MessageAnnotationDelete = 'message_annotation_delete', + MESSAGE_ANNOTATION_DELETE = 'MESSAGE_ANNOTATION_DELETE', } /** * A message received from Ably. */ -export type InboundMessage = Message & Required>; +export type InboundMessage = Message & Required>; /** * Static utilities related to messages. diff --git a/src/common/lib/types/message.ts b/src/common/lib/types/message.ts index b13956728..3067e42b0 100644 --- a/src/common/lib/types/message.ts +++ b/src/common/lib/types/message.ts @@ -9,7 +9,6 @@ import * as API from '../../../../ably'; import { IUntypedCryptoStatic } from 'common/types/ICryptoStatic'; import { MsgPack } from 'common/types/msgpack'; - /** * Enum containing the different types of message actions. */ @@ -17,36 +16,36 @@ enum MessageAction { /** * Message action has not been set. */ - MessageUnset = 'MESSAGE_UNSET', + MESSAGE_UNSET = 'MESSAGE_UNSET', /** * Message action for a newly created message. */ - MessageCreate = 'MESSAGE_CREATE', + MESSAGE_CREATE = 'MESSAGE_CREATE', /** * Message action for an updated message. */ - MessageUpdate = 'MESSAGE_UPDATE', + MESSAGE_UPDATE = 'MESSAGE_UPDATE', /** * Message action for a deleted message. */ - MessageDelete = 'MESSAGE_DELETE', + MESSAGE_DELETE = 'MESSAGE_DELETE', /** * Message action for a newly created annotation. */ - AnnotationCreate = 'ANNOTATION_CREATE', + MESSAGE_ANNOTATION_CREATE = 'MESSAGE_ANNOTATION_CREATE', /** * Message action for a deleted annotation. */ - AnnotationDelete = 'ANNOTATION_DELETE', + MESSAGE_ANNOTATION_DELETE = 'MESSAGE_ANNOTATION_DELETE', } const MessageActionNumberMap: Record = { - 0: MessageAction.MessageUnset, - 1: MessageAction.MessageCreate, - 2: MessageAction.MessageUpdate, - 3: MessageAction.MessageDelete, - 4: MessageAction.AnnotationCreate, - 5: MessageAction.AnnotationDelete, + 0: MessageAction.MESSAGE_UNSET, + 1: MessageAction.MESSAGE_CREATE, + 2: MessageAction.MESSAGE_UPDATE, + 3: MessageAction.MESSAGE_DELETE, + 4: MessageAction.MESSAGE_ANNOTATION_CREATE, + 5: MessageAction.MESSAGE_ANNOTATION_DELETE, }; function getMessageAction(actionNumber: number): MessageAction {