Skip to content

Commit

Permalink
CLI endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Sep 17, 2019
1 parent d6e205e commit 64852e8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
10 changes: 10 additions & 0 deletions cli/Squidex.CLI/Squidex.CLI/Commands/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================

using System;
using CommandDotNet.Attributes;

namespace Squidex.CLI.Commands
{
public partial class App
{
[ApplicationMetadata(Name = "info", Description = "Shows information about the CLI.")]
public void Info()
{
var version = typeof(App).Assembly.GetName().Version;

Console.WriteLine($"Squidex CLI v{version}, API Compatibility >= 3.X");
}
}
}
7 changes: 4 additions & 3 deletions cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ public async Task Create(CreateArguments arguments)

using (var fs = new FileStream(arguments.File, FileMode.CreateNew))
{
var download = await backupsClient.GetBackupContentAsync(app, foundBackup.Id.ToString());

await download.Stream.CopyToAsync(fs);
using (var download = await backupsClient.GetBackupContentAsync(app, foundBackup.Id.ToString()))
{
await download.Stream.CopyToAsync(fs);
}
}

Console.WriteLine("Backup completed. Download completed");
Expand Down
11 changes: 10 additions & 1 deletion cli/Squidex.CLI/Squidex.CLI/Commands/App_Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,16 @@ private async Task ExportAsync(ExportArguments arguments, Action<DummyEntity> ha

do
{
var content = await client.GetAsync(currentPage * 100, 100, arguments.Filter, arguments.OrderBy, arguments.FullText, ctx);
var query = new ODataQuery
{
Filter = arguments.Filter,
OrderBy = arguments.OrderBy,
Search = arguments.FullText,
Skip = currentPage * 100,
Top = 100
};

var content = await client.GetAsync(query, ctx);

total = content.Total;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static SchemaWithRefs<SchemaDetailsDto> EnrichSchemaNames(this SchemaWith
return target;
}

public static SchemaWithRefs<T> AdjustReferences<T>(this SchemaWithRefs<T> target, ICollection<SchemaDto> allSchemas) where T : UpsertDto
public static SchemaWithRefs<T> AdjustReferences<T>(this SchemaWithRefs<T> target, ICollection<SchemaDto> allSchemas) where T : UpsertSchemaDto
{
if (target.Schema.Fields != null)
{
Expand Down
2 changes: 1 addition & 1 deletion cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<OutputType>Exe</OutputType>
<AssemblyName>sq</AssemblyName>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>1.0-beta3</Version>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<Version>1.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 64852e8

Please sign in to comment.