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

Commit 707281f

Browse files
committed
Replicate changes to templates of C# and TypeScript
1 parent 22dd469 commit 707281f

20 files changed

Lines changed: 66 additions & 257 deletions

File tree

templates/csharp/Skill/Skill/Adapters/DefaultAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public DefaultAdapter(
5353
Use(new ShowTypingMiddleware());
5454
Use(new SetLocaleMiddleware(settings.DefaultLocale ?? "en-us"));
5555
Use(new EventDebuggerMiddleware());
56-
Use(new SetSpeakMiddleware());
56+
Use(new SetSpeakMiddleware("en-US-JennyNeural", true));
5757
}
5858

5959
private async Task HandleTurnErrorAsync(ITurnContext turnContext, Exception exception)

templates/csharp/Skill/Skill/Authentication/AllowedCallersClaimsValidator.cs

Lines changed: 0 additions & 60 deletions
This file was deleted.

templates/csharp/Skill/Skill/Skill.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
1010
<PackageReference Include="Microsoft.Azure.CognitiveServices.ContentModerator" Version="2.0.0" />
1111
<PackageReference Include="Microsoft.Azure.CognitiveServices.Language" Version="1.0.1-preview" />
12-
<PackageReference Include="Microsoft.Bot.Builder.AI.Luis" Version="4.9.3" />
13-
<PackageReference Include="Microsoft.Bot.Builder.AI.QnA" Version="4.9.3" />
14-
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.9.3" />
15-
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.9.3" />
16-
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.9.3" />
17-
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.9.3" />
18-
<PackageReference Include="Microsoft.Bot.Solutions" Version="1.0.1" />
12+
<PackageReference Include="Microsoft.Bot.Builder.AI.Luis" Version="4.13.2" />
13+
<PackageReference Include="Microsoft.Bot.Builder.AI.QnA" Version="4.13.2" />
14+
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.13.2" />
15+
<PackageReference Include="Microsoft.Bot.Builder.Azure.Blobs" Version="4.13.2" />
16+
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.13.2" />
17+
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.13.2" />
18+
<PackageReference Include="Microsoft.Bot.Solutions" Version="1.1.0" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

templates/csharp/Skill/Skill/Startup.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
using Microsoft.Extensions.DependencyInjection;
2222
using Microsoft.Extensions.Hosting;
2323
using $safeprojectname$.Adapters;
24-
using $safeprojectname$.Authentication;
2524
using $safeprojectname$.Bots;
2625
using $safeprojectname$.Dialogs;
2726
using $safeprojectname$.Services;
@@ -72,7 +71,10 @@ public void ConfigureServices(IServiceCollection services)
7271
services.AddSingleton<IChannelProvider, ConfigurationChannelProvider>();
7372

7473
// Register AuthConfiguration to enable custom claim validation.
75-
services.AddSingleton(sp => new AuthenticationConfiguration { ClaimsValidator = new AllowedCallersClaimsValidator(sp.GetService<IConfiguration>()) });
74+
services.AddSingleton(sp => new AuthenticationConfiguration
75+
{
76+
ClaimsValidator = new AllowedCallersClaimsValidator(sp.GetService<IConfiguration>().GetSection("allowedCallers").Get<List<string>>())
77+
});
7678

7779
// Configure configuration provider
7880
services.AddSingleton<ICredentialProvider, ConfigurationCredentialProvider>();

templates/csharp/VA/VA/Adapters/DefaultAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public DefaultAdapter(
6464
Use(new ShowTypingMiddleware());
6565
Use(new SetLocaleMiddleware(settings.DefaultLocale ?? "en-us"));
6666
Use(new EventDebuggerMiddleware());
67-
Use(new SetSpeakMiddleware());
67+
Use(new SetSpeakMiddleware("en-US-JennyNeural", true));
6868
}
6969

7070
private async Task HandleTurnErrorAsync(ITurnContext turnContext, Exception exception)

templates/csharp/VA/VA/Authentication/AllowedCallersClaimsValidator.cs

Lines changed: 0 additions & 48 deletions
This file was deleted.

templates/csharp/VA/VA/Startup.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55
using System.Collections.Generic;
66
using System.IO;
7+
using System.Linq;
78
using Microsoft.ApplicationInsights.Extensibility;
89
using Microsoft.AspNetCore.Builder;
910
using Microsoft.AspNetCore.Hosting;
@@ -24,7 +25,6 @@
2425
using Microsoft.Extensions.DependencyInjection;
2526
using Microsoft.Extensions.Hosting;
2627
using $safeprojectname$.Adapters;
27-
using $safeprojectname$.Authentication;
2828
using $safeprojectname$.Bots;
2929
using $safeprojectname$.Dialogs;
3030
using $safeprojectname$.Services;
@@ -73,7 +73,8 @@ public void ConfigureServices(IServiceCollection services)
7373
services.AddSingleton(skillsConfig);
7474

7575
// Register AuthConfiguration to enable custom claim validation.
76-
services.AddSingleton(sp => new AuthenticationConfiguration { ClaimsValidator = new AllowedCallersClaimsValidator(skillsConfig) });
76+
var allowedCallers = (from skill in skillsConfig.Skills.Values select skill.AppId).ToList();
77+
services.AddSingleton(sp => new AuthenticationConfiguration { ClaimsValidator = new AllowedCallersClaimsValidator(allowedCallers) });
7778

7879
// Configure telemetry
7980
services.AddApplicationInsightsTelemetry();

templates/csharp/VA/VA/VA.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
1515
<PackageReference Include="Microsoft.Azure.CognitiveServices.ContentModerator" Version="2.0.0" />
1616
<PackageReference Include="Microsoft.Azure.CognitiveServices.Language" Version="1.0.1-preview" />
17-
<PackageReference Include="Microsoft.Bot.Builder.AI.Luis" Version="4.9.3" />
18-
<PackageReference Include="Microsoft.Bot.Builder.AI.QnA" Version="4.9.3" />
19-
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.9.3" />
20-
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.9.3" />
21-
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.9.3" />
22-
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.9.3" />
23-
<PackageReference Include="Microsoft.Bot.Builder.LanguageGeneration" Version="4.9.3" />
24-
<PackageReference Include="Microsoft.Bot.Solutions" Version="1.0.1" />
17+
<PackageReference Include="Microsoft.Bot.Builder.AI.Luis" Version="4.13.2" />
18+
<PackageReference Include="Microsoft.Bot.Builder.AI.QnA" Version="4.13.2" />
19+
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.13.2" />
20+
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.13.2" />
21+
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.13.2" />
22+
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.13.2" />
23+
<PackageReference Include="Microsoft.Bot.Builder.LanguageGeneration" Version="4.13.2" />
24+
<PackageReference Include="Microsoft.Bot.Solutions" Version="1.1.0" />
2525
</ItemGroup>
2626

2727
<ItemGroup>

templates/typescript/generator-bot-virtualassistant/generators/app/templates/sample-assistant/_package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
"dependencies": {
2222
"@microsoft/microsoft-graph-client": "^1.3.0",
2323
"@microsoft/microsoft-graph-types": "^1.5.0",
24-
"botbuilder": "^4.9.2",
25-
"botbuilder-ai": "^4.9.2",
26-
"botbuilder-applicationinsights": "^4.9.2",
27-
"botbuilder-azure": "^4.9.2",
28-
"botbuilder-dialogs": "^4.9.2",
29-
"botbuilder-lg": "^4.9.2",
30-
"bot-solutions": "^1.0.0",
31-
"botframework-config": "^4.9.2",
32-
"botframework-connector": "^4.9.2",
24+
"botbuilder": "^4.13.5",
25+
"botbuilder-ai": "^4.13.5",
26+
"botbuilder-applicationinsights": "^4.13.5",
27+
"botbuilder-azure": "^4.13.5",
28+
"botbuilder-azure-blobs": "^4.13.5-preview",
29+
"botbuilder-dialogs": "^4.13.5",
30+
"botbuilder-lg": "^4.13.5",
31+
"bot-solutions": "^1.1.0",
32+
"botframework-config": "^4.13.5-deprecated",
33+
"botframework-connector": "^4.13.5",
3334
"restify": "^8.5.1"
3435
},
3536
"devDependencies": {

templates/typescript/generator-bot-virtualassistant/generators/app/templates/sample-assistant/src/adapters/defaultAdapter.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import {
88
BotFrameworkAdapterSettings,
99
BotTelemetryClient,
1010
ConversationState,
11+
SetSpeakMiddleware,
1112
ShowTypingMiddleware,
1213
SkillHttpClient,
1314
TranscriptLoggerMiddleware,
1415
TranscriptStore,
1516
TurnContext,
1617
TelemetryException } from 'botbuilder';
17-
import { AzureBlobTranscriptStore } from 'botbuilder-azure';
18+
import { BlobsTranscriptStore } from 'botbuilder-azure-blobs';
1819
import {
1920
EventDebuggerMiddleware,
2021
LocaleTemplateManager,
21-
SetLocaleMiddleware,
22-
SetSpeakMiddleware } from 'bot-solutions';
22+
SetLocaleMiddleware } from 'bot-solutions';
2323
import { TelemetryInitializerMiddleware } from 'botbuilder-applicationinsights';
2424
import { IBotSettings } from '../services/botSettings.js';
2525
import { ActivityEx, SkillsConfiguration } from 'bot-solutions/lib';
@@ -67,10 +67,7 @@ export class DefaultAdapter extends BotFrameworkAdapter {
6767
throw new Error('There is no blobStorage value in appsettings file');
6868
}
6969

70-
const transcriptStore: TranscriptStore = new AzureBlobTranscriptStore({
71-
containerName: settings.blobStorage.container,
72-
storageAccountOrConnectionString: settings.blobStorage.connectionString
73-
});
70+
const transcriptStore: TranscriptStore = new BlobsTranscriptStore(settings.blobStorage.connectionString, settings.blobStorage.container);
7471

7572
this.use(telemetryMiddleware);
7673

@@ -80,7 +77,7 @@ export class DefaultAdapter extends BotFrameworkAdapter {
8077
this.use(new ShowTypingMiddleware());
8178
this.use(new SetLocaleMiddleware(settings.defaultLocale || 'en-us'));
8279
this.use(new EventDebuggerMiddleware());
83-
this.use(new SetSpeakMiddleware());
80+
this.use(new SetSpeakMiddleware('en-US-JennyNeural', true));
8481
}
8582

8683
private async handleTurnError(turnContext: TurnContext, error: Error): Promise<void> {

0 commit comments

Comments
 (0)