-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
378 changed files
with
23,549 additions
and
11,690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<PoliCheckExclusions> | ||
<!--Each of these exclusions is a folder name -if \[name]\exists in the file path, it will be skipped --> | ||
<Exclusion Type="FolderPathFull">NODE_MODULES|BUILD</Exclusion> | ||
|
||
<!--Each of these exclusions is a folder name -if any folder or file starts with "\[name]", it will be skipped --> | ||
<!--<Exclusion Type="FolderPathStart">ABC|XYZ</Exclusion>--> | ||
|
||
<!--Each of these file types will be completely skipped for the entire scan --> | ||
<!--<Exclusion Type="FileType">.ABC|.XYZ</Exclusion>--> | ||
|
||
<!--The specified file names will be skipped during the scan regardless which folder they are in --> | ||
<!--<Exclusion Type="FileName">ABC.TXT|XYZ.CS</Exclusion>--> | ||
</PoliCheckExclusions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/build | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
|
||
# NuGet Packages | ||
*.nupkg | ||
# The packages folder can be ignored because of Package Restore | ||
**/packages/* | ||
# except build/, which is used as an MSBuild target. | ||
!**/packages/build/ | ||
# Uncomment if necessary however generally it will be regenerated when needed | ||
#!**/packages/repositories.config | ||
# NuGet v3's project.json files produces more ignoreable files | ||
*.nuget.props | ||
*.nuget.targets |
38 changes: 38 additions & 0 deletions
38
Source/CompanyCommunicator.Common/Adapter/CCBotFrameworkHttpAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// <copyright file="CCBotFrameworkHttpAdapter.cs" company="Microsoft"> | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// </copyright> | ||
|
||
namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Adapter | ||
{ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Bot.Builder; | ||
using Microsoft.Bot.Builder.Integration.AspNet.Core; | ||
using Microsoft.Bot.Connector.Authentication; | ||
using Microsoft.Bot.Schema; | ||
|
||
/// <summary> | ||
/// Bot framework http adapter instance. | ||
/// </summary> | ||
public class CCBotFrameworkHttpAdapter : BotFrameworkHttpAdapter, ICCBotFrameworkHttpAdapter | ||
{ | ||
private readonly ICredentialProvider credentialProvider; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="CCBotFrameworkHttpAdapter"/> class. | ||
/// </summary> | ||
/// <param name="credentialProvider">credential provider.</param> | ||
public CCBotFrameworkHttpAdapter(ICredentialProvider credentialProvider) | ||
: base(credentialProvider) | ||
{ | ||
this.credentialProvider = credentialProvider; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override Task CreateConversationAsync(string channelId, string serviceUrl, MicrosoftAppCredentials credentials, ConversationParameters conversationParameters, BotCallbackHandler callback, CancellationToken cancellationToken) | ||
{ | ||
return base.CreateConversationAsync(channelId, serviceUrl, credentials, conversationParameters, callback, cancellationToken); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Source/CompanyCommunicator.Common/Adapter/ICCBotFrameworkHttpAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// <copyright file="ICCBotFrameworkHttpAdapter.cs" company="Microsoft"> | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// </copyright> | ||
|
||
namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Adapter | ||
{ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Bot.Builder; | ||
using Microsoft.Bot.Builder.Integration; | ||
using Microsoft.Bot.Connector.Authentication; | ||
using Microsoft.Bot.Schema; | ||
|
||
/// <summary> | ||
/// Bot Framework Http Adapter interface. | ||
/// </summary> | ||
public interface ICCBotFrameworkHttpAdapter : IAdapterIntegration | ||
{ | ||
/// <summary> | ||
/// Creates a conversation on the specified channel. | ||
/// </summary> | ||
/// <param name="channelId">The ID for the channel.</param> | ||
/// <param name="serviceUrl">The channel's service URL endpoint.</param> | ||
/// <param name="credentials">The application credentials for the bot.</param> | ||
/// <param name="conversationParameters">The conversation information to use to create the conversation.</param> | ||
/// <param name="callback">The method to call for the resulting bot turn.</param> | ||
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | ||
/// <returns>A task that represents the work queued to execute.</returns> | ||
Task CreateConversationAsync(string channelId, string serviceUrl, MicrosoftAppCredentials credentials, ConversationParameters conversationParameters, BotCallbackHandler callback, CancellationToken cancellationToken); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Source/CompanyCommunicator.Common/Clients/IStorageClientFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// <copyright file="IStorageClientFactory.cs" company="Microsoft"> | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// </copyright> | ||
|
||
namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Clients | ||
{ | ||
using global::Azure.Storage.Blobs; | ||
|
||
/// <summary> | ||
/// Storage client factory. | ||
/// </summary> | ||
public interface IStorageClientFactory | ||
{ | ||
/// <summary> | ||
/// Create the blob container client instance. | ||
/// </summary> | ||
/// <returns>BlobContainerClient instance.</returns> | ||
BlobContainerClient CreateBlobContainerClient(); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
Source/CompanyCommunicator.Common/Clients/StorageClientFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// <copyright file="StorageClientFactory.cs" company="Microsoft"> | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// </copyright> | ||
|
||
namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Clients | ||
{ | ||
using System; | ||
using global::Azure.Core; | ||
using global::Azure.Storage.Blobs; | ||
using Microsoft.Extensions.Options; | ||
using Microsoft.Teams.Apps.CompanyCommunicator.Common.Repositories; | ||
|
||
/// <summary> | ||
/// Storage client factory. | ||
/// </summary> | ||
public class StorageClientFactory : IStorageClientFactory | ||
{ | ||
private readonly string storageConnectionString; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="StorageClientFactory"/> class. | ||
/// </summary> | ||
/// <param name="repositoryOptions">User data repository.</param> | ||
public StorageClientFactory(IOptions<RepositoryOptions> repositoryOptions) | ||
{ | ||
this.storageConnectionString = repositoryOptions.Value.StorageAccountConnectionString; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public BlobContainerClient CreateBlobContainerClient() | ||
{ | ||
var options = new BlobClientOptions(); | ||
|
||
// configure retries | ||
options.Retry.MaxRetries = 5; // default is 3 | ||
options.Retry.Mode = RetryMode.Exponential; // default is fixed retry policy | ||
options.Retry.Delay = TimeSpan.FromSeconds(1); // default is 0.8s | ||
|
||
return new BlobContainerClient( | ||
this.storageConnectionString, | ||
Constants.BlobContainerName, | ||
options); | ||
} | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...s.CompanyCommunicator.Common/Constants.cs → ...e/CompanyCommunicator.Common/Constants.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...Common/Extensions/EnumerableExtensions.cs → ...Common/Extensions/EnumerableExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
.../Extensions/NotificationDataExtensions.cs → .../Extensions/NotificationDataExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...sions/SendQueueMessageContentExtension.cs → ...sions/SendQueueMessageContentExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.