From cf55b16657ef3274acfac1e8f3224ef972881977 Mon Sep 17 00:00:00 2001 From: Lu Chen Date: Fri, 8 Oct 2021 13:28:51 -0700 Subject: [PATCH 1/2] export models from signaling client --- .../review/communication-chat.api.md | 23 +++++++++++++++ .../communication-chat/src/chatClient.ts | 28 +++++++++---------- .../communication-chat/src/index.ts | 1 + .../communication-chat/src/models/events.ts | 27 ++++++++++++++++++ 4 files changed, 65 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..d6b7c2aa5954 --- /dev/null +++ b/sdk/communication/communication-chat/src/models/events.ts @@ -0,0 +1,27 @@ +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 +}; From 6f54828bb773597d5a70d4fadd9cdbbf633c2458 Mon Sep 17 00:00:00 2001 From: Lu Chen Date: Fri, 8 Oct 2021 15:34:56 -0700 Subject: [PATCH 2/2] fix lint --- sdk/communication/communication-chat/src/models/events.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/communication/communication-chat/src/models/events.ts b/sdk/communication/communication-chat/src/models/events.ts index d6b7c2aa5954..46f0e4b51aa2 100644 --- a/sdk/communication/communication-chat/src/models/events.ts +++ b/sdk/communication/communication-chat/src/models/events.ts @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + import { ChatEventId, ChatMessageReceivedEvent,