From 3e3c702608ea08a3f61d88cf9188645019dbcc8b Mon Sep 17 00:00:00 2001 From: luc <44377201+LuChen-Microsoft@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:03:43 -0700 Subject: [PATCH] export models from signaling client (#18105) * export models from signaling client * fix lint --- .../review/communication-chat.api.md | 23 ++++++++++++++ .../communication-chat/src/chatClient.ts | 28 ++++++++--------- .../communication-chat/src/index.ts | 1 + .../communication-chat/src/models/events.ts | 30 +++++++++++++++++++ 4 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 sdk/communication/communication-chat/src/models/events.ts diff --git a/sdk/communication/communication-chat/review/communication-chat.api.md b/sdk/communication/communication-chat/review/communication-chat.api.md index a90aac0aa73b..9e435ecf67be 100644 --- a/sdk/communication/communication-chat/review/communication-chat.api.md +++ b/sdk/communication/communication-chat/review/communication-chat.api.md @@ -6,6 +6,7 @@ /// +import { ChatEventId } from '@azure/communication-signaling'; import { ChatMessageDeletedEvent } from '@azure/communication-signaling'; import { ChatMessageEditedEvent } from '@azure/communication-signaling'; import { ChatMessageReceivedEvent } from '@azure/communication-signaling'; @@ -81,6 +82,8 @@ export interface ChatError { readonly target?: string; } +export { ChatEventId } + // @public export interface ChatMessage { content?: ChatMessageContent; @@ -104,6 +107,10 @@ export interface ChatMessageContent { topic?: string; } +export { ChatMessageDeletedEvent } + +export { ChatMessageEditedEvent } + // @public export interface ChatMessageReadReceipt { chatMessageId: string; @@ -111,6 +118,8 @@ export interface ChatMessageReadReceipt { sender: CommunicationIdentifierKind; } +export { ChatMessageReceivedEvent } + // @public export type ChatMessageType = "text" | "html" | "topicUpdated" | "participantAdded" | "participantRemoved"; @@ -144,6 +153,10 @@ export class ChatThreadClient { export interface ChatThreadClientOptions extends ChatClientOptions { } +export { ChatThreadCreatedEvent } + +export { ChatThreadDeletedEvent } + // @public export interface ChatThreadItem { deletedOn?: Date; @@ -161,6 +174,8 @@ export interface ChatThreadProperties { topic: string; } +export { ChatThreadPropertiesUpdatedEvent } + // @public export interface CreateChatThreadOptions extends OperationOptions { idempotencyToken?: string; @@ -207,6 +222,12 @@ export type ListParticipantsOptions = RestListParticipantsOptions; // @public export type ListReadReceiptsOptions = RestListReadReceiptsOptions; +export { ParticipantsAddedEvent } + +export { ParticipantsRemovedEvent } + +export { ReadReceiptReceivedEvent } + // @public export type RemoveParticipantOptions = OperationOptions; @@ -264,6 +285,8 @@ export interface SendTypingNotificationOptions extends OperationOptions { senderDisplayName?: string; } +export { TypingIndicatorReceivedEvent } + // @public export interface UpdateMessageOptions extends OperationOptions { content?: string; diff --git a/sdk/communication/communication-chat/src/chatClient.ts b/sdk/communication/communication-chat/src/chatClient.ts index d21165d9e190..40805ee41501 100644 --- a/sdk/communication/communication-chat/src/chatClient.ts +++ b/sdk/communication/communication-chat/src/chatClient.ts @@ -5,20 +5,6 @@ import { logger } from "./models/logger"; import { EventEmitter } from "events"; import { CommunicationTokenCredential } from "@azure/communication-common"; -import { - SignalingClient, - ChatEventId, - ChatMessageReceivedEvent, - ChatMessageEditedEvent, - ChatMessageDeletedEvent, - ReadReceiptReceivedEvent, - TypingIndicatorReceivedEvent, - ChatThreadCreatedEvent, - ChatThreadDeletedEvent, - ChatThreadPropertiesUpdatedEvent, - ParticipantsAddedEvent, - ParticipantsRemovedEvent -} from "@azure/communication-signaling"; import { getSignalingClient } from "./signaling/signalingClient"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { SpanStatusCode } from "@azure/core-tracing"; @@ -41,6 +27,20 @@ import { ChatApiClient } from "./generated/src"; import { CreateChatThreadRequest } from "./models/requests"; import { createCommunicationTokenCredentialPolicy } from "./credential/communicationTokenCredentialPolicy"; import { generateUuid } from "./models/uuid"; +import { SignalingClient } from "@azure/communication-signaling"; +import { + ChatEventId, + ChatMessageReceivedEvent, + ChatMessageEditedEvent, + ChatMessageDeletedEvent, + ReadReceiptReceivedEvent, + TypingIndicatorReceivedEvent, + ChatThreadCreatedEvent, + ChatThreadDeletedEvent, + ChatThreadPropertiesUpdatedEvent, + ParticipantsAddedEvent, + ParticipantsRemovedEvent +} from "./models/events"; /** * The client to do chat operations diff --git a/sdk/communication/communication-chat/src/index.ts b/sdk/communication/communication-chat/src/index.ts index 2c5aca8c954e..67aa1c8677b2 100644 --- a/sdk/communication/communication-chat/src/index.ts +++ b/sdk/communication/communication-chat/src/index.ts @@ -4,5 +4,6 @@ export * from "./models/options"; export * from "./models/requests"; export * from "./models/models"; +export * from "./models/events"; export * from "./chatClient"; export * from "./chatThreadClient"; diff --git a/sdk/communication/communication-chat/src/models/events.ts b/sdk/communication/communication-chat/src/models/events.ts new file mode 100644 index 000000000000..46f0e4b51aa2 --- /dev/null +++ b/sdk/communication/communication-chat/src/models/events.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + ChatEventId, + ChatMessageReceivedEvent, + ChatMessageEditedEvent, + ChatMessageDeletedEvent, + ReadReceiptReceivedEvent, + TypingIndicatorReceivedEvent, + ChatThreadCreatedEvent, + ChatThreadDeletedEvent, + ChatThreadPropertiesUpdatedEvent, + ParticipantsAddedEvent, + ParticipantsRemovedEvent +} from "@azure/communication-signaling"; + +export { + ChatEventId, + ChatMessageReceivedEvent, + ChatMessageEditedEvent, + ChatMessageDeletedEvent, + ReadReceiptReceivedEvent, + TypingIndicatorReceivedEvent, + ChatThreadCreatedEvent, + ChatThreadDeletedEvent, + ChatThreadPropertiesUpdatedEvent, + ParticipantsAddedEvent, + ParticipantsRemovedEvent +};