Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump json5 from 2.2.1 to 2.2.3 in /TeamHub/src/TeamHub.Web #17

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
06f4e69
Delete AwsLambdaFunction/src/ServiceName.API/Properties directory
leandromonaco May 31, 2022
dc60c78
Merge branch 'main' of https://github.com/leandromonaco/Workbench
leandromonaco Jun 1, 2022
24036cc
[MicroserviceTemplate]
leandromonaco Jun 3, 2022
c046b81
[MicroserviceTemplate] Fixed DynamoDB's Tye configuration
leandromonaco Jun 3, 2022
015fa49
[MicroserviceTemplate]
leandromonaco Jun 7, 2022
b4766bf
[MicroserviceTemplate] Made repository interface more generic IReposi…
leandromonaco Jun 7, 2022
2b65f03
[MicroserviceTemplate] Separated RepositoryService (application) from…
leandromonaco Jun 8, 2022
40173bc
[MicroserviceTemplate]
leandromonaco Jun 9, 2022
58cdd20
[MicroserviceTemplate] IDynamoDBContext is now being injected in the…
leandromonaco Jun 9, 2022
7b32522
[MicroserviceTemplate] Removed and ignored files that don't need to b…
leandromonaco Jun 9, 2022
4ceb8a9
[MicroserviceTemplate] Improved unit tests
leandromonaco Jun 9, 2022
e812606
[MicroserviceTemplate] Simplified Configuration Injection
leandromonaco Jun 14, 2022
1938527
[MicroserviceTemplate] Simplified Logging injection
leandromonaco Jun 14, 2022
6991fe6
[MicroserviceTemplate]
leandromonaco Jun 14, 2022
8c1a2fd
[MicroserviceTemplate] Added API Versioning Support
leandromonaco Jun 15, 2022
c0b1d9b
[MicroserviceTemplate] removed unnecessary MapToApiVersion method
leandromonaco Jun 15, 2022
a1a2771
[MicroserviceTemplate] Added HealthCheck Support
leandromonaco Jun 15, 2022
de00cdf
[MicroserviceTemplate] Fixed HealthChecks for SQL Server, Redis and D…
leandromonaco Jun 16, 2022
bf693ee
[MicroserviceTemplate] Added JWT with assymetric encryption using Ama…
leandromonaco Jun 17, 2022
21d1c25
[MicroserviceTemplate] Restructured settings file
leandromonaco Jun 19, 2022
d95072b
[MicroserviceTemplate] Added JWT Authentication
leandromonaco Jun 20, 2022
b1176ab
[MicroserviceTemplate] Moved settings under Infrastructure section
leandromonaco Jun 20, 2022
89d4424
[MicroserviceTemplate] Get TenantId from JWT
leandromonaco Jun 20, 2022
e64ef7e
[MicroserviceTemplate] Moved Authentication to its own service
leandromonaco Jun 21, 2022
283f82b
[MicroserviceTemplate] Added tool to initialize dev environment
leandromonaco Jun 22, 2022
7d1fb22
[MicroservicesTemplate] Created All.sln
leandromonaco Jun 23, 2022
d28a43c
[MicroserviceTemplate] Enabled Push step in Build.cs
leandromonaco Jun 23, 2022
7a386fd
[MicroservicesTemplate] Fixed version.json files
leandromonaco Jun 23, 2022
27d0a43
[MicroserviceTemplate] Build improvements (Pack step)
leandromonaco Jun 24, 2022
aa10ca5
[MicroserviceTemplate] Fixed KMS local url
leandromonaco Jun 24, 2022
10ce28a
[MicroserviceTemplate] Moved tye.yaml
leandromonaco Jun 24, 2022
5c86614
[MicroserviceTemplate]
leandromonaco Jun 29, 2022
2f1191b
[MicroserviceTemplate] Split CQRS Handler and Request files
leandromonaco Jun 29, 2022
37b32b2
[MicroserviceTemplate] added TODOs
leandromonaco Jun 29, 2022
d2a8788
[MicroserviceTemplate] Added Mock.API
leandromonaco Jun 30, 2022
71a738a
[Connectors] Added BitBucket Connector
leandromonaco Jun 30, 2022
d58d6c6
[CodeKata] Added Readme.md TODO
leandromonaco Jun 30, 2022
e202eeb
[MicroserviceTemplate] Added Delay configuration to Mock.API for Circ…
leandromonaco Jun 30, 2022
db24098
Update tye.yaml
leandromonaco Jul 13, 2022
dcae587
Update tye.yaml
leandromonaco Jul 18, 2022
349273a
Update tye.yaml
leandromonaco Jul 18, 2022
7486744
[MicroserviceTemplate] Added FeatureFlag Service
leandromonaco Jul 20, 2022
5ad0377
Fixed tye.yaml
leandromonaco Jul 20, 2022
d5a9f6b
[MicroserviceTemplate] Fixed Tye.yaml
leandromonaco Jul 20, 2022
79cd9d8
[MicroserviceTemplate] TODO: Get data from config file
leandromonaco Jul 20, 2022
c3debf4
[MicroserviceTemplate]
leandromonaco Jul 21, 2022
1f20f3a
[Microservices] added FeatureManagement API
leandromonaco Aug 17, 2022
6c6d8ff
Added Analytics API
leandromonaco Aug 26, 2022
82467ef
Added Secret Configuration for Analytics.API
leandromonaco Aug 26, 2022
e6baed5
Added TailwindUIKit Example
leandromonaco Aug 26, 2022
76af163
[IntegrationConnectors] Added JIRA and GoogleCalendar connectors
leandromonaco Sep 29, 2022
aafdf35
[Tools] migrated JIRA Reporting logic to its own integration connector
leandromonaco Oct 3, 2022
b7c1821
[Tools] Added TCP Server/Client
leandromonaco Oct 4, 2022
1e79159
[IntegrationConnectors] Bitbucket changes
leandromonaco Oct 4, 2022
7ed0aaf
[IntegrationConnectors] BitBucket Connector changes
leandromonaco Oct 5, 2022
b0f25f8
Added Code Katas
leandromonaco Oct 10, 2022
1a16fe3
[Tools] EnvironmentInitializer Improvements
leandromonaco Oct 19, 2022
5877131
Bump json5 from 2.2.1 to 2.2.3 in /TeamHub/src/TeamHub.Web
dependabot[bot] Jan 2, 2023
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,5 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/
/MicroserviceTemplate/src/.logs
/MicroserviceTemplate/src/shared-local-instance.db

This file was deleted.

4 changes: 3 additions & 1 deletion CodeKata/CSharp/CodeKata.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.SQS" Version="3.7.2.117" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="SmallSharp" Version="1.1.5" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
</ItemGroup>
Expand Down
33 changes: 33 additions & 0 deletions CodeKata/CSharp/Helpers/Benchmark/Kata3_BenchmarkHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;

namespace CodeKata.CSharp.Helpers.Benchmark
{
[MemoryDiagnoser(false)]
public class Kata3_BenchmarkHelper
{
private static readonly Random Rng = new(100);

public int Size { get; set; } = 100;

private List<int> _items;

[GlobalSetup]
public void Setup()
{
_items = Enumerable.Range(1, Size).Select(x => Rng.Next()).ToList();
}

[Benchmark]
public void ForEach()
{
foreach (var item in _items)
{
}
}
}
}
15 changes: 15 additions & 0 deletions CodeKata/CSharp/Helpers/Kata4/JobCreated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace CodeKata.CSharp.Helpers.Kata4
{
internal class JobCreated
{
[JsonPropertyName("id")]
public int Id { get; set; }
}
}
6 changes: 6 additions & 0 deletions CodeKata/CSharp/Kata3_Iteration_Benchmark.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using System;
using BenchmarkDotNet.Running;
using CodeKata.CSharp.Helpers.Benchmark;

BenchmarkRunner.Run<Kata3_BenchmarkHelper>();
Console.ReadLine();
64 changes: 64 additions & 0 deletions CodeKata/CSharp/Kata4_AWS_SQS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* AWS CLI
* aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name myQueue
* aws --endpoint-url=http://localhost:4566 sqs list-queues
* aws --endpoint-url=http://localhost:4566 sqs delete-queue --queue-url <value>
*/

using Amazon.SQS;
using Amazon.SQS.Model;
using CodeKata.CSharp.Helpers.Kata4;
using System;
using System.Text.Json;
using System.Collections.Generic;
using System.Net;
using System.Threading;

var config = new AmazonSQSConfig();
config.ServiceURL = "http://localhost:4566";
var sqsClient = new AmazonSQSClient(config);
var queueName = "myQueue";
var queue = await sqsClient.GetQueueUrlAsync(queueName);

//Add 10 items to the queue
for (int i = 0; i < 100; i++)
{
var payload = new JobCreated() { Id = i };

var request = new SendMessageRequest()
{
QueueUrl = queue.QueueUrl,
MessageBody = JsonSerializer.Serialize(payload)
};

await sqsClient.SendMessageAsync(request);
}


var ct = new CancellationToken();

while (!ct.IsCancellationRequested)
{
var receiveRequest = new ReceiveMessageRequest()
{
QueueUrl = queue.QueueUrl,
MessageAttributeNames = new List<string>() { "All" },
AttributeNames = new List<string>() { "All" }
};

var response = await sqsClient.ReceiveMessageAsync(receiveRequest);
if (response.HttpStatusCode != HttpStatusCode.OK)
{
//handle error
}

foreach (var msg in response.Messages)
{
Console.WriteLine(msg.Body);
//Once the message is processed we need to remove it from the queue, so it's not reprocessed.
await sqsClient.DeleteMessageAsync(queue.QueueUrl, msg.ReceiptHandle);
}
}


Console.ReadLine();
6 changes: 6 additions & 0 deletions CodeKata/CSharp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
},
"Kata2_EncryptionUsingCertificate.cs": {
"commandName": "Project"
},
"Kata3_Iteration_Benchmark.cs": {
"commandName": "Project"
},
"Kata4_AWS_SQS.cs": {
"commandName": "Project"
}
}
}
9 changes: 7 additions & 2 deletions CodeKata/CodeKata.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
# Visual Studio Version 17
VisualStudioVersion = 17.2.32505.173
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeKata.CSharp", "CSharp\CodeKata.CSharp.csproj", "{19C1553D-2D8D-4B63-8DD4-DA2A7A8EF3AD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7D70EF4E-11A4-4C8A-93D2-EFD448BFE1F6}"
ProjectSection(SolutionItems) = preProject
Readme.md = Readme.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
6 changes: 6 additions & 0 deletions CodeKata/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fluent API:
https://www.c-sharpcorner.com/article/creating-a-fluent-api-in-c-sharp-net/
https://www.youtube.com/watch?v=1JAdZul-aRQ

Object Mapping:
https://gist.github.com/leandromonaco/6d05108810efb48c0c27f7c6f8d26d44

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System.Text.Json;
using IntegrationConnectors.Common;

namespace IntegrationConnectors.Bitbucket
{
public class BitbucketConnector: HttpConnector
{
public BitbucketConnector(string baseUrl, string apiKey, AuthenticationType authType) : base(baseUrl, apiKey, authType)
{

}

public async Task<List<BitbucketBranch>> GetBranchesAsync(string company, string repository)
{
var pageNumber = 1;
var allBranches = new List<BitbucketBranch>();
var branches = new BitbucketBranches() { Values = new List<BitbucketBranch>() { new BitbucketBranch() } };

while (branches.Values.Count > 0)
{
var response = await GetAsync($"{_url}/2.0/repositories/{company}/{repository}/refs/branches?page={pageNumber}&pagelen=100");
branches = JsonSerializer.Deserialize<BitbucketBranches>(response, _jsonSerializerOptions);
allBranches.AddRange(branches.Values);
pageNumber++;
}

return allBranches.OrderByDescending(b => b.Target.Date).ToList();
}

public async Task<List<BitBucketPullRequest>> GetPullRequestsAsync(string company, string repository)
{
var pageNumber = 1;
var allPullRequests = new List<BitBucketPullRequest>();
var pullRequests = new BitBucketPullRequests() { Values = new List<BitBucketPullRequest>() { new BitBucketPullRequest() } };

while (pullRequests.Values.Count > 0)
{
var response = await GetAsync($"{_url}/2.0/repositories/{company}/{repository}/pullrequests?page={pageNumber}");
pullRequests = JsonSerializer.Deserialize<BitBucketPullRequests>(response, _jsonSerializerOptions);
allPullRequests.AddRange(pullRequests.Values);
pageNumber++;
}

return allPullRequests.OrderByDescending(pr => pr.Created).ToList();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\IntegrationConnectors.Common\IntegrationConnectors.Common.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Text.RegularExpressions;

namespace IntegrationConnectors.Bitbucket
{
public class Author
{
public string Raw { get; set; }

public User User { get; set; }

public string UserEmail
{
get
{
// Create a pattern for a word that starts with letter "M"
string pattern = @"<.*>";
// Create a Regex
Regex rg = new Regex(pattern);
MatchCollection matchedAuthors = rg.Matches(Raw);
return matchedAuthors[0].Value;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace IntegrationConnectors.Bitbucket
{
public class BitBucketDestination
{
public BitBucketRepository Repository { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace IntegrationConnectors.Bitbucket
{
public class BitBucketLinkHtml
{
public string Href { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace IntegrationConnectors.Bitbucket
{
public class BitBucketLinks
{
public BitBucketLinkHtml Html { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Text.Json.Serialization;

namespace IntegrationConnectors.Bitbucket
{
public class BitBucketPullRequest
{
public string Title { get; set; }
[JsonPropertyName("created_on")]
public DateTime Created { get; set; }
public BitBucketLinks Links { get; set; }
public BitBucketDestination Destination { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace IntegrationConnectors.Bitbucket
{
public class BitBucketPullRequests
{
public List<BitBucketPullRequest> Values { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace IntegrationConnectors.Bitbucket
{
public class BitBucketRepository
{
public string Name { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace IntegrationConnectors.Bitbucket
{
public class BitbucketBranch
{
public string Name { get; set; }

public Target Target { get; set; }

public BitBucketLinks Links { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


namespace IntegrationConnectors.Bitbucket
{
public class BitbucketBranches
{
public List<BitbucketBranch> Values { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace IntegrationConnectors.Bitbucket
{
public class Target
{
public Author Author { get; set; }
public DateTime Date { get; set; }
}
}
Loading