@azure/communication-common
Advanced tools
Comparing version 1.1.1-alpha.20211216.1 to 1.1.1-alpha.20220104.1
@@ -5,3 +5,3 @@ // Copyright (c) Microsoft Corporation. | ||
import { StaticTokenCredential } from "./staticTokenCredential"; | ||
import { AutoRefreshTokenCredential } from "./autoRefreshTokenCredential"; | ||
import { AutoRefreshTokenCredential, } from "./autoRefreshTokenCredential"; | ||
/** | ||
@@ -8,0 +8,0 @@ * The CommunicationTokenCredential implementation with support for proactive token refresh. |
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
import { URLBuilder, isNode, BaseRequestPolicy } from "@azure/core-http"; | ||
import { URLBuilder, isNode, BaseRequestPolicy, } from "@azure/core-http"; | ||
import { shaHash, shaHMAC } from "./cryptoUtils"; | ||
@@ -15,3 +15,3 @@ /** | ||
return new CommunicationAccessKeyCredentialPolicy(credential, nextpolicy, options); | ||
} | ||
}, | ||
}; | ||
@@ -18,0 +18,0 @@ }; |
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
import { createHash, createHmac } from "crypto"; | ||
export const shaHash = async (content) => createHash("sha256") | ||
.update(content) | ||
.digest("base64"); | ||
export const shaHash = async (content) => createHash("sha256").update(content).digest("base64"); | ||
export const shaHMAC = async (secret, content) => { | ||
const decodedSecret = Buffer.from(secret, "base64"); | ||
return createHmac("sha256", decodedSecret) | ||
.update(content) | ||
.digest("base64"); | ||
return createHmac("sha256", decodedSecret).update(content).digest("base64"); | ||
}; | ||
//# sourceMappingURL=cryptoUtils.js.map |
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
import { __rest } from "tslib"; | ||
import { getIdentifierKind } from "./identifierModels"; | ||
import { getIdentifierKind, } from "./identifierModels"; | ||
const addRawIdIfExisting = (identifier, rawId) => { | ||
@@ -41,4 +41,4 @@ return rawId === undefined ? identifier : Object.assign(Object.assign({}, identifier), { rawId: rawId }); | ||
isAnonymous: (_a = identifierKind.isAnonymous) !== null && _a !== void 0 ? _a : false, | ||
cloud: (_b = identifierKind.cloud) !== null && _b !== void 0 ? _b : "public" | ||
} | ||
cloud: (_b = identifierKind.cloud) !== null && _b !== void 0 ? _b : "public", | ||
}, | ||
}, identifierKind.rawId); | ||
@@ -62,3 +62,3 @@ case "unknown": | ||
kind: "communicationUser", | ||
communicationUserId: assertNotNullOrUndefined({ communicationUser }, "id") | ||
communicationUserId: assertNotNullOrUndefined({ communicationUser }, "id"), | ||
}; | ||
@@ -70,3 +70,3 @@ } | ||
phoneNumber: assertNotNullOrUndefined({ phoneNumber }, "value"), | ||
rawId: assertNotNullOrUndefined({ phoneNumber: serializedIdentifier }, "rawId") | ||
rawId: assertNotNullOrUndefined({ phoneNumber: serializedIdentifier }, "rawId"), | ||
}; | ||
@@ -80,3 +80,3 @@ } | ||
cloud: assertNotNullOrUndefined({ microsoftTeamsUser }, "cloud"), | ||
rawId: assertNotNullOrUndefined({ microsoftTeamsUser: serializedIdentifier }, "rawId") | ||
rawId: assertNotNullOrUndefined({ microsoftTeamsUser: serializedIdentifier }, "rawId"), | ||
}; | ||
@@ -86,5 +86,5 @@ } | ||
kind: "unknown", | ||
id: assertNotNullOrUndefined({ unknown: serializedIdentifier }, "rawId") | ||
id: assertNotNullOrUndefined({ unknown: serializedIdentifier }, "rawId"), | ||
}; | ||
}; | ||
//# sourceMappingURL=identifierModelSerializer.js.map |
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
export { AzureCommunicationTokenCredential } from "./communicationTokenCredential"; | ||
export { AzureCommunicationTokenCredential, } from "./communicationTokenCredential"; | ||
export * from "./credential"; | ||
@@ -5,0 +5,0 @@ export * from "./credential"; |
@@ -8,5 +8,5 @@ // Copyright (c) Microsoft Corporation. | ||
token, | ||
expiresOnTimestamp: exp * 1000 | ||
expiresOnTimestamp: exp * 1000, | ||
}; | ||
}; | ||
//# sourceMappingURL=tokenParser.js.map |
@@ -18,3 +18,3 @@ 'use strict'; | ||
token, | ||
expiresOnTimestamp: exp * 1000 | ||
expiresOnTimestamp: exp * 1000, | ||
}; | ||
@@ -164,10 +164,6 @@ }; | ||
// Copyright (c) Microsoft Corporation. | ||
const shaHash = async (content) => crypto.createHash("sha256") | ||
.update(content) | ||
.digest("base64"); | ||
const shaHash = async (content) => crypto.createHash("sha256").update(content).digest("base64"); | ||
const shaHMAC = async (secret, content) => { | ||
const decodedSecret = Buffer.from(secret, "base64"); | ||
return crypto.createHmac("sha256", decodedSecret) | ||
.update(content) | ||
.digest("base64"); | ||
return crypto.createHmac("sha256", decodedSecret).update(content).digest("base64"); | ||
}; | ||
@@ -186,3 +182,3 @@ | ||
return new CommunicationAccessKeyCredentialPolicy(credential, nextpolicy, options); | ||
} | ||
}, | ||
}; | ||
@@ -415,4 +411,4 @@ }; | ||
isAnonymous: (_a = identifierKind.isAnonymous) !== null && _a !== void 0 ? _a : false, | ||
cloud: (_b = identifierKind.cloud) !== null && _b !== void 0 ? _b : "public" | ||
} | ||
cloud: (_b = identifierKind.cloud) !== null && _b !== void 0 ? _b : "public", | ||
}, | ||
}, identifierKind.rawId); | ||
@@ -436,3 +432,3 @@ case "unknown": | ||
kind: "communicationUser", | ||
communicationUserId: assertNotNullOrUndefined({ communicationUser }, "id") | ||
communicationUserId: assertNotNullOrUndefined({ communicationUser }, "id"), | ||
}; | ||
@@ -444,3 +440,3 @@ } | ||
phoneNumber: assertNotNullOrUndefined({ phoneNumber }, "value"), | ||
rawId: assertNotNullOrUndefined({ phoneNumber: serializedIdentifier }, "rawId") | ||
rawId: assertNotNullOrUndefined({ phoneNumber: serializedIdentifier }, "rawId"), | ||
}; | ||
@@ -454,3 +450,3 @@ } | ||
cloud: assertNotNullOrUndefined({ microsoftTeamsUser }, "cloud"), | ||
rawId: assertNotNullOrUndefined({ microsoftTeamsUser: serializedIdentifier }, "rawId") | ||
rawId: assertNotNullOrUndefined({ microsoftTeamsUser: serializedIdentifier }, "rawId"), | ||
}; | ||
@@ -460,3 +456,3 @@ } | ||
kind: "unknown", | ||
id: assertNotNullOrUndefined({ unknown: serializedIdentifier }, "rawId") | ||
id: assertNotNullOrUndefined({ unknown: serializedIdentifier }, "rawId"), | ||
}; | ||
@@ -463,0 +459,0 @@ }; |
{ | ||
"name": "@azure/communication-common", | ||
"version": "1.1.1-alpha.20211216.1", | ||
"version": "1.1.1-alpha.20220104.1", | ||
"description": "Common package for Azure Communication services.", | ||
@@ -106,3 +106,3 @@ "sdk-type": "client", | ||
"nyc": "^15.0.0", | ||
"prettier": "^1.16.4", | ||
"prettier": "^2.5.1", | ||
"rimraf": "^3.0.0", | ||
@@ -109,0 +109,0 @@ "rollup-plugin-sourcemaps": "^0.4.2", |
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
147537
1306