Skip to content

Commit 806a72d

Browse files
committed
3.0.1 release
1 parent 890fa4c commit 806a72d

18 files changed

+150
-26
lines changed

source/server/Karamem0.BookingsBot.Tests/Karamem0.BookingsBot.Tests.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="AltCover" Version="8.8.173" />
24-
<PackageReference Include="Microsoft.Bot.Builder.Testing" Version="4.22.7" />
25-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
26-
<PackageReference Include="NSubstitute" Version="5.1.0" />
27-
<PackageReference Include="NUnit" Version="4.1.0" />
23+
<PackageReference Include="AltCover" Version="9.0.1" />
24+
<PackageReference Include="Microsoft.Bot.Builder.Testing" Version="4.22.9" />
25+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
26+
<PackageReference Include="NSubstitute" Version="5.3.0" />
27+
<PackageReference Include="NUnit" Version="4.3.2" />
2828
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
29-
<PackageReference Include="NUnit.Analyzers" Version="4.3.0">
29+
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
3030
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3131
<PrivateAssets>all</PrivateAssets>
3232
</PackageReference>
33-
<PackageReference Include="NunitXml.TestLogger" Version="4.0.254" />
33+
<PackageReference Include="NunitXml.TestLogger" Version="5.0.0" />
3434
</ItemGroup>
3535

3636
<ItemGroup>

source/server/Karamem0.BookingsBot/ConfigureServices.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
using Microsoft.Agents.Memory.Blobs;
2121
using Microsoft.Agents.Protocols.Connector;
2222
using Microsoft.Agents.Protocols.Primitives;
23-
using Microsoft.AspNetCore.Authentication;
2423
using Microsoft.AspNetCore.Authentication.JwtBearer;
2524
using Microsoft.Extensions.Configuration;
2625
using Microsoft.Extensions.DependencyInjection;
@@ -74,7 +73,7 @@ public static IServiceCollection AddBot(
7473
));
7574
_ = services.AddSingleton<ConversationState>();
7675
_ = services.AddSingleton<UserState>();
77-
_ = services.AddTransient<IBot, DialogBot<BookingDialog>>();
76+
_ = services.AddTransient<IBot, DialogBot<MainDialog>>();
7877
return services;
7978
}
8079

@@ -123,6 +122,7 @@ public static IServiceCollection AddBotAuthentication(
123122

124123
public static IServiceCollection AddDialogs(this IServiceCollection services)
125124
{
125+
_ = services.AddScoped<MainDialog>();
126126
_ = services.AddScoped<BookingDialog>();
127127
return services;
128128
}
@@ -165,6 +165,12 @@ public static IServiceCollection AddMicrosoftGraph(
165165

166166
public static IServiceCollection AddSteps(this IServiceCollection services)
167167
{
168+
// Main Steps
169+
_ = services.AddScoped<MainStep>();
170+
_ = services.AddScoped(provider => new MainStepCollection(
171+
provider.GetRequiredService<MainStep>()
172+
));
173+
// Booking Steps
168174
_ = services.AddScoped<BookingBusinessStep>();
169175
_ = services.AddScoped<BookingServiceStep>();
170176
_ = services.AddScoped<BookingDateStep>();
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// Copyright (c) 2021-2024 karamem0
3+
//
4+
// This software is released under the MIT License.
5+
//
6+
// https://github.com/karamem0/bookings-bot/blob/main/LICENSE
7+
//
8+
9+
using Karamem0.BookingsBot.Steps;
10+
using Microsoft.Agents.BotBuilder.Dialogs;
11+
using System;
12+
using System.Collections.Generic;
13+
using System.Linq;
14+
using System.Text;
15+
using System.Threading.Tasks;
16+
17+
namespace Karamem0.BookingsBot.Dialogs;
18+
19+
public class MainDialog : ComponentDialog
20+
{
21+
22+
public MainDialog(MainStepCollection collection)
23+
: base(nameof(MainDialog))
24+
{
25+
_ = this.AddDialog(new WaterfallDialog(nameof(WaterfallDialog), collection.Actions));
26+
foreach (var dialog in collection.Dialogs)
27+
{
28+
_ = this.AddDialog(dialog);
29+
}
30+
}
31+
32+
}

source/server/Karamem0.BookingsBot/Karamem0.BookingsBot.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
</PropertyGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="AdaptiveCards.Templating" Version="2.0.3" />
25-
<PackageReference Include="Azure.Identity" Version="1.12.0" />
24+
<PackageReference Include="AdaptiveCards.Templating" Version="2.0.4" />
25+
<PackageReference Include="Azure.Identity" Version="1.13.2" />
2626
<PackageReference Include="Microsoft.Agents.Authentication" Version="0.1.26" />
2727
<PackageReference Include="Microsoft.Agents.Authentication.Msal" Version="0.1.26" />
2828
<PackageReference Include="Microsoft.Agents.BotBuilder" Version="0.1.26" />
2929
<PackageReference Include="Microsoft.Agents.BotBuilder.Dialogs" Version="0.1.26" />
3030
<PackageReference Include="Microsoft.Agents.Hosting.AspNetCore" Version="0.1.26" />
3131
<PackageReference Include="Microsoft.Agents.Memory.Blobs" Version="0.1.26" />
3232
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
33-
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="8.0.8" />
34-
<PackageReference Include="Microsoft.Graph" Version="5.56.0" />
35-
<PackageReference Include="Microsoft.Identity.Web" Version="3.4.0" />
36-
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="3.4.0" />
33+
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="9.0.1" />
34+
<PackageReference Include="Microsoft.Graph" Version="5.68.0" />
35+
<PackageReference Include="Microsoft.Identity.Web" Version="3.5.0" />
36+
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="3.5.0" />
3737
</ItemGroup>
3838

3939
<ItemGroup>

source/server/Karamem0.BookingsBot/Steps/Abstraction/ChoiceStep.cs renamed to source/server/Karamem0.BookingsBot/Steps/Abstraction/ChoicePromptStep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace Karamem0.BookingsBot.Steps.Abstraction;
1919

20-
public abstract class ChoiceStep : Step
20+
public abstract class ChoicePromptStep : Step
2121
{
2222

2323
public override Dialog Dialog => new ChoicePrompt(this.DialogId, this.OnValidateAsync);

source/server/Karamem0.BookingsBot/Steps/Abstraction/ConfirmStep.cs renamed to source/server/Karamem0.BookingsBot/Steps/Abstraction/ConfirmPromptStep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace Karamem0.BookingsBot.Steps.Abstraction;
1818

19-
public abstract class ConfirmStep : Step
19+
public abstract class ConfirmPromptStep : Step
2020
{
2121

2222
public override Dialog Dialog => new ConfirmPrompt(this.DialogId, this.OnValidateAsync);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// Copyright (c) 2021-2024 karamem0
3+
//
4+
// This software is released under the MIT License.
5+
//
6+
// https://github.com/karamem0/bookings-bot/blob/main/LICENSE
7+
//
8+
9+
using Microsoft.Agents.BotBuilder.Dialogs;
10+
using System;
11+
using System.Collections.Generic;
12+
using System.Linq;
13+
using System.Text;
14+
using System.Threading;
15+
using System.Threading.Tasks;
16+
17+
namespace Karamem0.BookingsBot.Steps.Abstraction;
18+
19+
public abstract class DialogStep<T>(T dialog) : Step where T : Dialog
20+
{
21+
22+
public override Dialog Dialog => dialog;
23+
24+
public virtual Task<bool> OnValidateAsync(PromptValidatorContext<bool> promptContext, CancellationToken cancellationToken = default)
25+
{
26+
return Task.FromResult(true);
27+
}
28+
29+
}
30+

source/server/Karamem0.BookingsBot/Steps/Abstraction/TextStep.cs renamed to source/server/Karamem0.BookingsBot/Steps/Abstraction/TextPromptStep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace Karamem0.BookingsBot.Steps.Abstraction;
1818

19-
public abstract class TextStep : Step
19+
public abstract class TextPromptStep : Step
2020
{
2121

2222
public override Dialog Dialog => new TextPrompt(this.DialogId, this.OnValidateAsync);

source/server/Karamem0.BookingsBot/Steps/BookingBusinessStep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace Karamem0.BookingsBot.Steps;
2626

27-
public class BookingBusinessStep(UserState userState, IGraphService graphService) : ChoiceStep
27+
public class BookingBusinessStep(UserState userState, IGraphService graphService) : ChoicePromptStep
2828
{
2929

3030
private readonly UserState userState = userState;

source/server/Karamem0.BookingsBot/Steps/BookingConfirmStep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
namespace Karamem0.BookingsBot.Steps;
2828

29-
public class BookingConfirmStep(UserState userState, IGraphService graphService) : ConfirmStep
29+
public class BookingConfirmStep(UserState userState, IGraphService graphService) : ConfirmPromptStep
3030
{
3131

3232
private static readonly string confirmCardName = "Karamem0.BookingsBot.Resources.Cards.BookingConfirmCard.json";

0 commit comments

Comments
 (0)