@azure/communication-chat
Advanced tools
Comparing version 1.0.0-alpha.20201218.1 to 1.0.0-alpha.20201223.1
@@ -5,3 +5,7 @@ # Release History | ||
### Breaking Changes | ||
- Replaced `CommunicationUser` with `CommunicationUserIdentifier`. | ||
- Replaced `CommunicationUserCredential` with `CommunicationTokenCredential`. | ||
## 1.0.0-beta.3 (2020-11-16) | ||
@@ -8,0 +12,0 @@ |
@@ -9,3 +9,3 @@ // Copyright (c) Microsoft Corporation. | ||
import { getSignalingClient } from "./signaling/signalingClient"; | ||
import { createCommunicationUserCredentialPolicy } from "./credential/communicationUserCredentialPolicy"; | ||
import { createCommunicationTokenCredentialPolicy } from "./credential/communicationTokenCredentialPolicy"; | ||
import { ChatApiClient } from "./generated/src/chatApiClient"; | ||
@@ -26,3 +26,3 @@ import { createPipelineFromOptions, operationOptionsToRequestOptionsBase } from "@azure/core-http"; | ||
* @param url The url of the Communication Services resouce. | ||
* @param credential The user credential. Use AzureCommunicationUserCredential from @azure/communication-common to create a credential. | ||
* @param credential The token credential. Use AzureCommunicationTokenCredential from @azure/communication-common to create a credential. | ||
* @param options Additional client options. | ||
@@ -53,3 +53,3 @@ */ | ||
}); | ||
const authPolicy = createCommunicationUserCredentialPolicy(this.tokenCredential); | ||
const authPolicy = createCommunicationTokenCredentialPolicy(this.tokenCredential); | ||
const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); | ||
@@ -56,0 +56,0 @@ this.api = new ChatApiClient(this.url, pipeline); |
@@ -6,3 +6,3 @@ // Copyright (c) Microsoft Corporation. | ||
import { SDK_VERSION } from "./constants"; | ||
import { createCommunicationUserCredentialPolicy } from "./credential/communicationUserCredentialPolicy"; | ||
import { createCommunicationTokenCredentialPolicy } from "./credential/communicationTokenCredentialPolicy"; | ||
import { ChatApiClient } from "./generated/src/chatApiClient"; | ||
@@ -40,3 +40,3 @@ import { createPipelineFromOptions, operationOptionsToRequestOptionsBase } from "@azure/core-http"; | ||
}); | ||
const authPolicy = createCommunicationUserCredentialPolicy(this.tokenCredential); | ||
const authPolicy = createCommunicationTokenCredentialPolicy(this.tokenCredential); | ||
const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); | ||
@@ -43,0 +43,0 @@ this.api = new ChatApiClient(this.url, pipeline); |
{ | ||
"name": "@azure/communication-chat", | ||
"version": "1.0.0-alpha.20201218.1", | ||
"version": "1.0.0-alpha.20201223.1", | ||
"description": "Azure client library for Azure Communication Chat services", | ||
@@ -5,0 +5,0 @@ "sdk-type": "client", |
@@ -41,3 +41,3 @@ # Azure Communication Chat client library for JavaScript | ||
import { ChatClient } from '@azure/communication-chat'; | ||
import { AzureCommunicationUserCredential } from "@azure/communication-common"; | ||
import { AzureCommunicationTokenCredential } from "@azure/communication-common"; | ||
@@ -47,4 +47,4 @@ // Your unique Azure Communication service endpoint | ||
let userAccessToken = '<USER_ACCESS_TOKEN>'; | ||
let userCredential = new AzureCommunicationUserCredential(userAccessToken); | ||
let chatClient = new ChatClient(endpointUrl, userCredential); | ||
let tokenCredential = new AzureCommunicationTokenCredential(userAccessToken); | ||
let chatClient = new ChatClient(endpointUrl, tokenCredential); | ||
@@ -51,0 +51,0 @@ ``` |
@@ -8,3 +8,3 @@ // Copyright (c) Microsoft Corporation. | ||
import { SDK_VERSION } from "./constants"; | ||
import { CommunicationUserCredential } from "@azure/communication-common"; | ||
import { CommunicationTokenCredential } from "@azure/communication-common"; | ||
import { | ||
@@ -20,3 +20,3 @@ SignalingClient, | ||
import { getSignalingClient } from "./signaling/signalingClient"; | ||
import { createCommunicationUserCredentialPolicy } from "./credential/communicationUserCredentialPolicy"; | ||
import { createCommunicationTokenCredentialPolicy } from "./credential/communicationTokenCredentialPolicy"; | ||
import { ChatApiClient } from "./generated/src/chatApiClient"; | ||
@@ -55,3 +55,3 @@ import { | ||
export class ChatClient { | ||
private readonly tokenCredential: CommunicationUserCredential; | ||
private readonly tokenCredential: CommunicationTokenCredential; | ||
private readonly clientOptions: ChatClientOptions; | ||
@@ -67,3 +67,3 @@ private readonly api: ChatApiClient; | ||
* @param url The url of the Communication Services resouce. | ||
* @param credential The user credential. Use AzureCommunicationUserCredential from @azure/communication-common to create a credential. | ||
* @param credential The token credential. Use AzureCommunicationTokenCredential from @azure/communication-common to create a credential. | ||
* @param options Additional client options. | ||
@@ -73,3 +73,3 @@ */ | ||
private readonly url: string, | ||
credential: CommunicationUserCredential, | ||
credential: CommunicationTokenCredential, | ||
options: ChatClientOptions = {} | ||
@@ -102,3 +102,3 @@ ) { | ||
const authPolicy = createCommunicationUserCredentialPolicy(this.tokenCredential); | ||
const authPolicy = createCommunicationTokenCredentialPolicy(this.tokenCredential); | ||
const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); | ||
@@ -105,0 +105,0 @@ |
@@ -6,4 +6,7 @@ // Copyright (c) Microsoft Corporation. | ||
import { SDK_VERSION } from "./constants"; | ||
import { CommunicationUser, CommunicationUserCredential } from "@azure/communication-common"; | ||
import { createCommunicationUserCredentialPolicy } from "./credential/communicationUserCredentialPolicy"; | ||
import { | ||
CommunicationUserIdentifier, | ||
CommunicationTokenCredential | ||
} from "@azure/communication-common"; | ||
import { createCommunicationTokenCredentialPolicy } from "./credential/communicationTokenCredentialPolicy"; | ||
import { ChatApiClient } from "./generated/src/chatApiClient"; | ||
@@ -65,3 +68,3 @@ import { | ||
private readonly tokenCredential: CommunicationUserCredential; | ||
private readonly tokenCredential: CommunicationTokenCredential; | ||
private readonly api: ChatApiClient; | ||
@@ -75,3 +78,3 @@ private disposed = false; | ||
private readonly url: string, | ||
credential: CommunicationUserCredential, | ||
credential: CommunicationTokenCredential, | ||
options: ChatThreadClientOptions = {} | ||
@@ -104,3 +107,3 @@ ) { | ||
const authPolicy = createCommunicationUserCredentialPolicy(this.tokenCredential); | ||
const authPolicy = createCommunicationTokenCredentialPolicy(this.tokenCredential); | ||
const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); | ||
@@ -428,3 +431,3 @@ | ||
public async removeMember( | ||
member: CommunicationUser, | ||
member: CommunicationUserIdentifier, | ||
options: RemoveMemberOptions = {} | ||
@@ -431,0 +434,0 @@ ): Promise<OperationResponse> { |
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
import { CommunicationUser } from "@azure/communication-common"; | ||
import { CommunicationUserIdentifier } from "@azure/communication-common"; | ||
import { HttpResponse } from "@azure/core-http"; | ||
@@ -29,3 +29,3 @@ import { | ||
*/ | ||
sender?: CommunicationUser; | ||
sender?: CommunicationUserIdentifier; | ||
} | ||
@@ -40,3 +40,3 @@ | ||
*/ | ||
readonly createdBy?: CommunicationUser; | ||
readonly createdBy?: CommunicationUserIdentifier; | ||
/** | ||
@@ -55,3 +55,3 @@ * Chat thread members. | ||
*/ | ||
user: CommunicationUser; | ||
user: CommunicationUserIdentifier; | ||
} | ||
@@ -66,3 +66,3 @@ | ||
*/ | ||
readonly sender?: CommunicationUser; | ||
readonly sender?: CommunicationUserIdentifier; | ||
} | ||
@@ -69,0 +69,0 @@ |
@@ -5,7 +5,7 @@ // Copyright (c) Microsoft Corporation. | ||
import { CommunicationSignalingClient, SignalingClient } from "@azure/communication-signaling"; | ||
import { CommunicationUserCredential } from "@azure/communication-common"; | ||
import { CommunicationTokenCredential } from "@azure/communication-common"; | ||
import { AzureLogger } from "@azure/logger"; | ||
export const getSignalingClient = ( | ||
credential: CommunicationUserCredential, | ||
credential: CommunicationTokenCredential, | ||
logger: AzureLogger | ||
@@ -12,0 +12,0 @@ ): SignalingClient | undefined => { |
@@ -5,7 +5,7 @@ // Copyright (c) Microsoft Corporation. | ||
import { SignalingClient } from "@azure/communication-signaling"; | ||
import { CommunicationUserCredential } from "@azure/communication-common"; | ||
import { CommunicationTokenCredential } from "@azure/communication-common"; | ||
import { AzureLogger } from "@azure/logger"; | ||
export const getSignalingClient = ( | ||
_credential: CommunicationUserCredential, | ||
_credential: CommunicationTokenCredential, | ||
_logger: AzureLogger | ||
@@ -12,0 +12,0 @@ ): SignalingClient | undefined => { |
@@ -5,4 +5,4 @@ /// <reference lib="esnext.asynciterable" /> | ||
import { ChatMessageReceivedEvent } from '@azure/communication-signaling'; | ||
import { CommunicationUser } from '@azure/communication-common'; | ||
import { CommunicationUserCredential } from '@azure/communication-common'; | ||
import { CommunicationTokenCredential } from '@azure/communication-common'; | ||
import { CommunicationUserIdentifier } from '@azure/communication-common'; | ||
import * as coreHttp from '@azure/core-http'; | ||
@@ -46,6 +46,6 @@ import { HttpResponse } from '@azure/core-http'; | ||
* @param url The url of the Communication Services resouce. | ||
* @param credential The user credential. Use AzureCommunicationUserCredential from @azure/communication-common to create a credential. | ||
* @param credential The token credential. Use AzureCommunicationTokenCredential from @azure/communication-common to create a credential. | ||
* @param options Additional client options. | ||
*/ | ||
constructor(url: string, credential: CommunicationUserCredential, options?: ChatClientOptions); | ||
constructor(url: string, credential: CommunicationTokenCredential, options?: ChatClientOptions); | ||
/** | ||
@@ -174,3 +174,3 @@ * Returns ChatThreadClient with the specific thread id. | ||
*/ | ||
sender?: CommunicationUser; | ||
sender?: CommunicationUserIdentifier; | ||
} | ||
@@ -190,3 +190,3 @@ | ||
*/ | ||
readonly createdBy?: CommunicationUser; | ||
readonly createdBy?: CommunicationUserIdentifier; | ||
/** | ||
@@ -211,3 +211,3 @@ * Chat thread members. | ||
private timeOfLastTypingRequest; | ||
constructor(threadId: string, url: string, credential: CommunicationUserCredential, options?: ChatThreadClientOptions); | ||
constructor(threadId: string, url: string, credential: CommunicationTokenCredential, options?: ChatThreadClientOptions); | ||
/** | ||
@@ -271,3 +271,3 @@ * Updates a thread's properties. | ||
*/ | ||
removeMember(member: CommunicationUser, options?: RemoveMemberOptions): Promise<OperationResponse>; | ||
removeMember(member: CommunicationUserIdentifier, options?: RemoveMemberOptions): Promise<OperationResponse>; | ||
/** | ||
@@ -334,3 +334,3 @@ * Sends a typing notification to the thread. | ||
*/ | ||
user: CommunicationUser; | ||
user: CommunicationUserIdentifier; | ||
} | ||
@@ -431,3 +431,3 @@ | ||
*/ | ||
readonly sender?: CommunicationUser; | ||
readonly sender?: CommunicationUserIdentifier; | ||
} | ||
@@ -434,0 +434,0 @@ |
/// <reference lib="esnext.asynciterable" /> | ||
import { CommunicationUserCredential } from "@azure/communication-common"; | ||
import { CommunicationTokenCredential } from "@azure/communication-common"; | ||
import { ChatMessageReceivedEvent, ChatMessageEditedEvent, ChatMessageDeletedEvent, ReadReceiptReceivedEvent, TypingIndicatorReceivedEvent } from "@azure/communication-signaling"; | ||
@@ -27,6 +27,6 @@ import "@azure/core-paging"; | ||
* @param url The url of the Communication Services resouce. | ||
* @param credential The user credential. Use AzureCommunicationUserCredential from @azure/communication-common to create a credential. | ||
* @param credential The token credential. Use AzureCommunicationTokenCredential from @azure/communication-common to create a credential. | ||
* @param options Additional client options. | ||
*/ | ||
constructor(url: string, credential: CommunicationUserCredential, options?: ChatClientOptions); | ||
constructor(url: string, credential: CommunicationTokenCredential, options?: ChatClientOptions); | ||
/** | ||
@@ -33,0 +33,0 @@ * Returns ChatThreadClient with the specific thread id. |
@@ -1,2 +0,2 @@ | ||
import { CommunicationUser, CommunicationUserCredential } from "@azure/communication-common"; | ||
import { CommunicationUserIdentifier, CommunicationTokenCredential } from "@azure/communication-common"; | ||
import { PagedAsyncIterableIterator } from "@azure/core-paging"; | ||
@@ -22,3 +22,3 @@ import { SendMessageRequest, AddMembersRequest } from "./models/requests"; | ||
private timeOfLastTypingRequest; | ||
constructor(threadId: string, url: string, credential: CommunicationUserCredential, options?: ChatThreadClientOptions); | ||
constructor(threadId: string, url: string, credential: CommunicationTokenCredential, options?: ChatThreadClientOptions); | ||
/** | ||
@@ -82,3 +82,3 @@ * Updates a thread's properties. | ||
*/ | ||
removeMember(member: CommunicationUser, options?: RemoveMemberOptions): Promise<OperationResponse>; | ||
removeMember(member: CommunicationUserIdentifier, options?: RemoveMemberOptions): Promise<OperationResponse>; | ||
/** | ||
@@ -85,0 +85,0 @@ * Sends a typing notification to the thread. |
@@ -1,2 +0,2 @@ | ||
import { CommunicationUser } from "@azure/communication-common"; | ||
import { CommunicationUserIdentifier } from "@azure/communication-common"; | ||
import { HttpResponse } from "@azure/core-http"; | ||
@@ -12,3 +12,3 @@ import { SendChatMessageResult, ChatMessage as RestChatMessage, ChatThread as RestChatThread, ChatThreadMember as RestChatThreadMember, ReadReceipt as RestReadReceipt } from "../generated/src/models"; | ||
*/ | ||
sender?: CommunicationUser; | ||
sender?: CommunicationUserIdentifier; | ||
} | ||
@@ -22,3 +22,3 @@ /** | ||
*/ | ||
readonly createdBy?: CommunicationUser; | ||
readonly createdBy?: CommunicationUserIdentifier; | ||
/** | ||
@@ -36,3 +36,3 @@ * Chat thread members. | ||
*/ | ||
user: CommunicationUser; | ||
user: CommunicationUserIdentifier; | ||
} | ||
@@ -46,3 +46,3 @@ /** | ||
*/ | ||
readonly sender?: CommunicationUser; | ||
readonly sender?: CommunicationUserIdentifier; | ||
} | ||
@@ -49,0 +49,0 @@ /** |
import { SignalingClient } from "@azure/communication-signaling"; | ||
import { CommunicationUserCredential } from "@azure/communication-common"; | ||
import { CommunicationTokenCredential } from "@azure/communication-common"; | ||
import { AzureLogger } from "@azure/logger"; | ||
export declare const getSignalingClient: (credential: CommunicationUserCredential, logger: AzureLogger) => SignalingClient | undefined; | ||
export declare const getSignalingClient: (credential: CommunicationTokenCredential, logger: AzureLogger) => SignalingClient | undefined; | ||
//# sourceMappingURL=signalingClient.browser.d.ts.map |
import { SignalingClient } from "@azure/communication-signaling"; | ||
import { CommunicationUserCredential } from "@azure/communication-common"; | ||
import { CommunicationTokenCredential } from "@azure/communication-common"; | ||
import { AzureLogger } from "@azure/logger"; | ||
export declare const getSignalingClient: (_credential: CommunicationUserCredential, _logger: AzureLogger) => SignalingClient | undefined; | ||
export declare const getSignalingClient: (_credential: CommunicationTokenCredential, _logger: AzureLogger) => SignalingClient | undefined; | ||
//# sourceMappingURL=signalingClient.d.ts.map |
import { Context } from "mocha"; | ||
import { Recorder, RecorderEnvironmentSetup } from "@azure/test-utils-recorder"; | ||
import { ChatClient } from "../../src"; | ||
import { CommunicationUser } from "@azure/communication-common"; | ||
import { CommunicationUserIdentifier } from "@azure/communication-common"; | ||
import { CommunicationUserToken } from "@azure/communication-administration"; | ||
@@ -12,5 +12,5 @@ export interface RecordedClient { | ||
export declare function createTestUser(): Promise<CommunicationUserToken>; | ||
export declare function deleteTestUser(testUser: CommunicationUser): Promise<void>; | ||
export declare function deleteTestUser(testUser: CommunicationUserIdentifier): Promise<void>; | ||
export declare function createRecorder(context: Context): Recorder; | ||
export declare function createChatClient(userToken: string): ChatClient; | ||
//# sourceMappingURL=recordedClient.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
673036
10283