Browse Source

Ng5 and angular update. (#595)

* Ng5 and angular update.

* Updates

* Build fix

* Dockerfile fixed

* Update drone to net5

* Another test

* Force build

* Warnings fixed

* Code fixes and imports removed.
pull/597/head
Sebastian Stehle 6 years ago
committed by GitHub
parent
commit
d2f85d8775
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .drone.yml
  2. 4
      Dockerfile
  3. 2
      README.md
  4. 3
      backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs
  5. 2
      backend/extensions/Squidex.Extensions/Actions/Kafka/KafkaActionHandler.cs
  6. 2
      backend/extensions/Squidex.Extensions/Actions/Medium/MediumActionHandler.cs
  7. 2
      backend/extensions/Squidex.Extensions/Actions/RuleHelper.cs
  8. 2
      backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs
  9. 18
      backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj
  10. 2
      backend/i18n/translator/Squidex.Translator/Squidex.Translator.csproj
  11. 2
      backend/src/Migrations/MigrationPath.cs
  12. 4
      backend/src/Migrations/Migrations.csproj
  13. 2
      backend/src/Migrations/Migrations/MongoDb/AddAppIdToEventStream.cs
  14. 2
      backend/src/Migrations/Migrations/MongoDb/ConvertDocumentIds.cs
  15. 2
      backend/src/Migrations/OldEvents/AppClientChanged.cs
  16. 2
      backend/src/Migrations/OldEvents/AppClientPermission.cs
  17. 2
      backend/src/Migrations/OldEvents/AppClientUpdated.cs
  18. 2
      backend/src/Migrations/OldEvents/AppContributorAssigned.cs
  19. 2
      backend/src/Migrations/OldEvents/AppContributorPermission.cs
  20. 2
      backend/src/Migrations/OldEvents/AppPlanChanged.cs
  21. 2
      backend/src/Migrations/OldEvents/AppWorkflowConfigured.cs
  22. 2
      backend/src/Migrations/OldEvents/AssetCreated.cs
  23. 2
      backend/src/Migrations/OldEvents/AssetRenamed.cs
  24. 2
      backend/src/Migrations/OldEvents/AssetTagged.cs
  25. 2
      backend/src/Migrations/OldEvents/ContentArchived.cs
  26. 2
      backend/src/Migrations/OldEvents/ContentChangesDiscarded.cs
  27. 2
      backend/src/Migrations/OldEvents/ContentChangesPublished.cs
  28. 2
      backend/src/Migrations/OldEvents/ContentCreated.cs
  29. 2
      backend/src/Migrations/OldEvents/ContentPublished.cs
  30. 2
      backend/src/Migrations/OldEvents/ContentRestored.cs
  31. 2
      backend/src/Migrations/OldEvents/ContentStatusChanged.cs
  32. 2
      backend/src/Migrations/OldEvents/ContentUnpublished.cs
  33. 2
      backend/src/Migrations/OldEvents/ContentUpdateProposed.cs
  34. 2
      backend/src/Migrations/OldEvents/SchemaCreated.cs
  35. 2
      backend/src/Migrations/OldEvents/ScriptsConfigured.cs
  36. 2
      backend/src/Migrations/OldEvents/WebhookAdded.cs
  37. 2
      backend/src/Migrations/OldEvents/WebhookDeleted.cs
  38. 46
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClient.cs
  39. 44
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClients.cs
  40. 3
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppImage.cs
  41. 26
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPattern.cs
  42. 20
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPatterns.cs
  43. 3
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPlan.cs
  44. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/Json/JsonLanguagesConfig.cs
  45. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/LanguagesConfig.cs
  46. 4
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/Roles.cs
  47. 19
      backend/src/Squidex.Domain.Apps.Core.Model/Contents/ContentData.cs
  48. 5
      backend/src/Squidex.Domain.Apps.Core.Model/Contents/IdContentData.cs
  49. 5
      backend/src/Squidex.Domain.Apps.Core.Model/Contents/NamedContentData.cs
  50. 3
      backend/src/Squidex.Domain.Apps.Core.Model/Contents/Status.cs
  51. 5
      backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleAction.cs
  52. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldCollection.cs
  53. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/Json/JsonSchemaModel.cs
  54. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/NestedField{T}.cs
  55. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/RootField{T}.cs
  56. 11
      backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj
  57. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/FieldConverters.cs
  58. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/DefaultValues/DefaultValueFactory.cs
  59. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs
  60. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs
  61. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleTriggerHandler.cs
  62. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs
  63. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentFieldObject.cs
  64. 8
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/JintScriptEngine.cs
  65. 15
      backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj
  66. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/SquidexCoreOperations.cs
  67. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ContentValidator.cs
  68. 3
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ObjectPath.cs
  69. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/CollectionValidator.cs
  70. 6
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Squidex.Domain.Apps.Entities.MongoDb.csproj
  71. 4
      backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs
  72. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/State/AppState.cs
  73. 2
      backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetFolderState.cs
  74. 2
      backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetState.cs
  75. 2
      backend/src/Squidex.Domain.Apps.Entities/Backup/BackupReader.cs
  76. 2
      backend/src/Squidex.Domain.Apps.Entities/Comments/CommentsCommandMiddleware.cs
  77. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/BulkUpdateCommandMiddleware.cs
  78. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs
  79. 1
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentGraphType.cs
  80. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Extensions.cs
  81. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/Operations/ContentOperationContext.cs
  82. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs
  83. 12
      backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/FilterTagTransformer.cs
  84. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs
  85. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/State/ContentState.cs
  86. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs
  87. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Extensions.cs
  88. 3
      backend/src/Squidex.Domain.Apps.Entities/Rules/State/RuleState.cs
  89. 2
      backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardHelper.cs
  90. 3
      backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardSchema.cs
  91. 2
      backend/src/Squidex.Domain.Apps.Entities/Schemas/State/SchemaState.cs
  92. 16
      backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj
  93. 2
      backend/src/Squidex.Domain.Apps.Entities/SquidexEntities.cs
  94. 5
      backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs
  95. 4
      backend/src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj
  96. 5
      backend/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs
  97. 10
      backend/src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj
  98. 10
      backend/src/Squidex.Domain.Users/Squidex.Domain.Users.csproj
  99. 2
      backend/src/Squidex.Infrastructure.Azure/EventSourcing/FilterExtensions.cs
  100. 4
      backend/src/Squidex.Infrastructure.Azure/EventSourcing/StreamPosition.cs

2
.drone.yml

@ -52,7 +52,7 @@ steps:
- release/*
- name: test_run
image: mcr.microsoft.com/dotnet/core/sdk:3.1-buster
image: mcr.microsoft.com/dotnet/sdk:5.0
environment:
CONFIG__SERVER__URL: http://localhost:8080
CONFIG__WAIT: 60

4
Dockerfile

@ -1,7 +1,7 @@
#
# Stage 1, Build Backend
#
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster as backend
FROM mcr.microsoft.com/dotnet/sdk:5.0 as backend
ARG SQUIDEX__VERSION=4.0.0
@ -59,7 +59,7 @@ RUN cp -a build /build/
#
# Stage 3, Build runtime
#
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim
FROM mcr.microsoft.com/dotnet/aspnet:5.0.0-buster-slim
# Default AspNetCore directory
WORKDIR /app

2
README.md

@ -1,6 +1,6 @@
![Squidex Logo](https://raw.githubusercontent.com/Squidex/squidex/master/media/logo-wide.png "Squidex")
# What is Squidex??
# What is Squidex?
Squidex is an open source headless CMS and content management hub. In contrast to a traditional CMS Squidex provides a rich API with OData filter and Swagger definitions. It is up to you to build your UI on top of it. It can be website, a native app or just another server. We build it with ASP.NET Core and CQRS and is tested for Windows and Linux on modern browsers.

3
backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs

@ -62,7 +62,8 @@ namespace Squidex.Extensions.Actions.Email
job.MessageFrom,
job.MessageTo,
job.MessageSubject,
job.MessageBody);
job.MessageBody,
ct);
}
}

2
backend/extensions/Squidex.Extensions/Actions/Kafka/KafkaActionHandler.cs

@ -79,7 +79,7 @@ namespace Squidex.Extensions.Actions.Kafka
if (indexEqual > 0 && indexEqual < line.Length - 1)
{
var key = line.Substring(0, indexEqual);
var val = line.Substring(indexEqual + 1);
var val = line[(indexEqual + 1)..];
val = await FormatAsync(val, @event);

2
backend/extensions/Squidex.Extensions/Actions/Medium/MediumActionHandler.cs

@ -103,7 +103,7 @@ namespace Squidex.Extensions.Actions.Medium
{
response = await httpClient.SendAsync(meRequest, ct);
var responseString = await response.Content.ReadAsStringAsync();
var responseString = await response.Content.ReadAsStringAsync(ct);
var responseJson = serializer.Deserialize<UserResponse>(responseString);
var id = responseJson.Data?.Id;

2
backend/extensions/Squidex.Extensions/Actions/RuleHelper.cs

@ -53,7 +53,7 @@ namespace Squidex.Extensions.Actions
{
response = await client.SendAsync(request, ct);
var responseString = await response.Content.ReadAsStringAsync();
var responseString = await response.Content.ReadAsStringAsync(ct);
var requestDump = DumpFormatter.BuildDump(request, response, requestBody, responseString);
if (!response.IsSuccessStatusCode)

2
backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs

@ -81,7 +81,7 @@ namespace Squidex.Extensions.Actions.Webhook
if (indexEqual > 0 && indexEqual < line.Length - 1)
{
var key = line.Substring(0, indexEqual);
var val = line.Substring(indexEqual + 1);
var val = line[(indexEqual + 1)..];
val = await FormatAsync(val, @event);

18
backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Squidex.Domain.Apps.Core.Operations\Squidex.Domain.Apps.Core.Operations.csproj" />
@ -10,19 +10,19 @@
<ItemGroup>
<PackageReference Include="Algolia.Search" Version="6.8.0" />
<PackageReference Include="Confluent.Apache.Avro" Version="1.7.7.7" />
<PackageReference Include="Confluent.Kafka" Version="1.5.1" />
<PackageReference Include="Confluent.Kafka" Version="1.5.2" />
<PackageReference Include="Confluent.SchemaRegistry.Serdes" Version="1.3.0" />
<PackageReference Include="CoreTweet" Version="1.0.0.483" />
<PackageReference Include="Datadog.Trace" Version="1.19.5" />
<PackageReference Include="Elasticsearch.Net" Version="7.9.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.15.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.8" />
<PackageReference Include="Microsoft.OData.Core" Version="7.7.2" />
<PackageReference Include="Datadog.Trace" Version="1.20.0" />
<PackageReference Include="Elasticsearch.Net" Version="7.10.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.16.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="Microsoft.OData.Core" Version="7.7.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NodaTime" Version="3.0.3" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
</ItemGroup>

2
backend/i18n/translator/Squidex.Translator/Squidex.Translator.csproj

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

2
backend/src/Migrations/MigrationPath.cs

@ -38,7 +38,7 @@ namespace Migrations
return (CurrentVersion, migrations);
}
private IEnumerable<IMigration> ResolveMigrators(int version)
private IEnumerable<IMigration?> ResolveMigrators(int version)
{
yield return serviceProvider.GetRequiredService<StopEventConsumers>();

4
backend/src/Migrations/Migrations.csproj

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>

2
backend/src/Migrations/Migrations/MongoDb/AddAppIdToEventStream.cs

@ -65,7 +65,7 @@ namespace Migrations.Migrations.MongoDb
}
var domainType = eventStream.Substring(0, indexOfType);
var domainId = eventStream.Substring(indexOfId);
var domainId = eventStream[indexOfId..];
if (!eventStream.StartsWith("app-", StringComparison.OrdinalIgnoreCase))
{

2
backend/src/Migrations/Migrations/MongoDb/ConvertDocumentIds.cs

@ -108,7 +108,7 @@ namespace Migrations.Migrations.MongoDb
{
var index = documentIdOld.LastIndexOf("--", StringComparison.OrdinalIgnoreCase);
documentIdOld = documentIdOld.Substring(index + 2);
documentIdOld = documentIdOld[(index + 2)..];
}
var documentIdNew = DomainId.Combine(DomainId.Create(appId), DomainId.Create(documentIdOld)).ToString();

2
backend/src/Migrations/OldEvents/AppClientChanged.cs

@ -14,7 +14,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(AppClientChanged))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class AppClientChanged : AppEvent, IMigrated<IEvent>
{
public string Id { get; set; }

2
backend/src/Migrations/OldEvents/AppClientPermission.cs

@ -9,7 +9,7 @@ using System;
namespace Migrations.OldEvents
{
[Obsolete]
[Obsolete("New Event introduced")]
public enum AppClientPermission
{
Developer,

2
backend/src/Migrations/OldEvents/AppClientUpdated.cs

@ -16,7 +16,7 @@ using AppClientUpdatedV2 = Squidex.Domain.Apps.Events.Apps.AppClientUpdated;
namespace Migrations.OldEvents
{
[EventType(nameof(AppClientUpdated))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class AppClientUpdated : AppEvent, IMigrated<IEvent>
{
public string Id { get; set; }

2
backend/src/Migrations/OldEvents/AppContributorAssigned.cs

@ -16,7 +16,7 @@ using AppContributorAssignedV2 = Squidex.Domain.Apps.Events.Apps.AppContributorA
namespace Migrations.OldEvents
{
[EventType(nameof(AppContributorAssigned))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class AppContributorAssigned : AppEvent, IMigrated<IEvent>
{
public string ContributorId { get; set; }

2
backend/src/Migrations/OldEvents/AppContributorPermission.cs

@ -9,7 +9,7 @@ using System;
namespace Migrations.OldEvents
{
[Obsolete]
[Obsolete("New Event introduced")]
public enum AppContributorPermission
{
Owner,

2
backend/src/Migrations/OldEvents/AppPlanChanged.cs

@ -16,7 +16,7 @@ using AppPlanChangedV2 = Squidex.Domain.Apps.Events.Apps.AppPlanChanged;
namespace Migrations.OldEvents
{
[TypeName("AppPlanChanged")]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class AppPlanChanged : AppEvent, IMigrated<IEvent>
{
public string PlanId { get; set; }

2
backend/src/Migrations/OldEvents/AppWorkflowConfigured.cs

@ -16,7 +16,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(AppWorkflowConfigured))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class AppWorkflowConfigured : AppEvent, IMigrated<IEvent>
{
public Workflow Workflow { get; set; }

2
backend/src/Migrations/OldEvents/AssetCreated.cs

@ -17,7 +17,7 @@ using AssetCreatedV2 = Squidex.Domain.Apps.Events.Assets.AssetCreated;
namespace Migrations.OldEvents
{
[EventType(nameof(AssetCreated))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class AssetCreated : AssetEvent, IMigrated<IEvent>
{
public Guid ParentId { get; set; }

2
backend/src/Migrations/OldEvents/AssetRenamed.cs

@ -14,7 +14,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(AssetRenamed))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class AssetRenamed : AssetEvent, IMigrated<IEvent>
{
public string FileName { get; set; }

2
backend/src/Migrations/OldEvents/AssetTagged.cs

@ -15,7 +15,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(AssetTagged))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class AssetTagged : AssetEvent, IMigrated<IEvent>
{
public HashSet<string> Tags { get; set; }

2
backend/src/Migrations/OldEvents/ContentArchived.cs

@ -15,7 +15,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(ContentArchived))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentArchived : ContentEvent, IMigrated<IEvent>
{
public IEvent Migrate()

2
backend/src/Migrations/OldEvents/ContentChangesDiscarded.cs

@ -14,7 +14,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(ContentChangesDiscarded))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentChangesDiscarded : ContentEvent, IMigrated<IEvent>
{
public IEvent Migrate()

2
backend/src/Migrations/OldEvents/ContentChangesPublished.cs

@ -16,7 +16,7 @@ using ContentStatusChangedV2 = Squidex.Domain.Apps.Events.Contents.ContentStatus
namespace Migrations.OldEvents
{
[EventType(nameof(ContentChangesPublished))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentChangesPublished : ContentEvent, IMigrated<IEvent>
{
public IEvent Migrate()

2
backend/src/Migrations/OldEvents/ContentCreated.cs

@ -16,7 +16,7 @@ using ContentCreatedV2 = Squidex.Domain.Apps.Events.Contents.ContentCreated;
namespace Migrations.OldEvents
{
[EventType(nameof(ContentCreated))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentCreated : ContentEvent, IMigrated<IEvent>
{
public Status Status { get; set; }

2
backend/src/Migrations/OldEvents/ContentPublished.cs

@ -15,7 +15,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(ContentPublished))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentPublished : ContentEvent, IMigrated<IEvent>
{
public IEvent Migrate()

2
backend/src/Migrations/OldEvents/ContentRestored.cs

@ -15,7 +15,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(ContentRestored))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentRestored : ContentEvent, IMigrated<IEvent>
{
public IEvent Migrate()

2
backend/src/Migrations/OldEvents/ContentStatusChanged.cs

@ -16,7 +16,7 @@ using ContentStatusChangedV2 = Squidex.Domain.Apps.Events.Contents.ContentStatus
namespace Migrations.OldEvents
{
[EventType(nameof(ContentStatusChanged))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentStatusChanged : ContentEvent, IMigrated<IEvent>
{
public string Change { get; set; }

2
backend/src/Migrations/OldEvents/ContentUnpublished.cs

@ -15,7 +15,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(ContentUnpublished))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentUnpublished : ContentEvent, IMigrated<IEvent>
{
public IEvent Migrate()

2
backend/src/Migrations/OldEvents/ContentUpdateProposed.cs

@ -15,7 +15,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(ContentUpdateProposed))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ContentUpdateProposed : ContentEvent, IMigrated<IEvent>
{
public NamedContentData Data { get; set; }

2
backend/src/Migrations/OldEvents/SchemaCreated.cs

@ -18,7 +18,7 @@ using SchemaFields = System.Collections.Generic.List<Squidex.Domain.Apps.Events.
namespace Migrations.OldEvents
{
[EventType(nameof(SchemaCreated))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class SchemaCreated : SchemaEvent, IMigrated<IEvent>
{
public string Name { get; set; }

2
backend/src/Migrations/OldEvents/ScriptsConfigured.cs

@ -16,7 +16,7 @@ using Squidex.Infrastructure.Reflection;
namespace Migrations.OldEvents
{
[EventType(nameof(ScriptsConfigured))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class ScriptsConfigured : SchemaEvent, IMigrated<IEvent>
{
public string ScriptQuery { get; set; }

2
backend/src/Migrations/OldEvents/WebhookAdded.cs

@ -12,7 +12,7 @@ using Squidex.Infrastructure.EventSourcing;
namespace Migrations.OldEvents
{
[EventType(nameof(WebhookAdded))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class WebhookAdded : SchemaEvent
{
public Guid Id { get; set; }

2
backend/src/Migrations/OldEvents/WebhookDeleted.cs

@ -12,7 +12,7 @@ using Squidex.Infrastructure.EventSourcing;
namespace Migrations.OldEvents
{
[EventType(nameof(WebhookDeleted))]
[Obsolete]
[Obsolete("New Event introduced")]
public sealed class WebhookDeleted : SchemaEvent
{
public Guid Id { get; set; }

46
backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClient.cs

@ -5,52 +5,18 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Diagnostics.Contracts;
using Squidex.Infrastructure;
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter
namespace Squidex.Domain.Apps.Core.Apps
{
[Equals(DoNotAddEqualityOperators = true)]
public sealed class AppClient : Named
public sealed record AppClient(string Name, string Secret)
{
public string Role { get; }
public string Role { get; init; } = "Editor";
public string Secret { get; }
public long ApiCallsLimit { get; init; }
public long ApiCallsLimit { get; }
public long ApiTrafficLimit { get; init; }
public long ApiTrafficLimit { get; }
public bool AllowAnonymous { get; }
public AppClient(string name, string secret, string role, long apiCallsLimit = 0, long apiTrafficLimit = 0, bool allowAnonymous = false)
: base(name)
{
Guard.NotNullOrEmpty(secret, nameof(secret));
Guard.NotNullOrEmpty(role, nameof(role));
Guard.GreaterEquals(apiCallsLimit, 0, nameof(apiCallsLimit));
Guard.GreaterEquals(apiTrafficLimit, 0, nameof(apiTrafficLimit));
Secret = secret;
Role = role;
ApiCallsLimit = apiCallsLimit;
ApiTrafficLimit = apiTrafficLimit;
AllowAnonymous = allowAnonymous;
}
[Pure]
public AppClient Update(string? name, string? role,
long? apiCallsLimit,
long? apiTrafficLimit,
bool? allowAnonymous)
{
return new AppClient(name.Or(Name), Secret, role.Or(Role),
apiCallsLimit ?? ApiCallsLimit,
apiTrafficLimit ?? ApiTrafficLimit,
allowAnonymous ?? AllowAnonymous);
}
public bool AllowAnonymous { get; init; }
}
}

44
backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClients.cs

@ -35,27 +35,22 @@ namespace Squidex.Domain.Apps.Core.Apps
}
[Pure]
public AppClients Add(string id, AppClient client)
{
Guard.NotNullOrEmpty(id, nameof(id));
Guard.NotNull(client, nameof(client));
return With<AppClients>(id, client);
}
[Pure]
public AppClients Add(string id, string secret)
public AppClients Add(string id, string secret, string? role = null)
{
Guard.NotNullOrEmpty(id, nameof(id));
Guard.NotNullOrEmpty(secret, nameof(secret));
if (ContainsKey(id))
{
throw new ArgumentException("Id already exists.", nameof(id));
}
var newClient = new AppClient(id, secret, Role.Editor);
var newClient = new AppClient(id, secret)
{
Role = role.Or(Role.Editor)
};
return Add(id, newClient);
return With<AppClients>(id, newClient);
}
[Pure]
@ -71,7 +66,30 @@ namespace Squidex.Domain.Apps.Core.Apps
return this;
}
var newClient = client.Update(name, role, apiCallsLimit, apiTrafficLimit, allowAnonymous);
var newClient = client with
{
AllowAnonymous = allowAnonymous ?? client.AllowAnonymous
};
if (!string.IsNullOrWhiteSpace(name))
{
newClient = newClient with { Name = name };
}
if (!string.IsNullOrWhiteSpace(role))
{
newClient = newClient with { Role = role };
}
if (apiCallsLimit >= 0)
{
newClient = newClient with { ApiCallsLimit = apiCallsLimit.Value };
}
if (apiTrafficLimit >= 0)
{
newClient = newClient with { ApiTrafficLimit = apiTrafficLimit.Value };
}
return With<AppClients>(id, newClient);
}

3
backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppImage.cs

@ -9,8 +9,7 @@ using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Core.Apps
{
[Equals(DoNotAddEqualityOperators = true)]
public sealed class AppImage
public sealed record AppImage
{
public string MimeType { get; }

26
backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPattern.cs

@ -5,32 +5,12 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Diagnostics.Contracts;
using Squidex.Infrastructure;
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter
namespace Squidex.Domain.Apps.Core.Apps
{
[Equals(DoNotAddEqualityOperators = true)]
public sealed class AppPattern : Named
public sealed record AppPattern(string Name, string Pattern)
{
public string Pattern { get; }
public string? Message { get; }
public AppPattern(string name, string pattern, string? message = null)
: base(name)
{
Guard.NotNullOrEmpty(pattern, nameof(pattern));
Pattern = pattern;
Message = message;
}
[Pure]
public AppPattern Update(string? name, string? pattern, string? message)
{
return new AppPattern(name.Or(Name), pattern.Or(Pattern), message);
}
public string? Message { get; init; }
}
}

20
backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPatterns.cs

@ -34,7 +34,10 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public AppPatterns Add(DomainId id, string name, string pattern, string? message = null)
{
var newPattern = new AppPattern(name, pattern, message);
Guard.NotNullOrEmpty(name, nameof(name));
Guard.NotNullOrEmpty(pattern, nameof(pattern));
var newPattern = new AppPattern(name, pattern) { Message = message };
return With<AppPatterns>(id, newPattern);
}
@ -47,7 +50,20 @@ namespace Squidex.Domain.Apps.Core.Apps
return this;
}
var newPattern = appPattern.Update(name, pattern, message);
var newPattern = appPattern with
{
Message = message
};
if (!string.IsNullOrWhiteSpace(name))
{
newPattern = newPattern with { Name = name };
}
if (!string.IsNullOrWhiteSpace(pattern))
{
newPattern = newPattern with { Pattern = pattern };
}
return With<AppPatterns>(id, newPattern);
}

3
backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPlan.cs

@ -9,8 +9,7 @@ using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Core.Apps
{
[Equals(DoNotAddEqualityOperators = true)]
public sealed class AppPlan
public sealed record AppPlan
{
public RefToken Owner { get; }

2
backend/src/Squidex.Domain.Apps.Core.Model/Apps/Json/JsonLanguagesConfig.cs

@ -34,7 +34,7 @@ namespace Squidex.Domain.Apps.Core.Apps.Json
{
var languages = Languages.ToDictionary(x => x.Key, x => x.Value.ToConfig());
var master = Master ?? languages.Keys.FirstOrDefault();
var master = Master ?? languages.Keys.First();
return new LanguagesConfig(languages, master);
}

2
backend/src/Squidex.Domain.Apps.Core.Model/Apps/LanguagesConfig.cs

@ -10,8 +10,6 @@ using System.Diagnostics.Contracts;
using System.Linq;
using Squidex.Infrastructure;
#pragma warning disable IDE0028 // Simplify collection initialization
namespace Squidex.Domain.Apps.Core.Apps
{
public sealed class LanguagesConfig : IFieldPartitioning

4
backend/src/Squidex.Domain.Apps.Core.Model/Apps/Roles.cs

@ -175,7 +175,7 @@ namespace Squidex.Domain.Apps.Core.Apps
if (permission.StartsWith(prefix.Id, StringComparison.OrdinalIgnoreCase))
{
permission = permission.Substring(prefix.Id.Length);
permission = permission[prefix.Id.Length..];
}
if (permission.Length == 0)
@ -183,7 +183,7 @@ namespace Squidex.Domain.Apps.Core.Apps
return Permission.Any;
}
return permission.Substring(1);
return permission[1..];
}
private static Dictionary<string, Role> Cleaned(Dictionary<string, Role> inner)

19
backend/src/Squidex.Domain.Apps.Core.Model/Contents/ContentData.cs

@ -70,16 +70,19 @@ namespace Squidex.Domain.Apps.Core.Contents
{
foreach (var fieldValue in source.ValidValues)
{
var resultValue = new ContentFieldData();
foreach (var (key, value) in fieldValue.Value.Where(x => x.Value.Type != JsonValueType.Null))
if (fieldValue.Value != null)
{
resultValue[key] = value;
}
var resultValue = new ContentFieldData();
if (resultValue.Count > 0)
{
target[fieldValue.Key] = resultValue;
foreach (var (key, value) in fieldValue.Value.Where(x => x.Value.Type != JsonValueType.Null))
{
resultValue[key] = value;
}
if (resultValue.Count > 0)
{
target[fieldValue.Key] = resultValue;
}
}
}

5
backend/src/Squidex.Domain.Apps.Core.Model/Contents/IdContentData.cs

@ -7,9 +7,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Squidex.Infrastructure;
#pragma warning disable CA1067 // Override Object.Equals(object) when implementing IEquatable<T>
namespace Squidex.Domain.Apps.Core.Contents
{
public sealed class IdContentData : ContentData<long>, IEquatable<IdContentData>
@ -48,7 +49,7 @@ namespace Squidex.Domain.Apps.Core.Contents
return this;
}
public bool Equals([AllowNull] IdContentData other)
public bool Equals(IdContentData? other)
{
return base.Equals(other);
}

5
backend/src/Squidex.Domain.Apps.Core.Model/Contents/NamedContentData.cs

@ -6,10 +6,11 @@
// ==========================================================================
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Squidex.Infrastructure;
#pragma warning disable CA1067 // Override Object.Equals(object) when implementing IEquatable<T>
namespace Squidex.Domain.Apps.Core.Contents
{
public sealed class NamedContentData : ContentData<string>, IEquatable<NamedContentData>
@ -65,7 +66,7 @@ namespace Squidex.Domain.Apps.Core.Contents
return clone;
}
public bool Equals([AllowNull] NamedContentData other)
public bool Equals(NamedContentData? other)
{
return base.Equals(other);
}

3
backend/src/Squidex.Domain.Apps.Core.Model/Contents/Status.cs

@ -7,7 +7,6 @@
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace Squidex.Domain.Apps.Core.Contents
{
@ -50,7 +49,7 @@ namespace Squidex.Domain.Apps.Core.Contents
return Name;
}
public int CompareTo([AllowNull] Status other)
public int CompareTo(Status other)
{
return string.Compare(Name, other.Name, StringComparison.Ordinal);
}

5
backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleAction.cs

@ -24,7 +24,10 @@ namespace Squidex.Domain.Apps.Core.Rules
{
foreach (var error in errors)
{
yield return new ValidationError(error.ErrorMessage, error.MemberNames.ToArray());
if (!string.IsNullOrWhiteSpace(error.ErrorMessage))
{
yield return new ValidationError(error.ErrorMessage, error.MemberNames.ToArray());
}
}
}

2
backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldCollection.cs

@ -11,8 +11,6 @@ using System.Diagnostics.Contracts;
using System.Linq;
using Squidex.Infrastructure;
#pragma warning disable IDE0044 // Add readonly modifier
namespace Squidex.Domain.Apps.Core.Schemas
{
public sealed class FieldCollection<T> : Cloneable<FieldCollection<T>> where T : IField

2
backend/src/Squidex.Domain.Apps.Core.Model/Schemas/Json/JsonSchemaModel.cs

@ -12,8 +12,6 @@ using Newtonsoft.Json;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Reflection;
#pragma warning disable CS0612 // Type or member is obsolete
namespace Squidex.Domain.Apps.Core.Schemas.Json
{
public sealed class JsonSchemaModel

2
backend/src/Squidex.Domain.Apps.Core.Model/Schemas/NestedField{T}.cs

@ -59,7 +59,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
{
Guard.NotNull(newProperties, nameof(newProperties));
if (!(newProperties is T typedProperties))
if (newProperties is not T typedProperties)
{
throw new ArgumentException($"Properties must be of type '{typeof(T)}", nameof(newProperties));
}

2
backend/src/Squidex.Domain.Apps.Core.Model/Schemas/RootField{T}.cs

@ -57,7 +57,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
{
Guard.NotNull(newProperties, nameof(newProperties));
if (!(newProperties is T typedProperties))
if (newProperties is not T typedProperties)
{
throw new ArgumentException($"Properties must be of type '{typeof(T)}", nameof(newProperties));
}

11
backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Squidex.Domain.Apps.Core</RootNamespace>
<Nullable>enable</Nullable>
</PropertyGroup>
@ -10,17 +10,16 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Equals.Fody" Version="4.0.1" PrivateAssets="all" />
<PackageReference Include="Fody" Version="6.2.6">
<PackageReference Include="Fody" Version="6.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SquidexFreezable.Fody" Version="2.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Squidex.Infrastructure\Squidex.Infrastructure.csproj" />

2
backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/FieldConverters.cs

@ -15,8 +15,6 @@ using Squidex.Domain.Apps.Core.ValidateContent;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Json.Objects;
#pragma warning disable RECS0002 // Convert anonymous method to method group
namespace Squidex.Domain.Apps.Core.ConvertContent
{
public delegate ContentFieldData? FieldConverter(ContentFieldData data, IRootField field);

2
backend/src/Squidex.Domain.Apps.Core.Operations/DefaultValues/DefaultValueFactory.cs

@ -94,7 +94,7 @@ namespace Squidex.Domain.Apps.Core.DefaultValues
return JsonValue.Create(field.Properties.DefaultValue);
}
private IJsonValue Array(string[]? values)
private static IJsonValue Array(string[]? values)
{
if (values != null)
{

4
backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs

@ -11,9 +11,9 @@ using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
{
public sealed class ContentSchemaBuilder
public static class ContentSchemaBuilder
{
public JsonSchema CreateContentSchema(Schema schema, JsonSchema dataSchema)
public static JsonSchema CreateContentSchema(Schema schema, JsonSchema dataSchema)
{
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(dataSchema, nameof(dataSchema));

2
backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs

@ -188,7 +188,7 @@ namespace Squidex.Domain.Apps.Core.HandleRules
{
parts.Add(TextPart.Text(currentOffset, i - currentOffset));
var (length, part) = GetReplacement(span.Slice(i + 1).ToString(), @event);
var (length, part) = GetReplacement(span[(i + 1)..].ToString(), @event);
if (length > 0)
{

2
backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleTriggerHandler.cs

@ -14,8 +14,6 @@ using Squidex.Domain.Apps.Events;
using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing;
#pragma warning disable IDE0019 // Use pattern matching
namespace Squidex.Domain.Apps.Core.HandleRules
{
public abstract class RuleTriggerHandler<TTrigger, TEvent, TEnrichedEvent> : IRuleTriggerHandler

2
backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs

@ -16,8 +16,6 @@ using Jint.Runtime.Descriptors;
using Squidex.Domain.Apps.Core.Contents;
using Squidex.Infrastructure;
#pragma warning disable RECS0133 // Parameter name differs in base declaration
namespace Squidex.Domain.Apps.Core.Scripting.ContentWrapper
{
public sealed class ContentDataObject : ObjectInstance

2
backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentFieldObject.cs

@ -16,8 +16,6 @@ using Jint.Runtime.Descriptors;
using Squidex.Domain.Apps.Core.Contents;
using Squidex.Infrastructure;
#pragma warning disable RECS0133 // Parameter name differs in base declaration
namespace Squidex.Domain.Apps.Core.Scripting.ContentWrapper
{
public sealed class ContentFieldObject : ObjectInstance

8
backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/JintScriptEngine.cs

@ -52,7 +52,7 @@ namespace Squidex.Domain.Apps.Core.Scripting
using (cts.Token.Register(() => tcs.TrySetCanceled()))
{
var context = CreateEngine(vars, options, cts.Token, tcs.TrySetException, true);
var context = CreateEngine(vars, options, tcs.TrySetException, true, cts.Token);
context.Engine.SetValue("complete", new Action<JsValue?>(value =>
{
@ -82,7 +82,7 @@ namespace Squidex.Domain.Apps.Core.Scripting
using (cts.Token.Register(() => tcs.TrySetCanceled()))
{
var context = CreateEngine(vars, options, cts.Token, tcs.TrySetException, true);
var context = CreateEngine(vars, options, tcs.TrySetException, true, cts.Token);
context.Engine.SetValue("complete", new Action<JsValue?>(value =>
{
@ -133,7 +133,7 @@ namespace Squidex.Domain.Apps.Core.Scripting
return JsonMapper.Map(context.Engine.GetCompletionValue());
}
private ExecutionContext CreateEngine(ScriptVars vars, ScriptOptions options, CancellationToken cancellationToken = default, ExceptionHandler? exceptionHandler = null, bool async = false)
private ExecutionContext CreateEngine(ScriptVars vars, ScriptOptions options, ExceptionHandler? exceptionHandler = null, bool async = false, CancellationToken ct = default)
{
var engine = new Engine(options =>
{
@ -158,7 +158,7 @@ namespace Squidex.Domain.Apps.Core.Scripting
extension.Extend(engine);
}
var context = new ExecutionContext(engine, cancellationToken, exceptionHandler);
var context = new ExecutionContext(engine, ct, exceptionHandler);
context.AddVariables(vars, options);

15
backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Squidex.Domain.Apps.Core</RootNamespace>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -17,16 +17,15 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fluid.Core.Squidex" Version="1.0.0-beta" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.28" />
<PackageReference Include="Markdig" Version="0.22.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.8" />
<PackageReference Include="Microsoft.OData.Core" Version="7.7.2" />
<PackageReference Include="NJsonSchema" Version="10.2.2" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="Microsoft.OData.Core" Version="7.7.3" />
<PackageReference Include="NJsonSchema" Version="10.3.1" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="Squidex.Jint" Version="3.0.0-beta-0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="ValueTaskSupplement" Version="1.1.0" />
</ItemGroup>
<PropertyGroup>

2
backend/src/Squidex.Domain.Apps.Core.Operations/SquidexCoreOperations.cs

@ -7,8 +7,6 @@
using System.Reflection;
#pragma warning disable RECS0014 // If all fields, properties and methods members are static, the class can be made static.
namespace Squidex.Domain.Apps.Core
{
public static class SquidexCoreOperations

2
backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ContentValidator.cs

@ -17,8 +17,6 @@ using Squidex.Infrastructure.Json.Objects;
using Squidex.Infrastructure.Validation;
using Squidex.Log;
#pragma warning disable SA1028, IDE0004 // Code must not contain trailing whitespace
namespace Squidex.Domain.Apps.Core.ValidateContent
{
public sealed class ContentValidator

3
backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ObjectPath.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Collections.Generic;
using System.Text;
@ -28,7 +27,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent
{
if (property[0] != '[')
{
sb.Append(".");
sb.Append('.');
}
sb.Append(property);

2
backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/CollectionValidator.cs

@ -32,7 +32,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
public Task ValidateAsync(object? value, ValidationContext context, AddError addError)
{
if (!(value is ICollection items) || items.Count == 0)
if (value is not ICollection items || items.Count == 0)
{
if (isRequired && !context.IsOptional)
{

6
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Squidex.Domain.Apps.Entities.MongoDb.csproj

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -17,7 +17,7 @@
<ProjectReference Include="..\Squidex.Domain.Apps.Entities\Squidex.Domain.Apps.Entities.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.11.2" />
<PackageReference Include="MongoDB.Driver" Version="2.11.4" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />

4
backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs

@ -37,7 +37,7 @@ namespace Squidex.Domain.Apps.Entities.Apps
{
if (permission.Length > Permissions.App.Length + 1)
{
var trimmed = permission.Substring(Permissions.App.Length + 1);
var trimmed = permission[(Permissions.App.Length + 1)..];
if (trimmed.Length > 0)
{
@ -48,7 +48,7 @@ namespace Squidex.Domain.Apps.Entities.Apps
foreach (var permission in Permissions.ForAppsSchema)
{
var trimmed = permission.Substring(Permissions.App.Length + 1);
var trimmed = permission[(Permissions.App.Length + 1)..];
foreach (var schema in schemaNames)
{

2
backend/src/Squidex.Domain.Apps.Entities/Apps/State/AppState.cs

@ -16,8 +16,6 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.States;
#pragma warning disable IDE0060 // Remove unused parameter
namespace Squidex.Domain.Apps.Entities.Apps.State
{
[CollectionName("Apps")]

2
backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetFolderState.cs

@ -12,8 +12,6 @@ using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Reflection;
#pragma warning disable IDE0060 // Remove unused parameter
namespace Squidex.Domain.Apps.Entities.Assets.State
{
public sealed class AssetFolderState : DomainObjectState<AssetFolderState>, IAssetFolderEntity

2
backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetState.cs

@ -14,8 +14,6 @@ using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Reflection;
#pragma warning disable IDE0060 // Remove unused parameter
namespace Squidex.Domain.Apps.Entities.Assets.State
{
public class AssetState : DomainObjectState<AssetState>, IAssetEntity

2
backend/src/Squidex.Domain.Apps.Entities/Backup/BackupReader.cs

@ -16,8 +16,6 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Json;
using Squidex.Infrastructure.States;
#pragma warning disable SA1401 // Fields must be private
namespace Squidex.Domain.Apps.Entities.Backup
{
public class BackupReader : DisposableObjectBase, IBackupReader

2
backend/src/Squidex.Domain.Apps.Entities/Comments/CommentsCommandMiddleware.cs

@ -71,7 +71,7 @@ namespace Squidex.Domain.Apps.Entities.Comments
{
if (!string.IsNullOrWhiteSpace(command.Text))
{
var emails = MentionRegex.Matches(command.Text).Select(x => x.Value.Substring(1)).ToArray();
var emails = MentionRegex.Matches(command.Text).Select(x => x.Value[1..]).ToArray();
if (emails.Length > 0)
{

2
backend/src/Squidex.Domain.Apps.Entities/Contents/BulkUpdateCommandMiddleware.cs

@ -15,6 +15,8 @@ using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.Translations;
#pragma warning disable CA1826 // Do not use Enumerable methods on indexable collections
namespace Squidex.Domain.Apps.Entities.Contents
{
public sealed class BulkUpdateCommandMiddleware : ICommandMiddleware

2
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs

@ -20,8 +20,6 @@ using Squidex.Infrastructure;
using Squidex.Log;
using GraphQLSchema = GraphQL.Types.Schema;
#pragma warning disable IDE0003
namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
{
public sealed class GraphQLModel : IGraphModel

1
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentGraphType.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using GraphQL.Types;

2
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Extensions.cs

@ -14,6 +14,8 @@ using Squidex.Domain.Apps.Core.Schemas;
using Squidex.Infrastructure;
using Squidex.Text;
#pragma warning disable RECS0015 // If an extension method is called as static method convert it to method syntax
namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{
public static class Extensions

2
backend/src/Squidex.Domain.Apps.Entities/Contents/Operations/ContentOperationContext.cs

@ -23,8 +23,6 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.Validation;
using Squidex.Log;
#pragma warning disable IDE0016 // Use 'throw' expression
namespace Squidex.Domain.Apps.Entities.Contents.Operations
{
public sealed class ContentOperationContext

2
backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs

@ -166,7 +166,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries
{
var dataSchema = schema.BuildJsonSchema(app.PartitionResolver(), (n, s) => s, withHiddenFields);
return new ContentSchemaBuilder().CreateContentSchema(schema, dataSchema);
return ContentSchemaBuilder.CreateContentSchema(schema, dataSchema);
}
private static EdmModel BuildEdmModel(Schema schema, IAppEntity app, bool withHiddenFields)

12
backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/FilterTagTransformer.cs

@ -53,19 +53,19 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries
return nodeIn;
}
private static bool IsDataPath(IReadOnlyList<string> path)
{
return path.Count == 3 && string.Equals(path[0], nameof(IContentEntity.Data), StringComparison.OrdinalIgnoreCase);
}
private bool IsTagField(IReadOnlyList<string> path)
{
return schema.SchemaDef.FieldsByName.TryGetValue(path[1], out var field) && IsTagField(field);
}
private bool IsTagField(IField field)
private static bool IsTagField(IField field)
{
return field is IField<TagsFieldProperties> tags && tags.Properties.Normalization == TagsFieldNormalization.Schema;
}
private static bool IsDataPath(IReadOnlyList<string> path)
{
return path.Count == 3 && string.Equals(path[0], nameof(IContentEntity.Data), StringComparison.OrdinalIgnoreCase);
}
}
}

2
backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs

@ -17,6 +17,8 @@ using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
using Squidex.Domain.Apps.Core.Templates;
using Squidex.Infrastructure;
#pragma warning disable CA1826 // Do not use Enumerable methods on indexable collections
namespace Squidex.Domain.Apps.Entities.Contents
{
public sealed class ReferencesFluidExtension : IFluidExtension

2
backend/src/Squidex.Domain.Apps.Entities/Contents/State/ContentState.cs

@ -12,8 +12,6 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Reflection;
#pragma warning disable IDE0060 // Remove unused parameter
namespace Squidex.Domain.Apps.Entities.Contents.State
{
public sealed class ContentState : DomainObjectState<ContentState>, IContentEntity

2
backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs

@ -165,7 +165,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Text.Elastic
{
field = $"texts.{candidateLanguage}";
queryText = queryText.Substring(3);
queryText = queryText[3..];
}
}

2
backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Extensions.cs

@ -90,7 +90,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Text
if (sb.Length > 0)
{
sb.Append(" ");
sb.Append(' ');
}
sb.Append(text);

3
backend/src/Squidex.Domain.Apps.Entities/Rules/State/RuleState.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Runtime.Serialization;
using Squidex.Domain.Apps.Core.Rules;
using Squidex.Domain.Apps.Events.Rules;
@ -13,8 +12,6 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.States;
#pragma warning disable IDE0060 // Remove unused parameter
namespace Squidex.Domain.Apps.Entities.Rules.State
{
[CollectionName("Rules")]

2
backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardHelper.cs

@ -15,7 +15,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Guards
{
public static IArrayField GetArrayFieldOrThrow(Schema schema, long parentId, bool allowLocked)
{
if (!schema.FieldsById.TryGetValue(parentId, out var rootField) || !(rootField is IArrayField arrayField))
if (!schema.FieldsById.TryGetValue(parentId, out var rootField) || rootField is not IArrayField arrayField)
{
throw new DomainObjectNotFoundException(parentId.ToString());
}

3
backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardSchema.cs

@ -16,9 +16,6 @@ using Squidex.Infrastructure.Translations;
using Squidex.Infrastructure.Validation;
using Squidex.Text;
#pragma warning disable IDE0060 // Remove unused parameter
#pragma warning disable IDE0059 // Unnecessary assignment of a value
namespace Squidex.Domain.Apps.Entities.Schemas.Guards
{
public static class GuardSchema

2
backend/src/Squidex.Domain.Apps.Entities/Schemas/State/SchemaState.cs

@ -15,8 +15,6 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.States;
#pragma warning disable IDE0060 // Remove unused parameter
namespace Squidex.Domain.Apps.Entities.Schemas.State
{
[CollectionName("Schemas")]

16
backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -17,15 +17,15 @@
<ProjectReference Include="..\Squidex.Shared\Squidex.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CsvHelper" Version="15.0.6" />
<PackageReference Include="Elasticsearch.Net" Version="7.9.0" />
<PackageReference Include="CsvHelper" Version="16.0.0" />
<PackageReference Include="Elasticsearch.Net" Version="7.10.0" />
<PackageReference Include="Equals.Fody" Version="4.0.1" PrivateAssets="all" />
<PackageReference Include="Fody" Version="6.2.6">
<PackageReference Include="Fody" Version="6.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="GraphQL" Version="3.0.0.2026" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.8" />
<PackageReference Include="GraphQL" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Microsoft.Orleans.CodeGenerator.MSBuild" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
@ -34,7 +34,7 @@
<PackageReference Include="Notifo.SDK" Version="1.0.0-alpha8" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="taglib-sharp-netstandard2.0" Version="2.1.0" />
</ItemGroup>

2
backend/src/Squidex.Domain.Apps.Entities/SquidexEntities.cs

@ -7,8 +7,6 @@
using System.Reflection;
#pragma warning disable RECS0014 // If all fields, properties and methods members are static, the class can be made static.
namespace Squidex.Domain.Apps.Entities
{
public static class SquidexEntities

5
backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs

@ -17,11 +17,6 @@ namespace Squidex.Domain.Apps.Entities.Tags
{
private readonly IGrainFactory grainFactory;
public string Name
{
get { return "Tags"; }
}
public GrainTagService(IGrainFactory grainFactory)
{
Guard.NotNull(grainFactory, nameof(grainFactory));

4
backend/src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

5
backend/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs

@ -63,11 +63,6 @@ namespace Squidex.Domain.Users.MongoDb
{
}
public IdentityRole Create(string name)
{
return new IdentityRole { Name = name };
}
public async Task<IdentityRole> FindByIdAsync(string roleId, CancellationToken cancellationToken)
{
return await Collection.Find(x => x.Id == roleId).FirstOrDefaultAsync(cancellationToken);

10
backend/src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -19,11 +19,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="IdentityServer4" Version="4.1.1" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="MongoDB.Driver" Version="2.11.2" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="MongoDB.Driver" Version="2.11.4" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\Squidex.ruleset</CodeAnalysisRuleSet>

10
backend/src/Squidex.Domain.Users/Squidex.Domain.Users.csproj

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -17,13 +17,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="IdentityServer4" Version="4.1.1" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="3.1.8" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="SharpPwned.NET" Version="1.0.8" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Linq.Queryable" Version="4.3.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\Squidex.ruleset</CodeAnalysisRuleSet>

2
backend/src/Squidex.Infrastructure.Azure/EventSourcing/FilterExtensions.cs

@ -22,7 +22,7 @@ namespace Squidex.Infrastructure.EventSourcing
EnableCrossPartitionQuery = true
};
public static async Task<T> FirstOrDefaultAsync<T>(this IQueryable<T> queryable, CancellationToken ct = default)
public static async Task<T?> FirstOrDefaultAsync<T>(this IQueryable<T> queryable, CancellationToken ct = default)
{
var documentQuery = queryable.AsDocumentQuery();

4
backend/src/Squidex.Infrastructure.Azure/EventSourcing/StreamPosition.cs

@ -42,9 +42,9 @@ namespace Squidex.Infrastructure.EventSourcing
try
{
sb.Append(position.Timestamp);
sb.Append("-");
sb.Append('-');
sb.Append(position.CommitOffset);
sb.Append("-");
sb.Append('-');
sb.Append(position.CommitSize);
return sb.ToString();

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save