-
Notifications
You must be signed in to change notification settings - Fork 28
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
1 parent
48c19d8
commit e0e333d
Showing
368 changed files
with
14,880 additions
and
14,002 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Build CosmosDbExplorer | |
on: | ||
push: | ||
branches: | ||
- master | ||
- "**" | ||
pull_request: | ||
branches: | ||
- master | ||
|
@@ -27,19 +27,37 @@ jobs: | |
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
|
||
- name: Setup NuGet | ||
uses: nuget/setup-nuget@v1 | ||
with: | ||
nuget-version: '5.7.x' | ||
# Install the .NET Core workload | ||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.x' | ||
|
||
- name: Restore NuGet Packages | ||
run: nuget restore $env:Solution_Name | ||
- name: Restore dependencies | ||
run: dotnet restore $env:Solution_Name | ||
|
||
- name: Build Application | ||
run: msbuild $env:Solution_Name /p:Configuration=Release | ||
run: dotnet build $env:Solution_Name --no-restore --configuration Release #/p:Version=0.9.3.12 | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: CosmosDbExplorer | ||
path: src\CosmosDbExplorer\bin\Release\ | ||
path: src\CosmosDbExplorer\bin\Release\net6.0-windows | ||
|
||
# - name: Setup NuGet | ||
# uses: nuget/setup-nuget@v1 | ||
# with: | ||
# nuget-version: '6.0.x' | ||
|
||
# - name: Restore NuGet Packages | ||
# run: nuget restore $env:Solution_Name | ||
|
||
# - name: Build Application | ||
# run: msbuild $env:Solution_Name /p:Configuration=Release | ||
|
||
# - name: Upload build artifacts | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: CosmosDbExplorer | ||
# path: src\CosmosDbExplorer\bin\Release\ |
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 |
---|---|---|
|
@@ -37,21 +37,22 @@ jobs: | |
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
|
||
- name: Setup NuGet | ||
uses: nuget/setup-nuget@v1 | ||
with: | ||
nuget-version: '5.7.x' | ||
|
||
- name: Restore NuGet Packages | ||
run: nuget restore $env:Solution_Name | ||
# Install the .NET Core workload | ||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.x' | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore $env:Solution_Name | ||
|
||
- name: Build Application | ||
run: msbuild $env:Solution_Name /p:Configuration=Release | ||
run: dotnet build $env:Solution_Name --no-restore --configuration Release /p:Version=${{ steps.tag.outputs.version }} | ||
|
||
- name: Zip Release folder | ||
uses: papeloto/action-zip@v1 | ||
with: | ||
files: src\CosmosDbExplorer\bin\Release\ | ||
files: src\CosmosDbExplorer\bin\Release\net6.0-windows | ||
dest: CosmosDbExplorer.zip | ||
|
||
- name: Automatic Release | ||
|
@@ -81,29 +82,29 @@ jobs: | |
- name: 'Replace tokens Chocolatey files #1' | ||
uses: datamonsters/replace-action@v2 | ||
with: | ||
files: './src/CosmosDbExplorer/Chocolatey-Packages/cosmosdbexplorer/tools/chocolateyinstall.ps1' | ||
files: './Chocolatey-Packages/cosmosdbexplorer/tools/chocolateyinstall.ps1' | ||
replacements: '$version=${{ steps.tag.outputs.version }},$tag-name=$GIT_TAG_NAME' | ||
|
||
- name: 'Replace tokens Chocolatey files #2' | ||
uses: datamonsters/replace-action@v2 | ||
with: | ||
files: './src/CosmosDbExplorer/Chocolatey-Packages/cosmosdbexplorer/cosmosdbexplorer.nuspec' | ||
files: './Chocolatey-Packages/cosmosdbexplorer/cosmosdbexplorer.nuspec' | ||
replacements: '$version=${{ steps.tag.outputs.version }},$tag-name=$GIT_TAG_NAME' | ||
|
||
- name: Pack Chocolatey | ||
uses: crazy-max/ghaction-chocolatey@v1 | ||
with: | ||
args: pack ./src/CosmosDbExplorer/Chocolatey-Packages/cosmosdbexplorer/cosmosdbexplorer.nuspec | ||
args: pack ./Chocolatey-Packages/cosmosdbexplorer/cosmosdbexplorer.nuspec | ||
|
||
- name: Push Chocolatey | ||
uses: crazy-max/ghaction-chocolatey@v1 | ||
with: | ||
args: push ./src/CosmosDbExplorer/Chocolatey-Packages/cosmosdbexplorer/cosmosdbexplorer.${{ steps.tag.outputs.version }}.nupkg --source https://chocolatey.org/ --api-key=$CHOCOLATEY_API_KEY | ||
args: push ./Chocolatey-Packages/cosmosdbexplorer/cosmosdbexplorer.${{ steps.tag.outputs.version }}.nupkg --source https://chocolatey.org/ --api-key=$CHOCOLATEY_API_KEY | ||
|
||
- name: Upload chocolatey artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./src/CosmosDbExplorer/Chocolatey-Packages/cosmosdbexplorer/cosmosdbexplorer.${{ steps.tag.outputs.version }}.nupkg | ||
path: ./Chocolatey-Packages/cosmosdbexplorer/cosmosdbexplorer.${{ steps.tag.outputs.version }}.nupkg | ||
|
||
# Autoupdater | ||
autoupdater: | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
4 changes: 3 additions & 1 deletion
4
...mosDbExplorer/Infrastructure/Constants.cs → src/CosmosDbExplorer.Core/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
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,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts | ||
{ | ||
public interface ICosmosDocument : ICosmosResource, IEquatable<ICosmosDocument?> | ||
{ | ||
string? Attachments { get; } | ||
long TimeStamp { get; } | ||
object? PartitionKey { get; } | ||
bool HasPartitionKey { get; } | ||
} | ||
} |
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,17 @@ | ||
using System; | ||
using CosmosDbExplorer.Core.Models; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts | ||
{ | ||
public interface ICosmosQuery | ||
{ | ||
string QueryText { get; set; } | ||
int MaxItemCount { get; set; } | ||
string? ContinuationToken { get; set; } | ||
bool EnableScanInQuery { get; set; } | ||
bool EnableCrossPartitionQuery { get; set; } | ||
int MaxDOP { get; set; } | ||
int MaxBufferItem { get; set; } | ||
Optional<object?> PartitionKeyValue { get; set; } | ||
} | ||
} |
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,9 @@ | ||
namespace CosmosDbExplorer.Core.Contracts | ||
{ | ||
public interface ICosmosResource | ||
{ | ||
string? Id { get; } | ||
string? ETag { get; } | ||
string? SelfLink { get; } | ||
} | ||
} |
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,7 @@ | ||
namespace CosmosDbExplorer.Core.Contracts | ||
{ | ||
public interface ICosmosScript : ICosmosResource | ||
{ | ||
string Body { get; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/CosmosDbExplorer.Core/Contracts/IDocumentRequestOptions.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,14 @@ | ||
using CosmosDbExplorer.Core.Models; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts | ||
{ | ||
public interface IDocumentRequestOptions | ||
{ | ||
CosmosIndexingDirectives? IndexingDirective { get; set; } | ||
CosmosConsistencyLevels? ConsistencyLevel { get; set; } | ||
CosmosAccessConditionType AccessCondition { get; set; } | ||
string? ETag { get; set; } | ||
string[] PreTriggers { get; set; } | ||
string[] PostTriggers { get; set; } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/CosmosDbExplorer.Core/Contracts/Services/ICosmosClientService.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,12 @@ | ||
using CosmosDbExplorer.Core.Models; | ||
using Microsoft.Azure.Cosmos; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts.Services | ||
{ | ||
public interface ICosmosClientService | ||
{ | ||
CosmosClient GetClient(CosmosConnection connection); | ||
|
||
void DeleteClient(CosmosConnection connection); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/CosmosDbExplorer.Core/Contracts/Services/ICosmosContainerService.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,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using CosmosDbExplorer.Core.Models; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts.Services | ||
{ | ||
public interface ICosmosContainerService | ||
{ | ||
Task<CosmosContainer> CreateContainerAsync(CosmosContainer container, int? throughput, bool? isAutoscale, CancellationToken cancellationToken); | ||
Task DeleteContainserAsync(CosmosContainer container, CancellationToken cancellationToken); | ||
Task<CosmosContainerMetric> GetContainerMetricsAsync(CosmosContainer container, CancellationToken cancellationToken); | ||
Task<IList<CosmosContainer>> GetContainersAsync(CancellationToken cancellationToken); | ||
Task<CosmosThroughput?> GetThroughputAsync(CosmosContainer container); | ||
Task<CosmosContainer> UpdateContainerAsync(CosmosContainer container); | ||
Task<CosmosThroughput> UpdateThroughputAsync(CosmosContainer container, int throughput, bool isAutoscale); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/CosmosDbExplorer.Core/Contracts/Services/ICosmosDatabaseService.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,17 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
using CosmosDbExplorer.Core.Models; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts.Services | ||
{ | ||
public interface ICosmosDatabaseService | ||
{ | ||
Task<CosmosDatabase> CreateDatabaseAsync(CosmosDatabase database, int? throughput, bool? isAutoscale, CancellationToken cancellationToken); | ||
Task DeleteDatabaseAsync(CosmosDatabase database, CancellationToken cancellationToken); | ||
Task<IList<CosmosDatabase>> GetDatabasesAsync(CancellationToken cancellationToken); | ||
Task<CosmosThroughput?> GetThroughputAsync(CosmosDatabase database); | ||
Task<CosmosThroughput> UpdateThroughputAsync(CosmosDatabase database, int throughput, bool isAutoscale); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/CosmosDbExplorer.Core/Contracts/Services/ICosmosDocumentService.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,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using CosmosDbExplorer.Core.Models; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts.Services | ||
{ | ||
public interface ICosmosDocumentService | ||
{ | ||
Task<CosmosResult> DeleteDocumentsAsync(IEnumerable<ICosmosDocument> documents, CancellationToken cancellationToken); | ||
Task<CosmosQueryResult<IReadOnlyCollection<JObject>>> ExecuteQueryAsync(ICosmosQuery query, CancellationToken cancellationToken); | ||
Task<CosmosQueryResult<JObject>> GetDocumentAsync(ICosmosDocument document, IDocumentRequestOptions options, CancellationToken cancellation); | ||
Task<CosmosQueryResult<IReadOnlyCollection<ICosmosDocument>>> GetDocumentsAsync(string? filter, int? maxItemsCount, string? continuationToken, CancellationToken cancellationToken); | ||
Task<CosmosQueryResult<JObject>> SaveDocumentAsync(string content, IDocumentRequestOptions options, CancellationToken cancellation); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/CosmosDbExplorer.Core/Contracts/Services/ICosmosScriptService.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,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using CosmosDbExplorer.Core.Models; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts.Services | ||
{ | ||
public interface ICosmosScriptService | ||
{ | ||
Task<CosmosResult> DeleteStoredProcedureAsync(CosmosStoredProcedure asset); | ||
Task<CosmosResult> DeleteTriggerAsync(CosmosTrigger asset); | ||
Task<CosmosResult> DeleteUserDefinedFunctionAsync(CosmosUserDefinedFunction asset); | ||
Task<CosmosStoredProcedureResult> ExecuteStoredProcedureAsync(string storedProcedureId, string? partitionKey, dynamic[] parameters); | ||
Task<IReadOnlyList<CosmosStoredProcedure>> GetStoredProceduresAsync(CancellationToken cancellationToken); | ||
Task<IReadOnlyList<CosmosTrigger>> GetTriggersAsync(CancellationToken cancellationToken); | ||
Task<IReadOnlyList<CosmosUserDefinedFunction>> GetUserDefinedFunctionsAsync(CancellationToken cancellationToken); | ||
Task<CosmosStoredProcedure> SaveStoredProcedureAsync(CosmosStoredProcedure asset); | ||
Task<CosmosTrigger> SaveTriggerAsync(CosmosTrigger asset); | ||
Task<CosmosUserDefinedFunction> SaveUserDefinedFunctionAsync(CosmosUserDefinedFunction asset); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/CosmosDbExplorer.Core/Contracts/Services/ICosmosUserService.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,13 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
using CosmosDbExplorer.Core.Models; | ||
|
||
namespace CosmosDbExplorer.Core.Contracts.Services | ||
{ | ||
public interface ICosmosUserService | ||
{ | ||
Task<List<CosmosUser>> GetUsersAsync(CancellationToken cancellationToken); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/CosmosDbExplorer.Core/Contracts/Services/IFileService.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,11 @@ | ||
namespace CosmosDbExplorer.Core.Contracts.Services | ||
{ | ||
public interface IFileService | ||
{ | ||
T Read<T>(string folderPath, string fileName); | ||
|
||
void Save<T>(string folderPath, string fileName, T content); | ||
|
||
void Delete(string folderPath, string fileName); | ||
} | ||
} |
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,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<RootNamespace>CosmosDbExplorer.Core</RootNamespace> | ||
<LangVersion>latest</LangVersion> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.26.1" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||
</ItemGroup> | ||
</Project> |
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,33 @@ | ||
using System; | ||
using System.ComponentModel; | ||
|
||
namespace CosmosDbExplorer.Core | ||
{ | ||
public class EnumDescriptionTypeConverter : EnumConverter | ||
{ | ||
public EnumDescriptionTypeConverter(Type type) | ||
: base(type) | ||
{ | ||
} | ||
|
||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) | ||
{ | ||
if (destinationType == typeof(string)) | ||
{ | ||
if (value != null) | ||
{ | ||
var fi = value.GetType().GetField(value.ToString()); | ||
if (fi != null) | ||
{ | ||
var attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); | ||
return ((attributes.Length > 0) && (!string.IsNullOrEmpty(attributes[0].Description))) ? attributes[0].Description : value.ToString(); | ||
} | ||
} | ||
|
||
return string.Empty; | ||
} | ||
|
||
return base.ConvertTo(context, culture, value, destinationType); | ||
} | ||
} | ||
} |
Oops, something went wrong.