Skip to content

Commit 7286629

Browse files
[ACS][CallAutomation] Update common version and TeamsAppIdentifier (Azure#29563)
Adding Teams App Identifier to JS library Co-authored-by: Min Woo Lee 🧊 <[email protected]>
1 parent 0cb6b9b commit 7286629

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

sdk/communication/communication-call-automation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
},
7676
"dependencies": {
7777
"@azure/abort-controller": "^1.0.0",
78-
"@azure/communication-common": "^2.2.0",
78+
"@azure/communication-common": "^2.3.1",
7979
"@azure/core-auth": "^1.3.0",
8080
"@azure/core-client": "^1.3.0",
8181
"@azure/core-paging": "^1.1.1",

sdk/communication/communication-call-automation/review/communication-call-automation.api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { CommunicationIdentifier } from '@azure/communication-common';
1212
import { CommunicationUserIdentifier } from '@azure/communication-common';
1313
import * as coreClient from '@azure/core-client';
1414
import { KeyCredential } from '@azure/core-auth';
15+
import { MicrosoftTeamsAppIdentifier } from '@azure/communication-common';
1516
import { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';
1617
import { OperationOptions } from '@azure/core-client';
1718
import { PhoneNumberIdentifier } from '@azure/communication-common';
@@ -193,7 +194,7 @@ export interface CallInvite {
193194
readonly sourceCallIdNumber?: PhoneNumberIdentifier;
194195
// (undocumented)
195196
sourceDisplayName?: string;
196-
readonly targetParticipant: PhoneNumberIdentifier | CommunicationUserIdentifier | MicrosoftTeamsUserIdentifier;
197+
readonly targetParticipant: PhoneNumberIdentifier | CommunicationUserIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier;
197198
}
198199

199200
// @public

sdk/communication/communication-call-automation/src/models/models.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
CommunicationIdentifier,
66
CommunicationUserIdentifier,
77
MicrosoftTeamsUserIdentifier,
8+
MicrosoftTeamsAppIdentifier,
89
PhoneNumberIdentifier,
910
} from "@azure/communication-common";
1011
import { CallConnectionStateModel } from "../generated/src";
@@ -169,11 +170,12 @@ export enum RecognizeInputType {
169170

170171
/** Call invitee details. */
171172
export interface CallInvite {
172-
/** The Target's PhoneNumberIdentifier, CommunicationUserIdentifier or MicrosoftTeamsUserIdentifier. */
173+
/** The Target's PhoneNumberIdentifier, CommunicationUserIdentifier, MicrosoftTeamsUserIdentifier or MicrosoftTeamsAppIdentifier. */
173174
readonly targetParticipant:
174175
| PhoneNumberIdentifier
175176
| CommunicationUserIdentifier
176-
| MicrosoftTeamsUserIdentifier;
177+
| MicrosoftTeamsUserIdentifier
178+
| MicrosoftTeamsAppIdentifier;
177179
/** Caller's phone number identifier. */
178180
readonly sourceCallIdNumber?: PhoneNumberIdentifier;
179181
sourceDisplayName?: string;

sdk/communication/communication-call-automation/src/utli/converters.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import {
1414
SerializedCommunicationIdentifier,
1515
isMicrosoftTeamsUserIdentifier,
1616
MicrosoftTeamsUserIdentifier,
17+
isMicrosoftTeamsAppIdentifier,
18+
MicrosoftTeamsAppIdentifier,
1719
} from "@azure/communication-common";
1820
import {
1921
CallParticipantInternal,
@@ -113,6 +115,18 @@ export function communicationIdentifierConverter(
113115
return microsoftTeamsUserIdentifier;
114116
}
115117

118+
if (
119+
kind === KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp &&
120+
identifierModel.microsoftTeamsApp !== undefined
121+
) {
122+
const microsoftTeamsAppIdentifier: MicrosoftTeamsAppIdentifier = {
123+
rawId: rawId,
124+
teamsAppId: identifierModel.microsoftTeamsApp.appId,
125+
cloud: identifierModel.microsoftTeamsApp.cloud as KnownCommunicationCloudEnvironmentModel,
126+
};
127+
return microsoftTeamsAppIdentifier;
128+
}
129+
116130
const unknownIdentifier: UnknownIdentifier = {
117131
id: rawId ? rawId : "",
118132
};
@@ -149,6 +163,14 @@ export function communicationIdentifierModelConverter(
149163
return microsoftTeamsUserIdentifierModel;
150164
}
151165

166+
if (isMicrosoftTeamsAppIdentifier(identifier)) {
167+
const microsoftTeamsAppIdentifierModel: CommunicationIdentifierModel = {
168+
kind: KnownCommunicationIdentifierModelKind.MicrosoftTeamsApp,
169+
...serializedIdentifier,
170+
};
171+
return microsoftTeamsAppIdentifierModel;
172+
}
173+
152174
if (isUnknownIdentifier(identifier)) {
153175
const unknownIdentifierModel: CommunicationIdentifierModel = {
154176
kind: KnownCommunicationIdentifierModelKind.Unknown,

0 commit comments

Comments
 (0)