Socket
Socket
Sign inDemoInstall

@azure/communication-common

Package Overview
Dependencies
Maintainers
3
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/communication-common - npm Package Compare versions

Comparing version 1.0.0-alpha.20210301.1 to 1.0.0-alpha.20210303.1

2

CHANGELOG.md

@@ -5,3 +5,2 @@ # Release History

## 1.0.0-beta.5 (2021-02-09)

@@ -15,2 +14,3 @@

- Renamed `id` to `rawId` in `MicrosoftTeamsUserIdentifier`.
- Replaced `abortSignal?` argument in `CommunicationTokenCredential.getToken` with `options?: CommunicationGetTokenOptions`.

@@ -17,0 +17,0 @@ ## 1.0.0-beta.4 (2021-01-25)

@@ -22,3 +22,3 @@ // Copyright (c) Microsoft Corporation.

}
getToken(abortSignal) {
getToken(options) {
return __awaiter(this, void 0, void 0, function* () {

@@ -28,3 +28,3 @@ if (!this.isCurrentTokenExpiringSoon) {

}
const updatePromise = this.updateTokenAndReschedule(abortSignal);
const updatePromise = this.updateTokenAndReschedule(options === null || options === void 0 ? void 0 : options.abortSignal);
if (!this.isCurrentTokenValid) {

@@ -31,0 +31,0 @@ yield updatePromise;

@@ -24,6 +24,6 @@ // Copyright (c) Microsoft Corporation.

*/
getToken(abortSignal) {
getToken(options) {
return __awaiter(this, void 0, void 0, function* () {
this.throwIfDisposed();
const token = yield this.tokenCredential.getToken(abortSignal);
const token = yield this.tokenCredential.getToken(options);
this.throwIfDisposed();

@@ -30,0 +30,0 @@ return token;

@@ -32,2 +32,3 @@ // Copyright (c) Microsoft Corporation.

* Parses arguments passed to a communication client.
* @hidden
*/

@@ -34,0 +35,0 @@ export const parseClientArguments = (connectionStringOrUrl, credentialOrOptions) => {

@@ -7,6 +7,6 @@ // Copyright (c) Microsoft Corporation.

/**
* Creates an HTTP pipeline policy to authenticate a request
* using an `KeyCredential`
* Creates an HTTP pipeline policy to authenticate a request using a `KeyCredential`.
* @hidden
*
* @param credential - The key credential
* @param credential - The key credential.
*/

@@ -13,0 +13,0 @@ export const createCommunicationAccessKeyCredentialPolicy = (credential) => {

@@ -8,5 +8,6 @@ // Copyright (c) Microsoft Corporation.

* Creates a pipeline policy to authenticate request based
* on the credential passed in
* on the credential passed in.
* @hidden
*
* @param credential - The key credential
* @param credential - The KeyCredential or TokenCredential.
*/

@@ -13,0 +14,0 @@ export const createCommunicationAuthPolicy = (credential) => {

@@ -14,3 +14,4 @@ // Copyright (c) Microsoft Corporation.

/**
* Returns an EndpointCredential to easily access properties of the connection string
* Returns an EndpointCredential to easily access properties of the connection string.
* @hidden
*

@@ -17,0 +18,0 @@ * @param connectionString - The connection string to parse

@@ -17,3 +17,3 @@ // Copyright (c) Microsoft Corporation.

const assertMaximumOneNestedModel = (identifier) => {
const { rawId } = identifier, props = __rest(identifier, ["rawId"]);
const { rawId: _rawId } = identifier, props = __rest(identifier, ["rawId"]);
const keys = Object.keys(props);

@@ -25,7 +25,7 @@ if (keys.length > 1) {

/**
* @internal
* @hidden
* Translates a CommunicationIdentifier to its serialized format for sending a request.
* @param identifier - The CommunicationIdentifier to be serialized.
*/
export const _serializeCommunicationIdentifier = (identifier) => {
export const serializeCommunicationIdentifier = (identifier) => {
var _a, _b;

@@ -53,7 +53,7 @@ const identifierKind = getIdentifierKind(identifier);

/**
* @internal
* @hidden
* Translates the serialized format of a communication identifier to CommunicationIdentifier.
* @param serializedIdentifier - The SerializedCommunicationIdentifier to be deserialized.
*/
export const _deserializeCommunicationIdentifier = (serializedIdentifier) => {
export const deserializeCommunicationIdentifier = (serializedIdentifier) => {
assertMaximumOneNestedModel(serializedIdentifier);

@@ -60,0 +60,0 @@ const { communicationUser, microsoftTeamsUser, phoneNumber } = serializedIdentifier;

@@ -5,4 +5,5 @@ // Copyright (c) Microsoft Corporation.

export * from "./credential";
export * from "./credential";
export * from "./identifierModels";
export * from "./identifierModelSerializer";
//# sourceMappingURL=index.js.map

@@ -58,3 +58,3 @@ 'use strict';

}
getToken(abortSignal) {
getToken(options) {
return tslib.__awaiter(this, void 0, void 0, function* () {

@@ -64,3 +64,3 @@ if (!this.isCurrentTokenExpiringSoon) {

}
const updatePromise = this.updateTokenAndReschedule(abortSignal);
const updatePromise = this.updateTokenAndReschedule(options === null || options === void 0 ? void 0 : options.abortSignal);
if (!this.isCurrentTokenValid) {

@@ -153,6 +153,6 @@ yield updatePromise;

*/
getToken(abortSignal) {
getToken(options) {
return tslib.__awaiter(this, void 0, void 0, function* () {
this.throwIfDisposed();
const token = yield this.tokenCredential.getToken(abortSignal);
const token = yield this.tokenCredential.getToken(options);
this.throwIfDisposed();

@@ -191,6 +191,6 @@ return token;

/**
* Creates an HTTP pipeline policy to authenticate a request
* using an `KeyCredential`
* Creates an HTTP pipeline policy to authenticate a request using a `KeyCredential`.
* @hidden
*
* @param credential - The key credential
* @param credential - The key credential.
*/

@@ -262,5 +262,6 @@ const createCommunicationAccessKeyCredentialPolicy = (credential) => {

* Creates a pipeline policy to authenticate request based
* on the credential passed in
* on the credential passed in.
* @hidden
*
* @param credential - The key credential
* @param credential - The KeyCredential or TokenCredential.
*/

@@ -287,3 +288,4 @@ const createCommunicationAuthPolicy = (credential) => {

/**
* Returns an EndpointCredential to easily access properties of the connection string
* Returns an EndpointCredential to easily access properties of the connection string.
* @hidden
*

@@ -330,2 +332,3 @@ * @param connectionString - The connection string to parse

* Parses arguments passed to a communication client.
* @hidden
*/

@@ -416,7 +419,7 @@ const parseClientArguments = (connectionStringOrUrl, credentialOrOptions) => {

/**
* @internal
* @hidden
* Translates a CommunicationIdentifier to its serialized format for sending a request.
* @param identifier - The CommunicationIdentifier to be serialized.
*/
const _serializeCommunicationIdentifier = (identifier) => {
const serializeCommunicationIdentifier = (identifier) => {
var _a, _b;

@@ -444,7 +447,7 @@ const identifierKind = getIdentifierKind(identifier);

/**
* @internal
* @hidden
* Translates the serialized format of a communication identifier to CommunicationIdentifier.
* @param serializedIdentifier - The SerializedCommunicationIdentifier to be deserialized.
*/
const _deserializeCommunicationIdentifier = (serializedIdentifier) => {
const deserializeCommunicationIdentifier = (serializedIdentifier) => {
assertMaximumOneNestedModel(serializedIdentifier);

@@ -481,6 +484,5 @@ const { communicationUser, microsoftTeamsUser, phoneNumber } = serializedIdentifier;

exports.AzureCommunicationTokenCredential = AzureCommunicationTokenCredential;
exports._deserializeCommunicationIdentifier = _deserializeCommunicationIdentifier;
exports._serializeCommunicationIdentifier = _serializeCommunicationIdentifier;
exports.createCommunicationAccessKeyCredentialPolicy = createCommunicationAccessKeyCredentialPolicy;
exports.createCommunicationAuthPolicy = createCommunicationAuthPolicy;
exports.deserializeCommunicationIdentifier = deserializeCommunicationIdentifier;
exports.getIdentifierKind = getIdentifierKind;

@@ -494,2 +496,3 @@ exports.isCommunicationUserIdentifier = isCommunicationUserIdentifier;

exports.parseConnectionString = parseConnectionString;
exports.serializeCommunicationIdentifier = serializeCommunicationIdentifier;
//# sourceMappingURL=index.js.map
{
"name": "@azure/communication-common",
"version": "1.0.0-alpha.20210301.1",
"version": "1.0.0-alpha.20210303.1",
"description": "Common package for Azure Communication services.",

@@ -5,0 +5,0 @@ "sdk-type": "client",

@@ -28,3 +28,3 @@ import { AbortSignalLike } from '@azure/core-http';

*/
getToken(abortSignal?: AbortSignalLike): Promise<AccessToken>;
getToken(options?: CommunicationGetTokenOptions): Promise<AccessToken>;
/**

@@ -38,2 +38,12 @@ * Disposes the CommunicationTokenCredential and cancels any internal auto-refresh operation.

/**
* Options for `CommunicationTokenCredential`'s `getToken` function.
*/
export declare interface CommunicationGetTokenOptions {
/**
* An implementation of `AbortSignalLike` to cancel the operation.
*/
abortSignal?: AbortSignalLike;
}
/**
* Identifies a communication participant.

@@ -54,5 +64,5 @@ */

* Gets an `AccessToken` for the user. Throws if already disposed.
* @param abortSignal - An implementation of `AbortSignalLike` to cancel the operation.
* @param options - Additional options.
*/
getToken(abortSignal?: AbortSignalLike): Promise<AccessToken>;
getToken(options?: CommunicationGetTokenOptions): Promise<AccessToken>;
/**

@@ -104,6 +114,6 @@ * Disposes the CommunicationTokenCredential and cancels any internal auto-refresh operation.

/**
* Creates an HTTP pipeline policy to authenticate a request
* using an `KeyCredential`
* Creates an HTTP pipeline policy to authenticate a request using a `KeyCredential`.
* @hidden
*
* @param credential - The key credential
* @param credential - The key credential.
*/

@@ -114,13 +124,20 @@ export declare const createCommunicationAccessKeyCredentialPolicy: (credential: KeyCredential) => RequestPolicyFactory;

* Creates a pipeline policy to authenticate request based
* on the credential passed in
* on the credential passed in.
* @hidden
*
* @param credential - The key credential
* @param credential - The KeyCredential or TokenCredential.
*/
export declare const createCommunicationAuthPolicy: (credential: KeyCredential | TokenCredential) => RequestPolicyFactory;
/* Excluded from this release type: _deserializeCommunicationIdentifier */
/**
* @hidden
* Translates the serialized format of a communication identifier to CommunicationIdentifier.
* @param serializedIdentifier - The SerializedCommunicationIdentifier to be deserialized.
*/
export declare const deserializeCommunicationIdentifier: (serializedIdentifier: SerializedCommunicationIdentifier) => CommunicationIdentifierKind;
/**
* Represents different properties of connection string
* using format "/endpoint=(.*);accesskey=(.*)"
* using format "/endpoint=(.*);accesskey=(.*)".
* @hidden
*/

@@ -214,2 +231,3 @@ export declare interface EndpointCredential {

* Parses arguments passed to a communication client.
* @hidden
*/

@@ -219,3 +237,4 @@ export declare const parseClientArguments: (connectionStringOrUrl: string, credentialOrOptions?: unknown) => UrlWithCredential;

/**
* Returns an EndpointCredential to easily access properties of the connection string
* Returns an EndpointCredential to easily access properties of the connection string.
* @hidden
*

@@ -251,13 +270,78 @@ * @param connectionString - The connection string to parse

/* Excluded from this release type: _serializeCommunicationIdentifier */
/**
* @hidden
* Translates a CommunicationIdentifier to its serialized format for sending a request.
* @param identifier - The CommunicationIdentifier to be serialized.
*/
export declare const serializeCommunicationIdentifier: (identifier: CommunicationIdentifier) => SerializedCommunicationIdentifier;
/* Excluded from this release type: _SerializedCommunicationCloudEnvironment */
/**
* @hidden
* Defines values for CommunicationCloudEnvironmentModel.
*/
export declare type SerializedCommunicationCloudEnvironment = "public" | "dod" | "gcch";
/* Excluded from this release type: _SerializedCommunicationIdentifier */
/**
* @hidden
* Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set.
*/
export declare interface SerializedCommunicationIdentifier {
/**
* Raw Id of the identifier. Optional in requests, required in responses.
*/
rawId?: string;
/**
* The communication user.
*/
communicationUser?: SerializedCommunicationUserIdentifier;
/**
* The phone number.
*/
phoneNumber?: SerializedPhoneNumberIdentifier;
/**
* The Microsoft Teams user.
*/
microsoftTeamsUser?: SerializedMicrosoftTeamsUserIdentifier;
}
/* Excluded from this release type: _SerializedCommunicationUserIdentifier */
/**
* @hidden
* A user that got created with an Azure Communication Services resource.
*/
export declare interface SerializedCommunicationUserIdentifier {
/**
* The Id of the communication user.
*/
id: string;
}
/* Excluded from this release type: _SerializedMicrosoftTeamsUserIdentifier */
/**
* @hidden
* A Microsoft Teams user.
*/
export declare interface SerializedMicrosoftTeamsUserIdentifier {
/**
* The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user.
*/
userId: string;
/**
* True if the Microsoft Teams user is anonymous. By default false if missing.
*/
isAnonymous?: boolean;
/**
* The cloud that the Microsoft Teams user belongs to. By default 'public' if missing.
*/
cloud?: SerializedCommunicationCloudEnvironment;
}
/* Excluded from this release type: _SerializedPhoneNumberIdentifier */
/**
* @hidden
* A phone number.
*/
export declare interface SerializedPhoneNumberIdentifier {
/**
* The phone number in E.164 format.
*/
value: string;
}

@@ -286,2 +370,3 @@ /**

* The URL and credential from parsing the arguments of a communication client.
* @hidden
*/

@@ -288,0 +373,0 @@ export declare type UrlWithCredential = {

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc