Skip to content

Commit 3babdf8

Browse files
Asset folders synchronizer.
1 parent d2243ff commit 3babdf8

File tree

147 files changed

+688
-492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+688
-492
lines changed

cli/Squidex.CLI/Squidex.CLI.Tests/FolderTreeTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.Threading;
11-
using System.Threading.Tasks;
128
using FakeItEasy;
139
using Squidex.CLI.Commands.Implementation;
14-
using Squidex.CLI.Commands.Implementation.Sync.Assets;
1510
using Squidex.ClientLibrary.Management;
1611
using Xunit;
1712

cli/Squidex.CLI/Squidex.CLI.Tests/MapCSVToSquidexTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
// ==========================================================================
77

88
using System.Globalization;
9-
using System.IO;
10-
using System.Linq;
119
using System.Text;
1210
using CsvHelper;
1311
using Newtonsoft.Json;

cli/Squidex.CLI/Squidex.CLI.Tests/MapJsonToSquidexTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
9-
using System.Linq;
108
using Newtonsoft.Json;
119
using Newtonsoft.Json.Linq;
1210
using Squidex.CLI.Commands.Implementation;

cli/Squidex.CLI/Squidex.CLI.Tests/MapSquidexToCSVTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Linq;
108
using Newtonsoft.Json.Linq;
119
using Squidex.CLI.Commands.Implementation;
1210
using Squidex.CLI.Commands.Implementation.ImExport;

cli/Squidex.CLI/Squidex.CLI.Tests/Squidex.CLI.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<TargetFramework>net6.0</TargetFramework>
44
<Nullable>enable</Nullable>
5+
<ImplicitUsings>enable</ImplicitUsings>
56
</PropertyGroup>
67
<ItemGroup>
78
<PackageReference Include="FakeItEasy" Version="7.2.0" />

cli/Squidex.CLI/Squidex.CLI.Tests/TestDataGeneratorTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.Linq;
118
using Newtonsoft.Json.Linq;
129
using Squidex.CLI.Commands.Implementation.TestData;
1310
using Squidex.ClientLibrary.Management;

cli/Squidex.CLI/Squidex.CLI/Commands/App_Apps.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.Threading.Tasks;
98
using CommandDotNet;
109
using ConsoleTables;
1110
using FluentValidation;

cli/Squidex.CLI/Squidex.CLI/Commands/App_Assets.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.IO;
11-
using System.Linq;
12-
using System.Threading.Tasks;
138
using CommandDotNet;
149
using FluentValidation;
1510
using HeyRed.Mime;
1611
using Squidex.CLI.Commands.Implementation;
1712
using Squidex.CLI.Commands.Implementation.FileSystem;
13+
using Squidex.CLI.Commands.Implementation.Sync;
1814
using Squidex.CLI.Commands.Implementation.Sync.Assets;
1915
using Squidex.CLI.Configuration;
2016
using Squidex.ClientLibrary.Management;
@@ -46,7 +42,7 @@ public async Task Import(ImportArguments arguments)
4642

4743
using (var fs = await FileSystems.CreateAsync(arguments.Path, session.WorkingDirectory))
4844
{
49-
var folderTree = new FolderTree(session);
45+
var folders = new FolderTree(session);
5046

5147
var assetQuery = new AssetQuery();
5248

@@ -59,7 +55,7 @@ public async Task Import(ImportArguments arguments)
5955
targetFolder = Path.Combine(arguments.TargetFolder, targetFolder);
6056
}
6157

62-
assetQuery.ParentId = await folderTree.GetIdAsync(targetFolder);
58+
assetQuery.ParentId = await folders.GetIdAsync(targetFolder);
6359
assetQuery.Filter = $"fileName eq '{file.Name}'";
6460

6561
var existings = await assets.GetAssetsAsync(session.App, assetQuery);

cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.IO;
10-
using System.Threading;
11-
using System.Threading.Tasks;
128
using CommandDotNet;
139
using FluentValidation;
1410
using Squidex.CLI.Commands.Implementation;

cli/Squidex.CLI/Squidex.CLI/Commands/App_Content.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
108
using System.Globalization;
11-
using System.IO;
12-
using System.Linq;
13-
using System.Threading.Tasks;
149
using CommandDotNet;
1510
using CsvHelper;
1611
using CsvHelper.Configuration;

cli/Squidex.CLI/Squidex.CLI/Commands/App_Log.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
98
using System.Globalization;
10-
using System.IO;
11-
using System.Linq;
129
using CommandDotNet;
1310
using ConsoleTables;
1411
using CsvHelper;

cli/Squidex.CLI/Squidex.CLI/Commands/App_OpenLibrary.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
9-
using System.Threading.Tasks;
108
using CommandDotNet;
119
using FluentValidation;
1210
using Squidex.CLI.Commands.Implementation;

cli/Squidex.CLI/Squidex.CLI/Commands/App_Schemas.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
9-
using System.Linq;
10-
using System.Threading.Tasks;
118
using CommandDotNet;
129
using ConsoleTables;
1310
using FluentValidation;

cli/Squidex.CLI/Squidex.CLI/Commands/App_Sync.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.Threading.Tasks;
98
using CommandDotNet;
109
using FluentValidation;
1110
using Squidex.CLI.Commands.Implementation;
@@ -102,6 +101,9 @@ public sealed class InArguments : AppArguments
102101
[Option("recreate", Description = "Use this flag to also recreate entities.")]
103102
public bool Recreate { get; set; }
104103

104+
[Option("skip-assets", Description = "Use this flag to sync asset folders but not assets.")]
105+
public bool SkipAssets { get; set; }
106+
105107
[Option("update-current-client", Description = "Also update the client that is used during the sync process.")]
106108
public bool UpdateCurrentClient { get; set; }
107109

cli/Squidex.CLI/Squidex.CLI/Commands/App_Twitter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
9-
using System.Threading.Tasks;
108
using CommandDotNet;
119
using CoreTweet;
1210
using FluentValidation;

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/CLIException.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
98
using System.Runtime.Serialization;
109

1110
namespace Squidex.CLI.Commands.Implementation

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/ConsoleLogger.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
108
namespace Squidex.CLI.Commands.Implementation
119
{
1210
public class ConsoleLogger : ILogger

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/Extensions.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.IO;
11-
using System.Linq;
128
using System.Security.Cryptography;
139
using System.Text;
1410
using System.Text.RegularExpressions;
15-
using System.Threading.Tasks;
1611
using Newtonsoft.Json;
1712

1813
namespace Squidex.CLI.Commands.Implementation
@@ -33,16 +28,6 @@ public static bool JsonEquals<T, TOther>(this T lhs, TOther rhsOther)
3328
return lhsJson == rhsJson;
3429
}
3530

36-
public static bool SetEquals(this IEnumerable<string> lhs, IEnumerable<string> rhs)
37-
{
38-
if (rhs == null)
39-
{
40-
return false;
41-
}
42-
43-
return new HashSet<string>(lhs).SetEquals(rhs);
44-
}
45-
4631
public static bool HasDistinctNames<T>(this ICollection<T> source, Func<T, string> selector)
4732
{
4833
return source.Select(selector).Where(x => !string.IsNullOrWhiteSpace(x)).Distinct().Count() == source.Count;

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/Default/DefaultFile.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.IO;
10-
118
namespace Squidex.CLI.Commands.Implementation.FileSystem.Default
129
{
1310
public sealed class DefaultFile : IFile

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/Default/DefaultFileSystem.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.IO;
11-
using System.Linq;
12-
using System.Threading.Tasks;
13-
148
namespace Squidex.CLI.Commands.Implementation.FileSystem.Default
159
{
1610
public sealed class DefaultFileSystem : IFileSystem

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/Emedded/EmbeddedFile.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.IO;
108
using System.Reflection;
119

1210
namespace Squidex.CLI.Commands.Implementation.FileSystem.Emedded

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/Emedded/EmbeddedFileSystem.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.Linq;
118
using System.Reflection;
12-
using System.Threading.Tasks;
139

1410
namespace Squidex.CLI.Commands.Implementation.FileSystem.Emedded
1511
{

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/FileExtensions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
9-
using System.Linq;
10-
118
namespace Squidex.CLI.Commands.Implementation.FileSystem
129
{
1310
public static class FileExtensions

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/FilePath.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
9-
using System.Linq;
10-
118
namespace Squidex.CLI.Commands.Implementation.FileSystem
129
{
1310
public sealed class FilePath

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/FileSystems.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.IO;
10-
using System.Threading.Tasks;
118
using Squidex.CLI.Commands.Implementation.FileSystem.Default;
129
using Squidex.CLI.Commands.Implementation.FileSystem.Emedded;
1310
using Squidex.CLI.Commands.Implementation.FileSystem.Git;

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/Git/GitFileSystem.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.IO;
11-
using System.Threading.Tasks;
128
using LibGit2Sharp;
139
using Squidex.CLI.Commands.Implementation.FileSystem.Default;
1410
using Squidex.Text;

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/IFile.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
9-
108
namespace Squidex.CLI.Commands.Implementation.FileSystem
119
{
1210
public interface IFile

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/IFileSystem.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.Threading.Tasks;
11-
128
namespace Squidex.CLI.Commands.Implementation.FileSystem
139
{
1410
public interface IFileSystem : IDisposable

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/Zip/ZipFile.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
98
using System.IO.Compression;
109

1110
namespace Squidex.CLI.Commands.Implementation.FileSystem.Zip

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/FileSystem/Zip/ZipFileSystem.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
10-
using System.IO;
118
using System.IO.Compression;
12-
using System.Linq;
13-
using System.Threading.Tasks;
149

1510
namespace Squidex.CLI.Commands.Implementation.FileSystem.Zip
1611
{

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/ILogLine.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
108
namespace Squidex.CLI.Commands.Implementation
119
{
1210
public interface ILogLine : IDisposable
1311
{
1412
void WriteLine(string message, params object[] args);
1513
}
16-
}
14+
}

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/ISession.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System.IO;
98
using Squidex.ClientLibrary;
109
using Squidex.ClientLibrary.Management;
1110

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/ImExport/Csv2SquidexConverter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using System;
9-
using System.Collections.Generic;
108
using CsvHelper;
119
using Newtonsoft.Json;
1210
using Newtonsoft.Json.Linq;

0 commit comments

Comments
 (0)