Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 3405cea

Browse files
DiegoCardozo94lauren-mills
authored andcommitted
[TypeScript][BotBuilder Libs] Update functionality of BotBuilder-Skills and BotBuilder-Solutions (#1933)
* Update BotBuilder-Libs * Minor changes in BotBuilder-Libs
1 parent 29c3b36 commit 3405cea

File tree

7 files changed

+18
-7
lines changed

7 files changed

+18
-7
lines changed

lib/typescript/botbuilder-skills/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
},
3939
"devDependencies": {
4040
"@types/restify": "^7.2.4",
41+
"@types/request-promise-native": "^1.0.7",
4142
"@types/uuid": "^3.4.4",
4243
"@typescript-eslint/eslint-plugin": "^1.10.2",
4344
"@typescript-eslint/eslint-plugin-tslint": "^1.10.2",

lib/typescript/botbuilder-skills/src/auth/microsoftAppCredentialsEx.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
*/
55

66
import { MicrosoftAppCredentials } from 'botframework-connector';
7+
import { IServiceClientCredentials } from './serviceClientCredentials';
78

8-
export class MicrosoftAppCredentialsEx extends MicrosoftAppCredentials {
9+
export class MicrosoftAppCredentialsEx extends MicrosoftAppCredentials implements IServiceClientCredentials {
910
public constructor(appId: string, password: string, oauthScope?: string) {
1011
super(appId, password);
1112
if (oauthScope) {

lib/typescript/botbuilder-skills/src/auth/serviceClientCredentials.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ import { WebResource } from '@azure/ms-rest-js';
77

88
export interface IServiceClientCredentials {
99
getToken(forceRefresh?: boolean): Promise<string>;
10-
processHttpRequest(request: WebResource): Promise<void>;
10+
// eslint-disable-next-line @typescript-eslint/tslint/config, @typescript-eslint/no-explicit-any
11+
signRequest(webResource: WebResource | any): Promise<WebResource | any>;
1112
}

lib/typescript/botbuilder-skills/src/http/skillHttpTransport.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ export class SkillHttpTransport implements ISkillTransport {
5252
// - We have to cast "request as any" to avoid a build break relating to different versions
5353
// of @azure/ms-rest-js being used by botframework-connector. This is just a build issue and
5454
// shouldn't effect production bots.
55-
// eslint-disable-next-line @typescript-eslint/tslint/config, @typescript-eslint/no-explicit-any
56-
await this.appCredentials.processHttpRequest(<any>request);
55+
// eslint-disable-next-line @typescript-eslint/tslint/config, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-any
56+
const signedRequest: WebResource = await this.appCredentials.signRequest(<any>request);
5757

58-
const response: HttpOperationResponse = await this.httpClient.sendRequest(request);
58+
const response: HttpOperationResponse = await this.httpClient.sendRequest(signedRequest);
5959

6060
if (response.status < 200 || response.status >= 300) {
6161
const result: string = `HTTP error when forwarding activity to the skill: Status Code:${

lib/typescript/botbuilder-skills/src/skillDialog.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { Activity, ActivityTypes, BotTelemetryClient, Entity, StatePropertyAccessor, TurnContext } from 'botbuilder';
6+
import {
7+
Activity,
8+
ActivityTypes,
9+
BotTelemetryClient,
10+
Entity,
11+
SemanticActionStateTypes,
12+
StatePropertyAccessor,
13+
TurnContext } from 'botbuilder';
714
import { ComponentDialog, DialogContext, DialogInstance, DialogReason, DialogTurnResult,
815
DialogTurnStatus } from 'botbuilder-dialogs';
916
import { ActivityExtensions, isProviderTokenResponse, MultiProviderAuthDialog, TokenEvents } from 'botbuilder-solutions';
@@ -149,6 +156,7 @@ export class SkillDialog extends ComponentDialog {
149156

150157
activity.semanticAction = {
151158
id: '',
159+
state: SemanticActionStateTypes.Continue,
152160
entities: entities
153161
};
154162

lib/typescript/botbuilder-solutions/src/botSettings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export interface IBotSettingsBase {
6767
}
6868

6969
export interface ITelemetryConfiguration {
70-
appId: string;
7170
instrumentationKey: string;
7271
}
7372

lib/typescript/botbuilder-solutions/src/extensions/activityExtensions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export namespace ActivityExtensions {
1515
from: source.recipient,
1616
label: source.label,
1717
locale: local,
18+
callerId: source.callerId,
1819
recipient: source.from,
1920
replyToId: source.id,
2021
serviceUrl: source.serviceUrl,

0 commit comments

Comments
 (0)