@azure/communication-common
Advanced tools
Comparing version 2.1.1-alpha.20221020.2 to 2.2.0
@@ -63,2 +63,14 @@ // Copyright (c) Microsoft Corporation. | ||
}; | ||
const getKind = (serializedIdentifier) => { | ||
if (serializedIdentifier.communicationUser) { | ||
return "communicationUser"; | ||
} | ||
if (serializedIdentifier.phoneNumber) { | ||
return "phoneNumber"; | ||
} | ||
if (serializedIdentifier.microsoftTeamsUser) { | ||
return "microsoftTeamsUser"; | ||
} | ||
return "unknown"; | ||
}; | ||
/** | ||
@@ -70,5 +82,7 @@ * @hidden | ||
export const deserializeCommunicationIdentifier = (serializedIdentifier) => { | ||
var _a; | ||
assertMaximumOneNestedModel(serializedIdentifier); | ||
const { communicationUser, microsoftTeamsUser, phoneNumber } = serializedIdentifier; | ||
if (communicationUser) { | ||
const kind = (_a = serializedIdentifier.kind) !== null && _a !== void 0 ? _a : getKind(serializedIdentifier); | ||
if (kind === "communicationUser" && communicationUser) { | ||
return { | ||
@@ -79,3 +93,3 @@ kind: "communicationUser", | ||
} | ||
if (phoneNumber) { | ||
if (kind === "phoneNumber" && phoneNumber) { | ||
return { | ||
@@ -87,3 +101,3 @@ kind: "phoneNumber", | ||
} | ||
if (microsoftTeamsUser) { | ||
if (kind === "microsoftTeamsUser" && microsoftTeamsUser) { | ||
return { | ||
@@ -90,0 +104,0 @@ kind: "microsoftTeamsUser", |
@@ -509,2 +509,14 @@ 'use strict'; | ||
}; | ||
const getKind = (serializedIdentifier) => { | ||
if (serializedIdentifier.communicationUser) { | ||
return "communicationUser"; | ||
} | ||
if (serializedIdentifier.phoneNumber) { | ||
return "phoneNumber"; | ||
} | ||
if (serializedIdentifier.microsoftTeamsUser) { | ||
return "microsoftTeamsUser"; | ||
} | ||
return "unknown"; | ||
}; | ||
/** | ||
@@ -516,5 +528,7 @@ * @hidden | ||
const deserializeCommunicationIdentifier = (serializedIdentifier) => { | ||
var _a; | ||
assertMaximumOneNestedModel(serializedIdentifier); | ||
const { communicationUser, microsoftTeamsUser, phoneNumber } = serializedIdentifier; | ||
if (communicationUser) { | ||
const kind = (_a = serializedIdentifier.kind) !== null && _a !== void 0 ? _a : getKind(serializedIdentifier); | ||
if (kind === "communicationUser" && communicationUser) { | ||
return { | ||
@@ -525,3 +539,3 @@ kind: "communicationUser", | ||
} | ||
if (phoneNumber) { | ||
if (kind === "phoneNumber" && phoneNumber) { | ||
return { | ||
@@ -533,3 +547,3 @@ kind: "phoneNumber", | ||
} | ||
if (microsoftTeamsUser) { | ||
if (kind === "microsoftTeamsUser" && microsoftTeamsUser) { | ||
return { | ||
@@ -536,0 +550,0 @@ kind: "microsoftTeamsUser", |
{ | ||
"name": "@azure/communication-common", | ||
"version": "2.1.1-alpha.20221020.2", | ||
"version": "2.2.0", | ||
"description": "Common package for Azure Communication services.", | ||
@@ -75,4 +75,4 @@ "sdk-type": "client", | ||
"devDependencies": { | ||
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb", | ||
"@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb", | ||
"@azure/eslint-plugin-azure-sdk": "^3.0.0", | ||
"@azure/dev-tool": "^1.0.0", | ||
"@microsoft/api-extractor": "^7.31.1", | ||
@@ -79,0 +79,0 @@ "@types/chai-as-promised": "^7.1.0", |
@@ -297,2 +297,6 @@ import { AbortSignalLike } from '@azure/abort-controller'; | ||
/** | ||
* Kind of the identifier, optional. | ||
*/ | ||
kind?: string; | ||
/** | ||
* Raw Id of the identifier. Optional in requests, required in responses. | ||
@@ -299,0 +303,0 @@ */ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
169144
1528
0