From 00a7b48749b378332c8bd216628195214124aa49 Mon Sep 17 00:00:00 2001 From: Rafael Garcia Date: Sun, 14 May 2023 12:35:19 -0500 Subject: [PATCH] feat(labels): add label association types --- src/Types/LabelAssociation.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/Types/LabelAssociation.ts diff --git a/src/Types/LabelAssociation.ts b/src/Types/LabelAssociation.ts new file mode 100644 index 0000000..38c1c6d --- /dev/null +++ b/src/Types/LabelAssociation.ts @@ -0,0 +1,35 @@ +/** Association type */ +export enum LabelAssociationType { + Chat = 'label_jid', + Message = 'label_message' + } + + export type LabelAssociationTypes = `${LabelAssociationType}` + + /** Association for chat */ + export interface ChatLabelAssociation { + type: LabelAssociationType.Chat + chatId: string + labelId: string + } + + /** Association for message */ + export interface MessageLabelAssociation { + type: LabelAssociationType.Message + chatId: string + messageId: string + labelId: string + } + + export type LabelAssociation = ChatLabelAssociation | MessageLabelAssociation + + /** Body for add/remove chat label association action */ + export interface ChatLabelAssociationActionBody { + labelId: string + } + + /** body for add/remove message label association action */ + export interface MessageLabelAssociationActionBody { + labelId: string + messageId: string + } \ No newline at end of file