diff --git a/libraries/botbuilder/tests/teamsInfo.test.js b/libraries/botbuilder/tests/teamsInfo.test.js index 8ab7ff957d..718d85a8a2 100644 --- a/libraries/botbuilder/tests/teamsInfo.test.js +++ b/libraries/botbuilder/tests/teamsInfo.test.js @@ -1081,7 +1081,7 @@ describe('TeamsInfo', function () { try { await TeamsInfo.sendMeetingNotification(context, notification, meetingId); } catch (e) { - assert.deepEqual(errorResponse, e.body); + assert.deepEqual(errorResponse, e.details); isErrorThrown = true; } @@ -1214,7 +1214,7 @@ describe('TeamsInfo', function () { try { await TeamsInfo.sendMessageToListOfUsers(context, activity, tenantId, members); } catch (e) { - assert.deepEqual(errorResponse, e.errors[0].body); + assert.deepEqual(errorResponse, e.errors[0].details); isErrorThrown = true; } @@ -1307,7 +1307,7 @@ describe('TeamsInfo', function () { try { await TeamsInfo.sendMessageToAllUsersInTenant(context, activity, tenantId); } catch (e) { - assert.deepEqual(errorResponse, e.errors[0].body); + assert.deepEqual(errorResponse, e.errors[0].details); isErrorThrown = true; } @@ -1395,7 +1395,7 @@ describe('TeamsInfo', function () { try { await TeamsInfo.sendMessageToAllUsersInTeam(context, activity, tenantId, teamId); } catch (e) { - assert.deepEqual(errorResponse, e.errors[0].body); + assert.deepEqual(errorResponse, e.errors[0].details); isErrorThrown = true; } @@ -1502,7 +1502,7 @@ describe('TeamsInfo', function () { try { await TeamsInfo.sendMessageToListOfChannels(context, activity, tenantId, members); } catch (e) { - assert.deepEqual(errorResponse, e.errors[0].body); + assert.deepEqual(errorResponse, e.errors[0].details); isErrorThrown = true; } @@ -1579,7 +1579,7 @@ describe('TeamsInfo', function () { try { await TeamsInfo.getOperationState(context, operationId); } catch (e) { - assert.deepEqual(errorResponse, e.errors[0].body); + assert.deepEqual(errorResponse, e.errors[0].details); isErrorThrown = true; } @@ -1648,7 +1648,7 @@ describe('TeamsInfo', function () { try { await TeamsInfo.getFailedEntries(context, operationId); } catch (e) { - assert.deepEqual(errorResponse, e.errors[0].body); + assert.deepEqual(errorResponse, e.errors[0].details); isErrorThrown = true; } @@ -1697,7 +1697,7 @@ describe('TeamsInfo', function () { try { await TeamsInfo.cancelOperation(context, operationId); } catch (e) { - assert.deepEqual(errorResponse, e.errors[0].body); + assert.deepEqual(errorResponse, e.errors[0].details); isErrorThrown = true; } diff --git a/libraries/botframework-connector/src/auth/appCredentials.ts b/libraries/botframework-connector/src/auth/appCredentials.ts index 257b867d31..4df398456f 100644 --- a/libraries/botframework-connector/src/auth/appCredentials.ts +++ b/libraries/botframework-connector/src/auth/appCredentials.ts @@ -7,9 +7,8 @@ */ import { ConfidentialClientApplication } from '@azure/msal-node'; -import { ServiceClientCredentials, WebResource } from "@azure/core-http"; -import {TokenCredentials} from "./tokenCredentials" -import * as adal from 'adal-node'; +import { ServiceClientCredentials, WebResource } from '@azure/core-http'; +import { TokenCredentials } from './tokenCredentials'; import { AuthenticationConstants } from './authenticationConstants'; import { AuthenticatorResult } from './authenticatorResult'; diff --git a/libraries/botframework-connector/src/auth/connectorFactoryImpl.ts b/libraries/botframework-connector/src/auth/connectorFactoryImpl.ts index e7bfb8cd2e..ea6d77a6a6 100644 --- a/libraries/botframework-connector/src/auth/connectorFactoryImpl.ts +++ b/libraries/botframework-connector/src/auth/connectorFactoryImpl.ts @@ -9,8 +9,9 @@ import type { ServiceClientCredentialsFactory } from './serviceClientCredentials // eslint-disable-next-line @typescript-eslint/no-var-requires const packageInfo: Record<'name' | 'version', string> = require('../../package.json'); -export const USER_AGENT = `Microsoft-BotFramework/3.1 ${packageInfo.name}/${packageInfo.version - } ${getDefaultUserAgentValue()} `; +export const USER_AGENT = `Microsoft-BotFramework/3.1 ${packageInfo.name}/${ + packageInfo.version +} ${getDefaultUserAgentValue()} `; /** * @internal diff --git a/libraries/botframework-connector/src/auth/tokenCredentials.ts b/libraries/botframework-connector/src/auth/tokenCredentials.ts index 9b297526a1..9614344345 100644 --- a/libraries/botframework-connector/src/auth/tokenCredentials.ts +++ b/libraries/botframework-connector/src/auth/tokenCredentials.ts @@ -1,45 +1,42 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { HttpHeaders, Constants, WebResourceLike, ServiceClientCredentials } from "@azure/core-http"; +import { HttpHeaders, Constants, WebResourceLike, ServiceClientCredentials } from '@azure/core-http'; const HeaderConstants = Constants.HeaderConstants; -const DEFAULT_AUTHORIZATION_SCHEME = "Bearer"; +const DEFAULT_AUTHORIZATION_SCHEME = 'Bearer'; /** * A credentials object that uses a token string and a authorzation scheme to authenticate. */ export class TokenCredentials implements ServiceClientCredentials { - token: string; - authorizationScheme: string = DEFAULT_AUTHORIZATION_SCHEME; + token: string; + authorizationScheme: string = DEFAULT_AUTHORIZATION_SCHEME; - /** - * Creates a new TokenCredentials object. - * - * @constructor - * @param {string} token The token. - * @param {string} [authorizationScheme] The authorization scheme. - */ - constructor(token: string, authorizationScheme: string = DEFAULT_AUTHORIZATION_SCHEME) { - if (!token) { - throw new Error("token cannot be null or undefined."); + /** + * Creates a new TokenCredentials object. + * + * @class + * @param {string} token The token. + * @param {string} [authorizationScheme] The authorization scheme. + */ + constructor(token: string, authorizationScheme: string = DEFAULT_AUTHORIZATION_SCHEME) { + if (!token) { + throw new Error('token cannot be null or undefined.'); + } + this.token = token; + this.authorizationScheme = authorizationScheme; } - this.token = token; - this.authorizationScheme = authorizationScheme; - } - /** - * Signs a request with the Authentication header. - * - * @param {WebResourceLike} webResource The WebResourceLike to be signed. - * @return {Promise} The signed request object. - */ - signRequest(webResource: WebResourceLike) { - if (!webResource.headers) webResource.headers = new HttpHeaders(); - webResource.headers.set( - HeaderConstants.AUTHORIZATION, - `${this.authorizationScheme} ${this.token}` - ); - return Promise.resolve(webResource); - } + /** + * Signs a request with the Authentication header. + * + * @param {WebResourceLike} webResource The WebResourceLike to be signed. + * @returns {Promise} The signed request object. + */ + signRequest(webResource: WebResourceLike) { + if (!webResource.headers) webResource.headers = new HttpHeaders(); + webResource.headers.set(HeaderConstants.AUTHORIZATION, `${this.authorizationScheme} ${this.token}`); + return Promise.resolve(webResource); + } } diff --git a/libraries/botframework-connector/src/teams/models/mappers.ts b/libraries/botframework-connector/src/teams/models/mappers.ts index 8a95c1819a..86124cf8f2 100644 --- a/libraries/botframework-connector/src/teams/models/mappers.ts +++ b/libraries/botframework-connector/src/teams/models/mappers.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -import { CompositeMapper } from "@azure/core-http" +import { CompositeMapper } from '@azure/core-http'; export const ChannelInfo: CompositeMapper = { serializedName: 'ChannelInfo', diff --git a/libraries/botframework-connector/src/teams/models/parameters.ts b/libraries/botframework-connector/src/teams/models/parameters.ts index ecf8021351..4f3e13d646 100644 --- a/libraries/botframework-connector/src/teams/models/parameters.ts +++ b/libraries/botframework-connector/src/teams/models/parameters.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -import { OperationURLParameter, OperationQueryParameter } from "@azure/core-http" +import { OperationURLParameter, OperationQueryParameter } from '@azure/core-http'; export const teamId: OperationURLParameter = { parameterPath: 'teamId', diff --git a/libraries/botframework-connector/src/teams/operations/teams.ts b/libraries/botframework-connector/src/teams/operations/teams.ts index ca70eeccfe..b3942c889b 100644 --- a/libraries/botframework-connector/src/teams/operations/teams.ts +++ b/libraries/botframework-connector/src/teams/operations/teams.ts @@ -4,7 +4,7 @@ * Licensed under the MIT License. */ -import { ServiceCallback, RequestOptionsBase, Serializer, OperationSpec } from "@azure/core-http" +import { ServiceCallback, RequestOptionsBase, Serializer, OperationSpec } from '@azure/core-http' import * as Models from '../models'; import * as Mappers from '../models/teamsMappers'; import * as Parameters from '../models/parameters'; diff --git a/libraries/tests.uischema b/libraries/tests.uischema index 54655146ff..9d11eb27e8 100644 --- a/libraries/tests.uischema +++ b/libraries/tests.uischema @@ -8,7 +8,8 @@ "triggers", "generator", "selector", - "schema" + "schema", + "dialogs" ], "label": "Adaptive dialog", "order": [