Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/typescript/botbuilder-skills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"devDependencies": {
"@types/restify": "^7.2.4",
"@types/request-promise-native": "^1.0.7",
"@types/uuid": "^3.4.4",
"@typescript-eslint/eslint-plugin": "^1.10.2",
"@typescript-eslint/eslint-plugin-tslint": "^1.10.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
*/

import { MicrosoftAppCredentials } from 'botframework-connector';
import { IServiceClientCredentials } from './serviceClientCredentials';

export class MicrosoftAppCredentialsEx extends MicrosoftAppCredentials {
export class MicrosoftAppCredentialsEx extends MicrosoftAppCredentials implements IServiceClientCredentials {
public constructor(appId: string, password: string, oauthScope?: string) {
super(appId, password);
if (oauthScope) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ import { WebResource } from '@azure/ms-rest-js';

export interface IServiceClientCredentials {
getToken(forceRefresh?: boolean): Promise<string>;
processHttpRequest(request: WebResource): Promise<void>;
// eslint-disable-next-line @typescript-eslint/tslint/config, @typescript-eslint/no-explicit-any
signRequest(webResource: WebResource | any): Promise<WebResource | any>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export class SkillHttpTransport implements ISkillTransport {
// - We have to cast "request as any" to avoid a build break relating to different versions
// of @azure/ms-rest-js being used by botframework-connector. This is just a build issue and
// shouldn't effect production bots.
// eslint-disable-next-line @typescript-eslint/tslint/config, @typescript-eslint/no-explicit-any
await this.appCredentials.processHttpRequest(<any>request);
// eslint-disable-next-line @typescript-eslint/tslint/config, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-any
const signedRequest: WebResource = await this.appCredentials.signRequest(<any>request);

const response: HttpOperationResponse = await this.httpClient.sendRequest(request);
const response: HttpOperationResponse = await this.httpClient.sendRequest(signedRequest);

if (response.status < 200 || response.status >= 300) {
const result: string = `HTTP error when forwarding activity to the skill: Status Code:${
Expand Down
10 changes: 9 additions & 1 deletion lib/typescript/botbuilder-skills/src/skillDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
* Licensed under the MIT License.
*/

import { Activity, ActivityTypes, BotTelemetryClient, Entity, StatePropertyAccessor, TurnContext } from 'botbuilder';
import {
Activity,
ActivityTypes,
BotTelemetryClient,
Entity,
SemanticActionStateTypes,
StatePropertyAccessor,
TurnContext } from 'botbuilder';
import { ComponentDialog, DialogContext, DialogInstance, DialogReason, DialogTurnResult,
DialogTurnStatus } from 'botbuilder-dialogs';
import { ActivityExtensions, isProviderTokenResponse, MultiProviderAuthDialog, TokenEvents } from 'botbuilder-solutions';
Expand Down Expand Up @@ -149,6 +156,7 @@ export class SkillDialog extends ComponentDialog {

activity.semanticAction = {
id: '',
state: SemanticActionStateTypes.Continue,
entities: entities
};

Expand Down
1 change: 0 additions & 1 deletion lib/typescript/botbuilder-solutions/src/botSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export interface IBotSettingsBase {
}

export interface ITelemetryConfiguration {
appId: string;
instrumentationKey: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export namespace ActivityExtensions {
from: source.recipient,
label: source.label,
locale: local,
callerId: source.callerId,
recipient: source.from,
replyToId: source.id,
serviceUrl: source.serviceUrl,
Expand Down