From d2f85d877544d69d54163f8ecb1a55f44550162d Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Wed, 18 Nov 2020 16:09:45 +0100 Subject: [PATCH] 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. --- .drone.yml | 2 +- Dockerfile | 4 +- README.md | 2 +- .../Actions/Email/EmailActionHandler.cs | 3 +- .../Actions/Kafka/KafkaActionHandler.cs | 2 +- .../Actions/Medium/MediumActionHandler.cs | 2 +- .../Squidex.Extensions/Actions/RuleHelper.cs | 2 +- .../Actions/Webhook/WebhookActionHandler.cs | 2 +- .../Squidex.Extensions.csproj | 18 +- .../Squidex.Translator.csproj | 2 +- backend/src/Migrations/MigrationPath.cs | 2 +- backend/src/Migrations/Migrations.csproj | 4 +- .../MongoDb/AddAppIdToEventStream.cs | 2 +- .../Migrations/MongoDb/ConvertDocumentIds.cs | 2 +- .../Migrations/OldEvents/AppClientChanged.cs | 2 +- .../OldEvents/AppClientPermission.cs | 2 +- .../Migrations/OldEvents/AppClientUpdated.cs | 2 +- .../OldEvents/AppContributorAssigned.cs | 2 +- .../OldEvents/AppContributorPermission.cs | 2 +- .../Migrations/OldEvents/AppPlanChanged.cs | 2 +- .../OldEvents/AppWorkflowConfigured.cs | 2 +- .../src/Migrations/OldEvents/AssetCreated.cs | 2 +- .../src/Migrations/OldEvents/AssetRenamed.cs | 2 +- .../src/Migrations/OldEvents/AssetTagged.cs | 2 +- .../Migrations/OldEvents/ContentArchived.cs | 2 +- .../OldEvents/ContentChangesDiscarded.cs | 2 +- .../OldEvents/ContentChangesPublished.cs | 2 +- .../Migrations/OldEvents/ContentCreated.cs | 2 +- .../Migrations/OldEvents/ContentPublished.cs | 2 +- .../Migrations/OldEvents/ContentRestored.cs | 2 +- .../OldEvents/ContentStatusChanged.cs | 2 +- .../OldEvents/ContentUnpublished.cs | 2 +- .../OldEvents/ContentUpdateProposed.cs | 2 +- .../src/Migrations/OldEvents/SchemaCreated.cs | 2 +- .../Migrations/OldEvents/ScriptsConfigured.cs | 2 +- .../src/Migrations/OldEvents/WebhookAdded.cs | 2 +- .../Migrations/OldEvents/WebhookDeleted.cs | 2 +- .../Apps/AppClient.cs | 46 +- .../Apps/AppClients.cs | 44 +- .../Apps/AppImage.cs | 3 +- .../Apps/AppPattern.cs | 26 +- .../Apps/AppPatterns.cs | 20 +- .../Apps/AppPlan.cs | 3 +- .../Apps/Json/JsonLanguagesConfig.cs | 2 +- .../Apps/LanguagesConfig.cs | 2 - .../Apps/Roles.cs | 4 +- .../Contents/ContentData.cs | 19 +- .../Contents/IdContentData.cs | 5 +- .../Contents/NamedContentData.cs | 5 +- .../Contents/Status.cs | 3 +- .../Rules/RuleAction.cs | 5 +- .../Schemas/FieldCollection.cs | 2 - .../Schemas/Json/JsonSchemaModel.cs | 2 - .../Schemas/NestedField{T}.cs | 2 +- .../Schemas/RootField{T}.cs | 2 +- .../Squidex.Domain.Apps.Core.Model.csproj | 11 +- .../ConvertContent/FieldConverters.cs | 2 - .../DefaultValues/DefaultValueFactory.cs | 2 +- .../ContentSchemaBuilder.cs | 4 +- .../HandleRules/RuleEventFormatter.cs | 2 +- .../HandleRules/RuleTriggerHandler.cs | 2 - .../ContentWrapper/ContentDataObject.cs | 2 - .../ContentWrapper/ContentFieldObject.cs | 2 - .../Scripting/JintScriptEngine.cs | 8 +- ...Squidex.Domain.Apps.Core.Operations.csproj | 15 +- .../SquidexCoreOperations.cs | 2 - .../ValidateContent/ContentValidator.cs | 2 - .../ValidateContent/ObjectPath.cs | 3 +- .../Validators/CollectionValidator.cs | 2 +- ...quidex.Domain.Apps.Entities.MongoDb.csproj | 6 +- .../Apps/RolePermissionsProvider.cs | 4 +- .../Apps/State/AppState.cs | 2 - .../Assets/State/AssetFolderState.cs | 2 - .../Assets/State/AssetState.cs | 2 - .../Backup/BackupReader.cs | 2 - .../Comments/CommentsCommandMiddleware.cs | 2 +- .../Contents/BulkUpdateCommandMiddleware.cs | 2 + .../Contents/GraphQL/GraphQLModel.cs | 2 - .../GraphQL/Types/ContentGraphType.cs | 1 - .../Contents/GraphQL/Types/Extensions.cs | 2 + .../Operations/ContentOperationContext.cs | 2 - .../Contents/Queries/ContentQueryParser.cs | 2 +- .../Contents/Queries/FilterTagTransformer.cs | 12 +- .../Contents/ReferencesFluidExtension.cs | 2 + .../Contents/State/ContentState.cs | 2 - .../Text/Elastic/ElasticSearchTextIndex.cs | 2 +- .../Contents/Text/Extensions.cs | 2 +- .../Rules/State/RuleState.cs | 3 - .../Schemas/Guards/GuardHelper.cs | 2 +- .../Schemas/Guards/GuardSchema.cs | 3 - .../Schemas/State/SchemaState.cs | 2 - .../Squidex.Domain.Apps.Entities.csproj | 16 +- .../SquidexEntities.cs | 2 - .../Tags/GrainTagService.cs | 5 - .../Squidex.Domain.Apps.Events.csproj | 4 +- .../MongoRoleStore.cs | 5 - .../Squidex.Domain.Users.MongoDb.csproj | 10 +- .../Squidex.Domain.Users.csproj | 10 +- .../EventSourcing/FilterExtensions.cs | 2 +- .../EventSourcing/StreamPosition.cs | 4 +- .../Squidex.Infrastructure.Azure.csproj | 4 +- .../EventSourcing/Formatter.cs | 2 +- .../EventSourcing/GetEventStore.cs | 4 +- .../GetEventStoreSubscription.cs | 2 +- .../EventSourcing/ProjectionClient.cs | 4 +- ...quidex.Infrastructure.GetEventStore.csproj | 4 +- .../EventSourcing/StreamPosition.cs | 6 +- .../Log/MongoRequestLogRepository.cs | 1 - .../MongoDb/BsonHelper.cs | 2 +- .../MongoDb/MongoExtensions.cs | 9 +- .../MongoDb/Queries/FilterVisitor.cs | 2 +- .../Squidex.Infrastructure.MongoDb.csproj | 10 +- .../Squidex.Infrastructure.RabbitMq.csproj | 4 +- .../Squidex.Infrastructure.Redis.csproj | 2 +- .../ImmutableDictionary{TKey,TValue}.cs | 3 - .../Commands/Rebuilder.cs | 2 +- .../src/Squidex.Infrastructure/DomainId.cs | 3 +- .../Grains/EventConsumerGrain.cs | 2 +- .../Grains/EventConsumerState.cs | 2 +- .../EventSourcing/RetrySubscription.cs | 2 - .../Squidex.Infrastructure/FileExtensions.cs | 2 +- backend/src/Squidex.Infrastructure/Guard.cs | 2 +- .../Newtonsoft/ClaimsPrincipalConverter.cs | 4 +- .../Json/Newtonsoft/DomainIdConverter.cs | 2 +- .../Json/Newtonsoft/InstantConverter.cs | 2 +- .../Json/Objects/JsonObject.cs | 2 +- .../src/Squidex.Infrastructure/Language.cs | 21 +- .../src/Squidex.Infrastructure/Languages.cs | 61 +- .../LanguagesInitializer.cs | 5 +- .../Log/BackgroundRequestLogStore.cs | 2 +- .../src/Squidex.Infrastructure/NamedId{T}.cs | 9 +- .../Net/IPAddressComparer.cs | 3 +- .../Orleans/GrainState.cs | 4 +- .../src/Squidex.Infrastructure/Orleans/J.cs | 1 + .../Queries/OData/EdmModelExtensions.cs | 2 +- .../Queries/OData/FilterVisitor.cs | 2 +- .../src/Squidex.Infrastructure/RefToken.cs | 7 +- .../Equality/DeepEqualityComparer.cs | 3 +- .../Security/Permission.Part.cs | 6 +- .../Security/Permission.cs | 27 +- .../Squidex.Infrastructure.csproj | 30 +- .../Squidex.Infrastructure/States/Store.cs | 2 +- .../Tasks/PartitionedActionBlock.cs | 2 +- .../Translations/DeepLTranslator.cs | 6 +- .../Translations/ResourcesLocalizer.cs | 8 +- .../UsageTracking/BackgroundUsageTracker.cs | 4 +- .../Validation/AbsoluteUrlAttribute.cs | 4 +- .../LocalizedEmailAddressAttribute.cs | 4 +- .../Validation/ValidationException.cs | 4 +- .../Validation/ValidationExtensions.cs | 1 + .../src/Squidex.Shared/Squidex.Shared.csproj | 4 +- .../Squidex.Shared/Users/UserExtensions.cs | 2 +- backend/src/Squidex.Web/ApiController.cs | 2 +- .../src/Squidex.Web/ApiExceptionConverter.cs | 7 +- .../ApiExceptionFilterAttribute.cs | 2 +- .../ETagCommandMiddleware.cs | 2 +- .../EnrichWithSchemaIdCommandMiddleware.cs | 2 +- .../Json/TypedJsonInheritanceConverter.cs | 2 +- .../src/Squidex.Web/Pipeline/AppResolver.cs | 2 +- .../Squidex.Web/Pipeline/CachingManager.cs | 2 +- .../Pipeline/FileCallbackResultExecutor.cs | 1 - .../src/Squidex.Web/Pipeline/UsageStream.cs | 4 +- backend/src/Squidex.Web/Squidex.Web.csproj | 6 +- .../Api/Config/OpenApi/ScopesProcessor.cs | 2 +- .../Api/Controllers/Apps/AppsController.cs | 2 + .../Assets/AssetContentController.cs | 4 +- .../Api/Controllers/Assets/Models/AssetDto.cs | 6 +- .../Generator/SchemaOpenApiGenerator.cs | 3 +- .../Generator/SchemasOpenApiGenerator.cs | 2 +- .../Statistics/Models/CallsUsageDtoDto.cs | 2 - .../Api/Controllers/Users/UsersController.cs | 4 +- .../Frontend/Middlewares/IndexExtensions.cs | 6 +- .../Controllers/Account/AccountController.cs | 6 +- .../IdentityServer/Controllers/Extensions.cs | 2 +- .../Controllers/IdentityServerController.cs | 2 +- .../Areas/IdentityServer/Views/Extensions.cs | 4 +- ...rleansDashboardAuthenticationMiddleware.cs | 2 +- ...PortalDashboardAuthenticationMiddleware.cs | 2 +- .../Config/Authentication/OidcHandler.cs | 2 +- .../Squidex/Config/Domain/AssetServices.cs | 1 - .../Config/Domain/EventSourcingServices.cs | 2 +- .../Config/Domain/InfrastructureServices.cs | 2 - .../Squidex/Config/Domain/LoggingServices.cs | 1 - .../Squidex/Config/Domain/StoreServices.cs | 1 - .../Squidex/Config/Orleans/OrleansServices.cs | 2 - .../Pipeline/Plugins/PluginExtensions.cs | 2 +- .../Squidex/Pipeline/Squid/SquidMiddleware.cs | 2 +- backend/src/Squidex/Squidex.csproj | 30 +- backend/src/Squidex/Startup.cs | 2 - .../Model/Apps/AppClientsTests.cs | 24 +- .../Model/Apps/AppPatternsTests.cs | 10 +- .../Model/Apps/LanguagesConfigTests.cs | 1 + .../Model/Contents/ContentDataTests.cs | 2 - .../Model/Contents/WorkflowJsonTests.cs | 2 +- .../Model/Contents/WorkflowTests.cs | 6 +- .../Model/InvariantPartitionTests.cs | 2 - .../DefaultValues/DefaultValuesTests.cs | 2 - .../ReferenceExtractionTests.cs | 2 - .../GenerateJsonSchema/JsonSchemaTests.cs | 2 +- .../RuleEventFormatterCompareTests.cs | 2 + .../HandleRules/RuleEventFormatterTests.cs | 2 + .../HandleRules/RuleServiceTests.cs | 2 - .../Operations/Scripting/JintUserTests.cs | 2 - .../Operations/Scripting/MockupHttpHandler.cs | 2 +- .../ValidateContent/AssetsFieldTests.cs | 1 - .../Validators/ReferencesValidatorTests.cs | 2 +- .../Validators/StringLengthValidatorTests.cs | 2 +- .../Validators/StringTextValidatorTests.cs | 6 +- .../Validators/UniqueValidatorTests.cs | 2 +- .../Squidex.Domain.Apps.Core.Tests.csproj | 10 +- .../Apps/AppCommandMiddlewareTests.cs | 2 - .../Apps/BackupAppsTests.cs | 2 - .../Apps/Guards/GuardAppRolesTests.cs | 2 +- .../Apps/Indexes/AppsIndexTests.cs | 2 - .../Apps/Plans/UsageGateTests.cs | 2 +- .../Assets/AssetChangedTriggerHandlerTests.cs | 2 - .../Assets/AssetDomainObjectGrainTests.cs | 1 + .../AssetFolderDomainObjectGrainTests.cs | 1 + .../Assets/BackupAssetsTests.cs | 2 - .../Comments/CommentTriggerHandlerTests.cs | 2 +- .../ContentChangedTriggerHandlerTests.cs | 3 - .../Contents/ContentDomainObjectGrainTests.cs | 1 + .../Contents/GraphQL/GraphQLTestBase.cs | 1 - .../Contents/Queries/ContentEnricherTests.cs | 2 +- .../Queries/ContentQueryServiceTests.cs | 2 - .../Queries/EnrichWithWorkflowsTests.cs | 2 +- .../Contents/Queries/ResolveAssetsTests.cs | 9 +- .../Queries/ResolveReferencesTests.cs | 6 +- .../Contents/TestData/FakeUrlGenerator.cs | 5 - .../Contents/Text/TextIndexerTestsBase.cs | 2 - .../Rules/Guards/GuardRuleTests.cs | 2 - .../Rules/RuleDequeuerGrainTests.cs | 2 - .../Schemas/Guards/GuardSchemaFieldTests.cs | 1 - .../Schemas/Indexes/SchemasIndexTests.cs | 2 - .../SchemaChangedTriggerHandlerTests.cs | 2 - .../Squidex.Domain.Apps.Entities.Tests.csproj | 14 +- .../Tags/GrainTagServiceTests.cs | 6 - .../Squidex.Domain.Users.Tests.csproj | 6 +- .../Commands/InMemoryCommandBusTests.cs | 2 +- .../DisposableObjectBaseTests.cs | 2 - .../EventSourcing/EventStoreTests.cs | 8 +- .../Grains/EventConsumerManagerGrainTests.cs | 1 - .../EventSourcing/MongoEventStoreFixture.cs | 2 + .../GuardTests.cs | 2 +- .../MongoDb/DomainIdSerializerTests.cs | 2 +- .../Reflection/SimpleEqualsTests.cs | 5 +- .../Squidex.Infrastructure.Tests.csproj | 9 +- .../States/PersistenceSnapshotTests.cs | 2 - .../TestHelpers/BinaryFormatterHelper.cs | 4 +- .../ApiExceptionFilterAttributeTests.cs | 16 +- .../ApiPermissionAttributeTests.cs | 2 +- .../ETagCommandMiddlewareTests.cs | 4 +- .../Pipeline/ApiCostsFilterTests.cs | 4 +- .../Pipeline/AppResolverTests.cs | 2 +- .../Pipeline/CachingFilterTests.cs | 4 +- .../Pipeline/SchemaResolverTests.cs | 2 +- .../Squidex.Web.Tests.csproj | 6 +- backend/tools/Benchmarks/Benchmarks.csproj | 2 +- .../GenerateLanguages.csproj | 2 +- backend/tools/GenerateLanguages/Program.cs | 16 +- backend/tools/Migrator/Migrator.csproj | 4 +- .../TestSuite.ApiTests.csproj | 2 +- .../TestSuite.LoadTests.csproj | 2 +- .../TestSuite.Shared/TestSuite.Shared.csproj | 2 +- .../angular/routers/parent-link.directive.ts | 4 +- frontend/package-lock.json | 1018 ++++++++--------- frontend/package.json | 87 +- 267 files changed, 1061 insertions(+), 1233 deletions(-) diff --git a/.drone.yml b/.drone.yml index 497ae7d8c..3345c7a0e 100644 --- a/.drone.yml +++ b/.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 diff --git a/Dockerfile b/Dockerfile index 88d8830a5..cf41a24b9 100644 --- a/Dockerfile +++ b/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 diff --git a/README.md b/README.md index c96192511..6cfe58166 100644 --- a/README.md +++ b/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. diff --git a/backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs index f10d48796..52a3d75d4 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs +++ b/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); } } diff --git a/backend/extensions/Squidex.Extensions/Actions/Kafka/KafkaActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Kafka/KafkaActionHandler.cs index 8749414db..f02e978c4 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Kafka/KafkaActionHandler.cs +++ b/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); diff --git a/backend/extensions/Squidex.Extensions/Actions/Medium/MediumActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Medium/MediumActionHandler.cs index 4ed8564ce..1dd9b93ec 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Medium/MediumActionHandler.cs +++ b/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(responseString); var id = responseJson.Data?.Id; diff --git a/backend/extensions/Squidex.Extensions/Actions/RuleHelper.cs b/backend/extensions/Squidex.Extensions/Actions/RuleHelper.cs index c912bbb3f..563347290 100644 --- a/backend/extensions/Squidex.Extensions/Actions/RuleHelper.cs +++ b/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) diff --git a/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs index 57789717b..6be4938bd 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs +++ b/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); diff --git a/backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj b/backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj index a898029ec..168f8d6a9 100644 --- a/backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj +++ b/backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 @@ -10,19 +10,19 @@ - + - - - - - + + + + + - + diff --git a/backend/i18n/translator/Squidex.Translator/Squidex.Translator.csproj b/backend/i18n/translator/Squidex.Translator/Squidex.Translator.csproj index cbee9657e..a451f2274 100644 --- a/backend/i18n/translator/Squidex.Translator/Squidex.Translator.csproj +++ b/backend/i18n/translator/Squidex.Translator/Squidex.Translator.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5.0 diff --git a/backend/src/Migrations/MigrationPath.cs b/backend/src/Migrations/MigrationPath.cs index 93d77f55f..dccfbe849 100644 --- a/backend/src/Migrations/MigrationPath.cs +++ b/backend/src/Migrations/MigrationPath.cs @@ -38,7 +38,7 @@ namespace Migrations return (CurrentVersion, migrations); } - private IEnumerable ResolveMigrators(int version) + private IEnumerable ResolveMigrators(int version) { yield return serviceProvider.GetRequiredService(); diff --git a/backend/src/Migrations/Migrations.csproj b/backend/src/Migrations/Migrations.csproj index 0d8295f08..063ea4255 100644 --- a/backend/src/Migrations/Migrations.csproj +++ b/backend/src/Migrations/Migrations.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable diff --git a/backend/src/Migrations/Migrations/MongoDb/AddAppIdToEventStream.cs b/backend/src/Migrations/Migrations/MongoDb/AddAppIdToEventStream.cs index 6d86aaa2e..569b15510 100644 --- a/backend/src/Migrations/Migrations/MongoDb/AddAppIdToEventStream.cs +++ b/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)) { diff --git a/backend/src/Migrations/Migrations/MongoDb/ConvertDocumentIds.cs b/backend/src/Migrations/Migrations/MongoDb/ConvertDocumentIds.cs index 5b24967ff..37799a14d 100644 --- a/backend/src/Migrations/Migrations/MongoDb/ConvertDocumentIds.cs +++ b/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(); diff --git a/backend/src/Migrations/OldEvents/AppClientChanged.cs b/backend/src/Migrations/OldEvents/AppClientChanged.cs index 1ec198d3b..bb6c00ef9 100644 --- a/backend/src/Migrations/OldEvents/AppClientChanged.cs +++ b/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 { public string Id { get; set; } diff --git a/backend/src/Migrations/OldEvents/AppClientPermission.cs b/backend/src/Migrations/OldEvents/AppClientPermission.cs index a9ac65032..44abb112e 100644 --- a/backend/src/Migrations/OldEvents/AppClientPermission.cs +++ b/backend/src/Migrations/OldEvents/AppClientPermission.cs @@ -9,7 +9,7 @@ using System; namespace Migrations.OldEvents { - [Obsolete] + [Obsolete("New Event introduced")] public enum AppClientPermission { Developer, diff --git a/backend/src/Migrations/OldEvents/AppClientUpdated.cs b/backend/src/Migrations/OldEvents/AppClientUpdated.cs index 1d1685b1f..dc754a584 100644 --- a/backend/src/Migrations/OldEvents/AppClientUpdated.cs +++ b/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 { public string Id { get; set; } diff --git a/backend/src/Migrations/OldEvents/AppContributorAssigned.cs b/backend/src/Migrations/OldEvents/AppContributorAssigned.cs index 6bb92bc5c..059b16f71 100644 --- a/backend/src/Migrations/OldEvents/AppContributorAssigned.cs +++ b/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 { public string ContributorId { get; set; } diff --git a/backend/src/Migrations/OldEvents/AppContributorPermission.cs b/backend/src/Migrations/OldEvents/AppContributorPermission.cs index c46a5b53f..648006d3b 100644 --- a/backend/src/Migrations/OldEvents/AppContributorPermission.cs +++ b/backend/src/Migrations/OldEvents/AppContributorPermission.cs @@ -9,7 +9,7 @@ using System; namespace Migrations.OldEvents { - [Obsolete] + [Obsolete("New Event introduced")] public enum AppContributorPermission { Owner, diff --git a/backend/src/Migrations/OldEvents/AppPlanChanged.cs b/backend/src/Migrations/OldEvents/AppPlanChanged.cs index 1c4ca2eef..9a160ce39 100644 --- a/backend/src/Migrations/OldEvents/AppPlanChanged.cs +++ b/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 { public string PlanId { get; set; } diff --git a/backend/src/Migrations/OldEvents/AppWorkflowConfigured.cs b/backend/src/Migrations/OldEvents/AppWorkflowConfigured.cs index 1cccfcf81..5f5b96d2d 100644 --- a/backend/src/Migrations/OldEvents/AppWorkflowConfigured.cs +++ b/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 { public Workflow Workflow { get; set; } diff --git a/backend/src/Migrations/OldEvents/AssetCreated.cs b/backend/src/Migrations/OldEvents/AssetCreated.cs index 9e812342d..382f0e843 100644 --- a/backend/src/Migrations/OldEvents/AssetCreated.cs +++ b/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 { public Guid ParentId { get; set; } diff --git a/backend/src/Migrations/OldEvents/AssetRenamed.cs b/backend/src/Migrations/OldEvents/AssetRenamed.cs index f16ad6962..f80cfceb4 100644 --- a/backend/src/Migrations/OldEvents/AssetRenamed.cs +++ b/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 { public string FileName { get; set; } diff --git a/backend/src/Migrations/OldEvents/AssetTagged.cs b/backend/src/Migrations/OldEvents/AssetTagged.cs index 2b3fbaf56..c4bcf5a24 100644 --- a/backend/src/Migrations/OldEvents/AssetTagged.cs +++ b/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 { public HashSet Tags { get; set; } diff --git a/backend/src/Migrations/OldEvents/ContentArchived.cs b/backend/src/Migrations/OldEvents/ContentArchived.cs index 57eedfab7..d9ffc28a3 100644 --- a/backend/src/Migrations/OldEvents/ContentArchived.cs +++ b/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 { public IEvent Migrate() diff --git a/backend/src/Migrations/OldEvents/ContentChangesDiscarded.cs b/backend/src/Migrations/OldEvents/ContentChangesDiscarded.cs index 69092345e..327d1377b 100644 --- a/backend/src/Migrations/OldEvents/ContentChangesDiscarded.cs +++ b/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 { public IEvent Migrate() diff --git a/backend/src/Migrations/OldEvents/ContentChangesPublished.cs b/backend/src/Migrations/OldEvents/ContentChangesPublished.cs index 9a23b86a9..ba5c2ba62 100644 --- a/backend/src/Migrations/OldEvents/ContentChangesPublished.cs +++ b/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 { public IEvent Migrate() diff --git a/backend/src/Migrations/OldEvents/ContentCreated.cs b/backend/src/Migrations/OldEvents/ContentCreated.cs index 69668cc14..280349dde 100644 --- a/backend/src/Migrations/OldEvents/ContentCreated.cs +++ b/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 { public Status Status { get; set; } diff --git a/backend/src/Migrations/OldEvents/ContentPublished.cs b/backend/src/Migrations/OldEvents/ContentPublished.cs index 8101b7699..baf28706b 100644 --- a/backend/src/Migrations/OldEvents/ContentPublished.cs +++ b/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 { public IEvent Migrate() diff --git a/backend/src/Migrations/OldEvents/ContentRestored.cs b/backend/src/Migrations/OldEvents/ContentRestored.cs index 7bc262817..ce8c26940 100644 --- a/backend/src/Migrations/OldEvents/ContentRestored.cs +++ b/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 { public IEvent Migrate() diff --git a/backend/src/Migrations/OldEvents/ContentStatusChanged.cs b/backend/src/Migrations/OldEvents/ContentStatusChanged.cs index 8b4c3fa93..7b50bdb2d 100644 --- a/backend/src/Migrations/OldEvents/ContentStatusChanged.cs +++ b/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 { public string Change { get; set; } diff --git a/backend/src/Migrations/OldEvents/ContentUnpublished.cs b/backend/src/Migrations/OldEvents/ContentUnpublished.cs index 1e23ab43b..8cf452ca5 100644 --- a/backend/src/Migrations/OldEvents/ContentUnpublished.cs +++ b/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 { public IEvent Migrate() diff --git a/backend/src/Migrations/OldEvents/ContentUpdateProposed.cs b/backend/src/Migrations/OldEvents/ContentUpdateProposed.cs index ccec23d70..5a0cbb3f9 100644 --- a/backend/src/Migrations/OldEvents/ContentUpdateProposed.cs +++ b/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 { public NamedContentData Data { get; set; } diff --git a/backend/src/Migrations/OldEvents/SchemaCreated.cs b/backend/src/Migrations/OldEvents/SchemaCreated.cs index 95a73fbc2..2de3abd44 100644 --- a/backend/src/Migrations/OldEvents/SchemaCreated.cs +++ b/backend/src/Migrations/OldEvents/SchemaCreated.cs @@ -18,7 +18,7 @@ using SchemaFields = System.Collections.Generic.List { public string Name { get; set; } diff --git a/backend/src/Migrations/OldEvents/ScriptsConfigured.cs b/backend/src/Migrations/OldEvents/ScriptsConfigured.cs index 7f27244ce..5cbe60ac4 100644 --- a/backend/src/Migrations/OldEvents/ScriptsConfigured.cs +++ b/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 { public string ScriptQuery { get; set; } diff --git a/backend/src/Migrations/OldEvents/WebhookAdded.cs b/backend/src/Migrations/OldEvents/WebhookAdded.cs index 68236d39d..7227003df 100644 --- a/backend/src/Migrations/OldEvents/WebhookAdded.cs +++ b/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; } diff --git a/backend/src/Migrations/OldEvents/WebhookDeleted.cs b/backend/src/Migrations/OldEvents/WebhookDeleted.cs index 6c801e2c2..29394ed51 100644 --- a/backend/src/Migrations/OldEvents/WebhookDeleted.cs +++ b/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; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClient.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClient.cs index be2a1899a..47ea34b85 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClient.cs +++ b/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; } } } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClients.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClients.cs index e1f3f82b9..846bf9693 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClients.cs +++ b/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(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(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(id, newClient); } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppImage.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppImage.cs index c62a41972..addf2a2cf 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppImage.cs +++ b/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; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPattern.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPattern.cs index 7deb3f55b..25f69b521 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPattern.cs +++ b/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; } } } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPatterns.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPatterns.cs index 5e6f01d51..64b8bcb5e 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPatterns.cs +++ b/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(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(id, newPattern); } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPlan.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPlan.cs index 5351cb60b..638848040 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppPlan.cs +++ b/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; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/Json/JsonLanguagesConfig.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/Json/JsonLanguagesConfig.cs index 4d0eadbf5..a210521a0 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/Json/JsonLanguagesConfig.cs +++ b/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); } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/LanguagesConfig.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/LanguagesConfig.cs index e5c6ff2ee..4ad83818c 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/LanguagesConfig.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/Roles.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Apps/Roles.cs index ff3c7577d..78f0df7d1 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Apps/Roles.cs +++ b/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 Cleaned(Dictionary inner) diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/ContentData.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Contents/ContentData.cs index 108429fcf..9e2c924a3 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/ContentData.cs +++ b/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; + } } } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/IdContentData.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Contents/IdContentData.cs index 3440b2403..83a6f2f6d 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/IdContentData.cs +++ b/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 + namespace Squidex.Domain.Apps.Core.Contents { public sealed class IdContentData : ContentData, IEquatable @@ -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); } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/NamedContentData.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Contents/NamedContentData.cs index 9eec25ad2..8f997da0f 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/NamedContentData.cs +++ b/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 + namespace Squidex.Domain.Apps.Core.Contents { public sealed class NamedContentData : ContentData, IEquatable @@ -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); } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/Status.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Contents/Status.cs index 00faa6442..fc48dbaed 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Contents/Status.cs +++ b/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); } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleAction.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleAction.cs index bd4f0edf5..08c5b6579 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Rules/RuleAction.cs +++ b/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()); + } } } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldCollection.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldCollection.cs index c5cb7d4c6..fadd61bdf 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldCollection.cs +++ b/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 : Cloneable> where T : IField diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/Json/JsonSchemaModel.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/Json/JsonSchemaModel.cs index feddfd84e..735563800 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/Json/JsonSchemaModel.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/NestedField{T}.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/NestedField{T}.cs index d338789d6..881d7225d 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/NestedField{T}.cs +++ b/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)); } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/RootField{T}.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/RootField{T}.cs index 1365bfaf9..bc5ccce87 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/RootField{T}.cs +++ b/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)); } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj b/backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj index b90bfa5ca..e0e359fe7 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net5.0 Squidex.Domain.Apps.Core enable @@ -10,17 +10,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/FieldConverters.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/FieldConverters.cs index d0a42eda3..4ad092638 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/FieldConverters.cs +++ b/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); diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/DefaultValues/DefaultValueFactory.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/DefaultValues/DefaultValueFactory.cs index 83d449787..c8910c7b5 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/DefaultValues/DefaultValueFactory.cs +++ b/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) { diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs index 4dd3deb8a..95575dd34 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs +++ b/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)); diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs index 820d25176..6c3b4130d 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs +++ b/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) { diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleTriggerHandler.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleTriggerHandler.cs index 30c499b83..2f3adea3e 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleTriggerHandler.cs +++ b/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 : IRuleTriggerHandler diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs index fa8fc2836..6af5181b9 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentFieldObject.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentFieldObject.cs index 32f41ab9e..de870cb10 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentFieldObject.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/JintScriptEngine.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/JintScriptEngine.cs index 71f4c31b2..aa083097d 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/JintScriptEngine.cs +++ b/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(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(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); diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj b/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj index d0b05f115..057853a68 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net5.0 Squidex.Domain.Apps.Core - 8.0 + 9.0 enable @@ -17,16 +17,15 @@ - + - - - + + + - - + diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/SquidexCoreOperations.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/SquidexCoreOperations.cs index 38e3c0b0c..51c11b47d 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/SquidexCoreOperations.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ContentValidator.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ContentValidator.cs index c7ab4f093..946bfc91e 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ContentValidator.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ObjectPath.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ObjectPath.cs index b86ff9271..081780c90 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ObjectPath.cs +++ b/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); diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/CollectionValidator.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/CollectionValidator.cs index 94979e7a3..c109cc89a 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/CollectionValidator.cs +++ b/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) { diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Squidex.Domain.Apps.Entities.MongoDb.csproj b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Squidex.Domain.Apps.Entities.MongoDb.csproj index c66735a1f..c5a685efc 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Squidex.Domain.Apps.Entities.MongoDb.csproj +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Squidex.Domain.Apps.Entities.MongoDb.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable @@ -17,7 +17,7 @@ - + diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs index a5db89f6f..142a220fc 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs +++ b/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) { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/State/AppState.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/State/AppState.cs index a86e6bce7..75ca0c034 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/State/AppState.cs +++ b/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")] diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetFolderState.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetFolderState.cs index 239b2e360..15548dd74 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetFolderState.cs +++ b/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, IAssetFolderEntity diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetState.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetState.cs index 3996576ca..ecdef63da 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/State/AssetState.cs +++ b/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, IAssetEntity diff --git a/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupReader.cs b/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupReader.cs index e7c19f5b9..c099da64b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupReader.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Entities/Comments/CommentsCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Comments/CommentsCommandMiddleware.cs index cffb3de90..30ec2a721 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Comments/CommentsCommandMiddleware.cs +++ b/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) { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/BulkUpdateCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/BulkUpdateCommandMiddleware.cs index 55591e57a..b876e822a 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/BulkUpdateCommandMiddleware.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs index 0c96518de..dce9c9907 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentGraphType.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentGraphType.cs index a6dbe63a3..fe13f473f 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentGraphType.cs +++ b/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; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Extensions.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Extensions.cs index 797bea745..b8bc9a91b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Extensions.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Operations/ContentOperationContext.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Operations/ContentOperationContext.cs index 7ca1ff750..b5461cd5e 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Operations/ContentOperationContext.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs index 823733145..d2ca81076 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs +++ b/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) diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/FilterTagTransformer.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/FilterTagTransformer.cs index 954844bc5..72738bfa5 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/FilterTagTransformer.cs +++ b/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 path) - { - return path.Count == 3 && string.Equals(path[0], nameof(IContentEntity.Data), StringComparison.OrdinalIgnoreCase); - } - private bool IsTagField(IReadOnlyList 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 tags && tags.Properties.Normalization == TagsFieldNormalization.Schema; } + + private static bool IsDataPath(IReadOnlyList path) + { + return path.Count == 3 && string.Equals(path[0], nameof(IContentEntity.Data), StringComparison.OrdinalIgnoreCase); + } } } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs index 857f3ec45..1c40eb586 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/State/ContentState.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/State/ContentState.cs index 8f7a3bad1..884c7ca62 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/State/ContentState.cs +++ b/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, IContentEntity diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs index 8818217c8..c78bb28e1 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs +++ b/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..]; } } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Extensions.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Extensions.cs index 4adc35151..815b26430 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Extensions.cs +++ b/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); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/State/RuleState.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/State/RuleState.cs index e5d83423c..ce9cf43e8 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/State/RuleState.cs +++ b/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")] diff --git a/backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardHelper.cs b/backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardHelper.cs index 6da17d86d..1073fbf20 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardHelper.cs +++ b/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()); } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardSchema.cs b/backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardSchema.cs index 447808768..945242bc0 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Schemas/Guards/GuardSchema.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Entities/Schemas/State/SchemaState.cs b/backend/src/Squidex.Domain.Apps.Entities/Schemas/State/SchemaState.cs index d67ba0f01..902dd9e8a 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Schemas/State/SchemaState.cs +++ b/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")] diff --git a/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj b/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj index 7a50a60c8..c60c0ce05 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj +++ b/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable @@ -17,15 +17,15 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers @@ -34,7 +34,7 @@ - + diff --git a/backend/src/Squidex.Domain.Apps.Entities/SquidexEntities.cs b/backend/src/Squidex.Domain.Apps.Entities/SquidexEntities.cs index 4bf944913..8d82fce42 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/SquidexEntities.cs +++ b/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 diff --git a/backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs b/backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs index 333ee66d7..9964a2a55 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs +++ b/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)); diff --git a/backend/src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj b/backend/src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj index 76651b6da..a2f7361b0 100644 --- a/backend/src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj +++ b/backend/src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable diff --git a/backend/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs b/backend/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs index 7368744de..5617955e9 100644 --- a/backend/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs +++ b/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 FindByIdAsync(string roleId, CancellationToken cancellationToken) { return await Collection.Find(x => x.Id == roleId).FirstOrDefaultAsync(cancellationToken); diff --git a/backend/src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj b/backend/src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj index 6bacc7fec..e55e9029d 100644 --- a/backend/src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj +++ b/backend/src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable @@ -19,11 +19,11 @@ - - + + - + ..\..\Squidex.ruleset diff --git a/backend/src/Squidex.Domain.Users/Squidex.Domain.Users.csproj b/backend/src/Squidex.Domain.Users/Squidex.Domain.Users.csproj index c9ff573a8..4259484ef 100644 --- a/backend/src/Squidex.Domain.Users/Squidex.Domain.Users.csproj +++ b/backend/src/Squidex.Domain.Users/Squidex.Domain.Users.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable @@ -17,13 +17,13 @@ - - + + - + ..\..\Squidex.ruleset diff --git a/backend/src/Squidex.Infrastructure.Azure/EventSourcing/FilterExtensions.cs b/backend/src/Squidex.Infrastructure.Azure/EventSourcing/FilterExtensions.cs index 5bf989b47..68d13782c 100644 --- a/backend/src/Squidex.Infrastructure.Azure/EventSourcing/FilterExtensions.cs +++ b/backend/src/Squidex.Infrastructure.Azure/EventSourcing/FilterExtensions.cs @@ -22,7 +22,7 @@ namespace Squidex.Infrastructure.EventSourcing EnableCrossPartitionQuery = true }; - public static async Task FirstOrDefaultAsync(this IQueryable queryable, CancellationToken ct = default) + public static async Task FirstOrDefaultAsync(this IQueryable queryable, CancellationToken ct = default) { var documentQuery = queryable.AsDocumentQuery(); diff --git a/backend/src/Squidex.Infrastructure.Azure/EventSourcing/StreamPosition.cs b/backend/src/Squidex.Infrastructure.Azure/EventSourcing/StreamPosition.cs index f76acd006..98d934a15 100644 --- a/backend/src/Squidex.Infrastructure.Azure/EventSourcing/StreamPosition.cs +++ b/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(); diff --git a/backend/src/Squidex.Infrastructure.Azure/Squidex.Infrastructure.Azure.csproj b/backend/src/Squidex.Infrastructure.Azure/Squidex.Infrastructure.Azure.csproj index 6e8edc5b5..3e2b660a6 100644 --- a/backend/src/Squidex.Infrastructure.Azure/Squidex.Infrastructure.Azure.csproj +++ b/backend/src/Squidex.Infrastructure.Azure/Squidex.Infrastructure.Azure.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net5.0 Squidex.Infrastructure - 8.0 + 9.0 enable diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/Formatter.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/Formatter.cs index 99dfe137b..15b920620 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/Formatter.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/Formatter.cs @@ -43,7 +43,7 @@ namespace Squidex.Infrastructure.EventSourcing if (prefix != null && streamName.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)) { - streamName = streamName.Substring(prefix.Length + 1); + streamName = streamName[(prefix.Length + 1)..]; } return streamName; diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs index 28280a29d..8fb8baff5 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs @@ -69,7 +69,7 @@ namespace Squidex.Infrastructure.EventSourcing { var streamName = await projectionClient.CreateProjectionAsync(streamFilter); - var sliceStart = projectionClient.ParsePosition(position); + var sliceStart = ProjectionClient.ParsePosition(position); await QueryAsync(callback, streamName, sliceStart, ct); } @@ -236,7 +236,7 @@ namespace Squidex.Infrastructure.EventSourcing private static int ParseVersion(string message) { - return int.Parse(message.Substring(message.LastIndexOf(':') + 1)); + return int.Parse(message[(message.LastIndexOf(':') + 1)..]); } private string GetStreamName(string streamName) diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStoreSubscription.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStoreSubscription.cs index afcdafe94..bc1021736 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStoreSubscription.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStoreSubscription.cs @@ -32,7 +32,7 @@ namespace Squidex.Infrastructure.EventSourcing { this.connection = connection; - this.position = projectionClient.ParsePositionOrNull(position); + this.position = ProjectionClient.ParsePositionOrNull(position); this.prefix = prefix; var streamName = AsyncHelper.Sync(() => projectionClient.CreateProjectionAsync(streamFilter)); diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/ProjectionClient.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/ProjectionClient.cs index b12d2c7b1..c640303e4 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/ProjectionClient.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/ProjectionClient.cs @@ -106,12 +106,12 @@ namespace Squidex.Infrastructure.EventSourcing } } - public long? ParsePositionOrNull(string? position) + public static long? ParsePositionOrNull(string? position) { return long.TryParse(position, out var parsedPosition) ? (long?)parsedPosition : null; } - public long ParsePosition(string? position) + public static long ParsePosition(string? position) { return long.TryParse(position, out var parsedPosition) ? parsedPosition + 1 : StreamPosition.Start; } diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/Squidex.Infrastructure.GetEventStore.csproj b/backend/src/Squidex.Infrastructure.GetEventStore/Squidex.Infrastructure.GetEventStore.csproj index c498cd42c..08cfea517 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/Squidex.Infrastructure.GetEventStore.csproj +++ b/backend/src/Squidex.Infrastructure.GetEventStore/Squidex.Infrastructure.GetEventStore.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net5.0 Squidex.Infrastructure - 8.0 + 9.0 enable diff --git a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/StreamPosition.cs b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/StreamPosition.cs index 7b0353c7d..9e937cf6e 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/StreamPosition.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/StreamPosition.cs @@ -42,11 +42,11 @@ namespace Squidex.Infrastructure.EventSourcing try { sb.Append(position.Timestamp.Timestamp); - sb.Append("-"); + sb.Append('-'); sb.Append(position.Timestamp.Increment); - sb.Append("-"); + sb.Append('-'); sb.Append(position.CommitOffset); - sb.Append("-"); + sb.Append('-'); sb.Append(position.CommitSize); return sb.ToString(); diff --git a/backend/src/Squidex.Infrastructure.MongoDb/Log/MongoRequestLogRepository.cs b/backend/src/Squidex.Infrastructure.MongoDb/Log/MongoRequestLogRepository.cs index 32a99c5b0..f8b59ed19 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/Log/MongoRequestLogRepository.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/Log/MongoRequestLogRepository.cs @@ -13,7 +13,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.Options; using MongoDB.Driver; using NodaTime; -using Squidex.Infrastructure.Log; using Squidex.Infrastructure.MongoDb; namespace Squidex.Infrastructure.Log diff --git a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/BsonHelper.cs b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/BsonHelper.cs index 9e5370191..8c63fe0b8 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/BsonHelper.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/BsonHelper.cs @@ -44,7 +44,7 @@ namespace Squidex.Infrastructure.MongoDb return toReplace.ToString(); } - return replacement + value.Substring(1); + return replacement + value[1..]; } } } diff --git a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs index 0287d8870..9193d6180 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs @@ -97,8 +97,7 @@ namespace Squidex.Infrastructure.MongoDb } public static async Task UpsertVersionedAsync(this IMongoCollection collection, TKey key, long oldVersion, long newVersion, Func, UpdateDefinition> updater) - where T : IVersionedEntity - where TKey : notnull + where T : IVersionedEntity where TKey : notnull { try { @@ -133,8 +132,7 @@ namespace Squidex.Infrastructure.MongoDb } public static async Task UpsertVersionedAsync(this IMongoCollection collection, TKey key, long oldVersion, long newVersion, T document) - where T : IVersionedEntity - where TKey : notnull + where T : IVersionedEntity where TKey : notnull { try { @@ -170,8 +168,7 @@ namespace Squidex.Infrastructure.MongoDb } private static string GetVersionField() - where T : IVersionedEntity - where TKey : notnull + where T : IVersionedEntity where TKey : notnull { return BsonClassMap.LookupClassMap(typeof(T)).GetMemberMap(nameof(IVersionedEntity.Version)).ElementName; } diff --git a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/Queries/FilterVisitor.cs b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/Queries/FilterVisitor.cs index aaae69798..793f0fcf8 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/Queries/FilterVisitor.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/MongoDb/Queries/FilterVisitor.cs @@ -58,7 +58,7 @@ namespace Squidex.Infrastructure.MongoDb.Queries Filter.Exists(propertyName, false), Filter.Eq(propertyName, default(T)!), Filter.Eq(propertyName, string.Empty), - Filter.Eq(propertyName, new T[0])); + Filter.Eq(propertyName, Array.Empty())); case CompareOperator.StartsWith: return Filter.Regex(propertyName, BuildRegex(nodeIn, s => "^" + s)); case CompareOperator.Contains: diff --git a/backend/src/Squidex.Infrastructure.MongoDb/Squidex.Infrastructure.MongoDb.csproj b/backend/src/Squidex.Infrastructure.MongoDb/Squidex.Infrastructure.MongoDb.csproj index 2eaf5a35e..ce9fb394e 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/Squidex.Infrastructure.MongoDb.csproj +++ b/backend/src/Squidex.Infrastructure.MongoDb/Squidex.Infrastructure.MongoDb.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net5.0 Squidex.Infrastructure - 8.0 + 9.0 enable @@ -13,11 +13,11 @@ - - + + - + diff --git a/backend/src/Squidex.Infrastructure.RabbitMq/Squidex.Infrastructure.RabbitMq.csproj b/backend/src/Squidex.Infrastructure.RabbitMq/Squidex.Infrastructure.RabbitMq.csproj index b58f6ebc1..85367f45b 100644 --- a/backend/src/Squidex.Infrastructure.RabbitMq/Squidex.Infrastructure.RabbitMq.csproj +++ b/backend/src/Squidex.Infrastructure.RabbitMq/Squidex.Infrastructure.RabbitMq.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net5.0 Squidex.Infrastructure - 8.0 + 9.0 enable diff --git a/backend/src/Squidex.Infrastructure.Redis/Squidex.Infrastructure.Redis.csproj b/backend/src/Squidex.Infrastructure.Redis/Squidex.Infrastructure.Redis.csproj index 5e71c06b6..d1083f375 100644 --- a/backend/src/Squidex.Infrastructure.Redis/Squidex.Infrastructure.Redis.csproj +++ b/backend/src/Squidex.Infrastructure.Redis/Squidex.Infrastructure.Redis.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net5.0 Squidex.Infrastructure 7.3 diff --git a/backend/src/Squidex.Infrastructure/Collections/ImmutableDictionary{TKey,TValue}.cs b/backend/src/Squidex.Infrastructure/Collections/ImmutableDictionary{TKey,TValue}.cs index 7b7394fce..767916111 100644 --- a/backend/src/Squidex.Infrastructure/Collections/ImmutableDictionary{TKey,TValue}.cs +++ b/backend/src/Squidex.Infrastructure/Collections/ImmutableDictionary{TKey,TValue}.cs @@ -9,9 +9,6 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -#pragma warning disable IDE0044 // Add readonly modifier -#pragma warning disable RECS0108 // Warns about static fields in generic types - namespace Squidex.Infrastructure.Collections { public class ImmutableDictionary : IReadOnlyDictionary where TKey : notnull diff --git a/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs b/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs index 195dee557..a0b25b200 100644 --- a/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs +++ b/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs @@ -75,7 +75,7 @@ namespace Squidex.Infrastructure.Commands { try { - var domainObject = (T)serviceProvider.GetService(typeof(T)); + var domainObject = (T)serviceProvider.GetService(typeof(T))!; domainObject.Setup(id); diff --git a/backend/src/Squidex.Infrastructure/DomainId.cs b/backend/src/Squidex.Infrastructure/DomainId.cs index fdc0177d2..d06a5974f 100644 --- a/backend/src/Squidex.Infrastructure/DomainId.cs +++ b/backend/src/Squidex.Infrastructure/DomainId.cs @@ -7,7 +7,6 @@ using System; using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; namespace Squidex.Infrastructure { @@ -74,7 +73,7 @@ namespace Squidex.Infrastructure return id ?? EmptyString; } - public int CompareTo([AllowNull] DomainId other) + public int CompareTo(DomainId other) { return string.Compare(ToString(), other.ToString(), StringComparison.Ordinal); } diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs index d5b8235bb..db3c8b371 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs @@ -170,7 +170,7 @@ namespace Squidex.Infrastructure.EventSourcing.Grains await ClearAsync(); - State = State.Reset(); + State = EventConsumerState.Reset(); Subscribe(); }); diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerState.cs b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerState.cs index acddcbec8..67770a3dc 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerState.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerState.cs @@ -41,7 +41,7 @@ namespace Squidex.Infrastructure.EventSourcing.Grains Count = count; } - public EventConsumerState Reset() + public static EventConsumerState Reset() { return new EventConsumerState(); } diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/RetrySubscription.cs b/backend/src/Squidex.Infrastructure/EventSourcing/RetrySubscription.cs index 26ecce026..561b6506e 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/RetrySubscription.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/RetrySubscription.cs @@ -9,8 +9,6 @@ using System; using System.Threading; using System.Threading.Tasks; -#pragma warning disable RECS0002 // Convert anonymous method to method group - namespace Squidex.Infrastructure.EventSourcing { public sealed class RetrySubscription : IEventSubscription, IEventSubscriber diff --git a/backend/src/Squidex.Infrastructure/FileExtensions.cs b/backend/src/Squidex.Infrastructure/FileExtensions.cs index 44ada6f41..68a120f61 100644 --- a/backend/src/Squidex.Infrastructure/FileExtensions.cs +++ b/backend/src/Squidex.Infrastructure/FileExtensions.cs @@ -33,7 +33,7 @@ namespace Squidex.Infrastructure try { var fileInfo = new FileInfo(fileName); - var fileType = fileInfo.Extension.Substring(1).ToLowerInvariant(); + var fileType = fileInfo.Extension[1..].ToLowerInvariant(); if (UnifiedExtensions.TryGetValue(fileType, out var unified)) { diff --git a/backend/src/Squidex.Infrastructure/Guard.cs b/backend/src/Squidex.Infrastructure/Guard.cs index b1fa63c6e..2edb9fa43 100644 --- a/backend/src/Squidex.Infrastructure/Guard.cs +++ b/backend/src/Squidex.Infrastructure/Guard.cs @@ -212,7 +212,7 @@ namespace Squidex.Infrastructure { NotNullOrEmpty(target, parameterName); - if (target.Intersect(Path.GetInvalidFileNameChars()).Any()) + if (target != null && target.Intersect(Path.GetInvalidFileNameChars()).Any()) { throw new ArgumentException("Value contains an invalid character.", parameterName); } diff --git a/backend/src/Squidex.Infrastructure/Json/Newtonsoft/ClaimsPrincipalConverter.cs b/backend/src/Squidex.Infrastructure/Json/Newtonsoft/ClaimsPrincipalConverter.cs index bde9e0013..3a9a501d4 100644 --- a/backend/src/Squidex.Infrastructure/Json/Newtonsoft/ClaimsPrincipalConverter.cs +++ b/backend/src/Squidex.Infrastructure/Json/Newtonsoft/ClaimsPrincipalConverter.cs @@ -42,7 +42,7 @@ namespace Squidex.Infrastructure.Json.Newtonsoft { return new JsonClaim { Type = c.Type, Value = c.Value }; }).ToArray(), - AuthenticationType = identity.AuthenticationType + AuthenticationType = identity.AuthenticationType! }).ToArray(); serializer.Serialize(writer, jsonIdentities); @@ -50,7 +50,7 @@ namespace Squidex.Infrastructure.Json.Newtonsoft protected override ClaimsPrincipal ReadValue(JsonReader reader, Type objectType, JsonSerializer serializer) { - var jsonIdentities = serializer.Deserialize(reader); + var jsonIdentities = serializer.Deserialize(reader)!; return new ClaimsPrincipal( jsonIdentities.Select(identity => diff --git a/backend/src/Squidex.Infrastructure/Json/Newtonsoft/DomainIdConverter.cs b/backend/src/Squidex.Infrastructure/Json/Newtonsoft/DomainIdConverter.cs index 6038a9380..dd0c556b1 100644 --- a/backend/src/Squidex.Infrastructure/Json/Newtonsoft/DomainIdConverter.cs +++ b/backend/src/Squidex.Infrastructure/Json/Newtonsoft/DomainIdConverter.cs @@ -11,7 +11,7 @@ using Newtonsoft.Json; namespace Squidex.Infrastructure.Json.Newtonsoft { - public sealed class DomainIdConverter : JsonConverter + public sealed class DomainIdConverter : JsonConverter, ISupportedTypes { public IEnumerable SupportedTypes { diff --git a/backend/src/Squidex.Infrastructure/Json/Newtonsoft/InstantConverter.cs b/backend/src/Squidex.Infrastructure/Json/Newtonsoft/InstantConverter.cs index 034d00c4c..e7a7ba131 100644 --- a/backend/src/Squidex.Infrastructure/Json/Newtonsoft/InstantConverter.cs +++ b/backend/src/Squidex.Infrastructure/Json/Newtonsoft/InstantConverter.cs @@ -13,7 +13,7 @@ using NodaTime.Text; namespace Squidex.Infrastructure.Json.Newtonsoft { - public sealed class InstantConverter : JsonConverter + public sealed class InstantConverter : JsonConverter, ISupportedTypes { public IEnumerable SupportedTypes { diff --git a/backend/src/Squidex.Infrastructure/Json/Objects/JsonObject.cs b/backend/src/Squidex.Infrastructure/Json/Objects/JsonObject.cs index a7372d291..081f6d4c0 100644 --- a/backend/src/Squidex.Infrastructure/Json/Objects/JsonObject.cs +++ b/backend/src/Squidex.Infrastructure/Json/Objects/JsonObject.cs @@ -113,7 +113,7 @@ namespace Squidex.Infrastructure.Json.Objects return Equals(obj as JsonObject); } - public bool Equals([AllowNull] IJsonValue other) + public bool Equals(IJsonValue? other) { return Equals(other as JsonObject); } diff --git a/backend/src/Squidex.Infrastructure/Language.cs b/backend/src/Squidex.Infrastructure/Language.cs index a799a5351..97e8b518f 100644 --- a/backend/src/Squidex.Infrastructure/Language.cs +++ b/backend/src/Squidex.Infrastructure/Language.cs @@ -12,16 +12,9 @@ using System.Text.RegularExpressions; namespace Squidex.Infrastructure { - [Equals(DoNotAddEqualityOperators = true)] - public sealed partial class Language + public partial record Language { private static readonly Regex CultureRegex = new Regex("^([a-z]{2})(\\-[a-z]{2})?$", RegexOptions.IgnoreCase); - private static readonly Dictionary AllLanguagesField = new Dictionary(StringComparer.OrdinalIgnoreCase); - - internal static Language AddLanguage(string iso2Code, string englishName) - { - return AllLanguagesField.GetOrAdd(iso2Code, englishName, (c, n) => new Language(c, n)); - } public static Language GetLanguage(string iso2Code) { @@ -42,16 +35,16 @@ namespace Squidex.Infrastructure get { return AllLanguagesField.Values; } } - [IgnoreDuringEquals] - public string EnglishName { get; } - public string Iso2Code { get; } - private Language(string iso2Code, string englishName) + public string EnglishName { - Iso2Code = iso2Code; + get { return AllLanguagesNames.GetOrDefault(Iso2Code) ?? string.Empty; } + } - EnglishName = englishName; + private Language(string iso2Code) + { + Iso2Code = iso2Code; } public static bool IsValidLanguage(string iso2Code) diff --git a/backend/src/Squidex.Infrastructure/Languages.cs b/backend/src/Squidex.Infrastructure/Languages.cs index ead00749d..5128915c1 100644 --- a/backend/src/Squidex.Infrastructure/Languages.cs +++ b/backend/src/Squidex.Infrastructure/Languages.cs @@ -7,13 +7,25 @@ // ========================================================================== // +using System; using System.CodeDom.Compiler; +using System.Collections.Generic; namespace Squidex.Infrastructure { [GeneratedCode("LanguagesGenerator", "1.0")] - partial class Language + public partial record Language { + private static readonly Dictionary AllLanguagesField = new Dictionary(StringComparer.OrdinalIgnoreCase); + private static readonly Dictionary AllLanguagesNames = new Dictionary(StringComparer.OrdinalIgnoreCase); + + internal static Language AddLanguage(string iso2Code, string englishName) + { + AllLanguagesNames[iso2Code] = englishName; + + return AllLanguagesField.GetOrAdd(iso2Code, code => new Language(code)); + } + public static readonly Language AA = AddLanguage("aa", "Afar"); public static readonly Language AB = AddLanguage("ab", "Abkhazian"); public static readonly Language AE = AddLanguage("ae", "Avestan"); @@ -235,7 +247,7 @@ namespace Squidex.Infrastructure public static readonly Language TibetanIndia = AddLanguage("bo-IN", "Tibetan (India)"); public static readonly Language BretonFrance = AddLanguage("br-FR", "Breton (France)"); public static readonly Language CatalanAndorra = AddLanguage("ca-AD", "Catalan (Andorra)"); - public static readonly Language CatalanCatalan = AddLanguage("ca-ES", "Catalan (Catalan)"); + public static readonly Language CatalanSpain = AddLanguage("ca-ES", "Catalan (Spain)"); public static readonly Language CatalanFrance = AddLanguage("ca-FR", "Catalan (France)"); public static readonly Language CatalanItaly = AddLanguage("ca-IT", "Catalan (Italy)"); public static readonly Language ChechenRussia = AddLanguage("ce-RU", "Chechen (Russia)"); @@ -270,7 +282,7 @@ namespace Squidex.Infrastructure public static readonly Language EnglishBotswana = AddLanguage("en-BW", "English (Botswana)"); public static readonly Language EnglishBelize = AddLanguage("en-BZ", "English (Belize)"); public static readonly Language EnglishCanada = AddLanguage("en-CA", "English (Canada)"); - public static readonly Language EnglishCocosKeelingIslands = AddLanguage("en-CC", "English (Cocos (Keeling) Islands)"); + public static readonly Language EnglishCocosKeelingIslands = AddLanguage("en-CC", "English (Cocos [Keeling] Islands)"); public static readonly Language EnglishSwitzerland = AddLanguage("en-CH", "English (Switzerland)"); public static readonly Language EnglishCookIslands = AddLanguage("en-CK", "English (Cook Islands)"); public static readonly Language EnglishCameroon = AddLanguage("en-CM", "English (Cameroon)"); @@ -293,7 +305,6 @@ namespace Squidex.Infrastructure public static readonly Language EnglishGuam = AddLanguage("en-GU", "English (Guam)"); public static readonly Language EnglishGuyana = AddLanguage("en-GY", "English (Guyana)"); public static readonly Language EnglishHongKongSAR = AddLanguage("en-HK", "English (Hong Kong SAR)"); - public static readonly Language EnglishIndonesia = AddLanguage("en-ID", "English (Indonesia)"); public static readonly Language EnglishIreland = AddLanguage("en-IE", "English (Ireland)"); public static readonly Language EnglishIsrael = AddLanguage("en-IL", "English (Israel)"); public static readonly Language EnglishIsleofMan = AddLanguage("en-IM", "English (Isle of Man)"); @@ -341,7 +352,7 @@ namespace Squidex.Infrastructure public static readonly Language EnglishSierraLeone = AddLanguage("en-SL", "English (Sierra Leone)"); public static readonly Language EnglishSouthSudan = AddLanguage("en-SS", "English (South Sudan)"); public static readonly Language EnglishSintMaarten = AddLanguage("en-SX", "English (Sint Maarten)"); - public static readonly Language EnglishSwaziland = AddLanguage("en-SZ", "English (Swaziland)"); + public static readonly Language EnglishEswatini = AddLanguage("en-SZ", "English (Eswatini)"); public static readonly Language EnglishTurksandCaicosIslands = AddLanguage("en-TC", "English (Turks and Caicos Islands)"); public static readonly Language EnglishTokelau = AddLanguage("en-TK", "English (Tokelau)"); public static readonly Language EnglishTonga = AddLanguage("en-TO", "English (Tonga)"); @@ -351,7 +362,7 @@ namespace Squidex.Infrastructure public static readonly Language EnglishUganda = AddLanguage("en-UG", "English (Uganda)"); public static readonly Language EnglishUSOutlyingIslands = AddLanguage("en-UM", "English (U.S. Outlying Islands)"); public static readonly Language EnglishUnitedStates = AddLanguage("en-US", "English (United States)"); - public static readonly Language EnglishSaintVincentandtheGrenadines = AddLanguage("en-VC", "English (Saint Vincent and the Grenadines)"); + public static readonly Language EnglishSaintVincentandGrenadines = AddLanguage("en-VC", "English (Saint Vincent and Grenadines)"); public static readonly Language EnglishBritishVirginIslands = AddLanguage("en-VG", "English (British Virgin Islands)"); public static readonly Language EnglishUSVirginIslands = AddLanguage("en-VI", "English (U.S. Virgin Islands)"); public static readonly Language EnglishVanuatu = AddLanguage("en-VU", "English (Vanuatu)"); @@ -369,7 +380,7 @@ namespace Squidex.Infrastructure public static readonly Language SpanishCuba = AddLanguage("es-CU", "Spanish (Cuba)"); public static readonly Language SpanishDominicanRepublic = AddLanguage("es-DO", "Spanish (Dominican Republic)"); public static readonly Language SpanishEcuador = AddLanguage("es-EC", "Spanish (Ecuador)"); - public static readonly Language SpanishSpainInternationalSort = AddLanguage("es-ES", "Spanish (Spain, International Sort)"); + public static readonly Language SpanishSpain = AddLanguage("es-ES", "Spanish (Spain)"); public static readonly Language SpanishEquatorialGuinea = AddLanguage("es-GQ", "Spanish (Equatorial Guinea)"); public static readonly Language SpanishGuatemala = AddLanguage("es-GT", "Spanish (Guatemala)"); public static readonly Language SpanishHonduras = AddLanguage("es-HN", "Spanish (Honduras)"); @@ -385,12 +396,8 @@ namespace Squidex.Infrastructure public static readonly Language SpanishUruguay = AddLanguage("es-UY", "Spanish (Uruguay)"); public static readonly Language SpanishVenezuela = AddLanguage("es-VE", "Spanish (Venezuela)"); public static readonly Language EstonianEstonia = AddLanguage("et-EE", "Estonian (Estonia)"); - public static readonly Language BasqueBasque = AddLanguage("eu-ES", "Basque (Basque)"); + public static readonly Language BasqueSpain = AddLanguage("eu-ES", "Basque (Spain)"); public static readonly Language PersianIran = AddLanguage("fa-IR", "Persian (Iran)"); - public static readonly Language FulahCameroon = AddLanguage("ff-CM", "Fulah (Cameroon)"); - public static readonly Language FulahGuinea = AddLanguage("ff-GN", "Fulah (Guinea)"); - public static readonly Language FulahMauritania = AddLanguage("ff-MR", "Fulah (Mauritania)"); - public static readonly Language FulahNigeria = AddLanguage("ff-NG", "Fulah (Nigeria)"); public static readonly Language FinnishFinland = AddLanguage("fi-FI", "Finnish (Finland)"); public static readonly Language FaroeseDenmark = AddLanguage("fo-DK", "Faroese (Denmark)"); public static readonly Language FaroeseFaroeIslands = AddLanguage("fo-FO", "Faroese (Faroe Islands)"); @@ -400,7 +407,7 @@ namespace Squidex.Infrastructure public static readonly Language FrenchBenin = AddLanguage("fr-BJ", "French (Benin)"); public static readonly Language FrenchSaintBarthélemy = AddLanguage("fr-BL", "French (Saint Barthélemy)"); public static readonly Language FrenchCanada = AddLanguage("fr-CA", "French (Canada)"); - public static readonly Language FrenchCongoDRC = AddLanguage("fr-CD", "French Congo (DRC)"); + public static readonly Language FrenchCongoDRC = AddLanguage("fr-CD", "French (Congo [DRC])"); public static readonly Language FrenchCentralAfricanRepublic = AddLanguage("fr-CF", "French (Central African Republic)"); public static readonly Language FrenchCongo = AddLanguage("fr-CG", "French (Congo)"); public static readonly Language FrenchSwitzerland = AddLanguage("fr-CH", "French (Switzerland)"); @@ -443,7 +450,7 @@ namespace Squidex.Infrastructure public static readonly Language WesternFrisianNetherlands = AddLanguage("fy-NL", "Western Frisian (Netherlands)"); public static readonly Language IrishIreland = AddLanguage("ga-IE", "Irish (Ireland)"); public static readonly Language ScottishGaelicUnitedKingdom = AddLanguage("gd-GB", "Scottish Gaelic (United Kingdom)"); - public static readonly Language GalicianGalician = AddLanguage("gl-ES", "Galician (Galician)"); + public static readonly Language GalicianSpain = AddLanguage("gl-ES", "Galician (Spain)"); public static readonly Language GuaraniParaguay = AddLanguage("gn-PY", "Guarani (Paraguay)"); public static readonly Language GujaratiIndia = AddLanguage("gu-IN", "Gujarati (India)"); public static readonly Language ManxIsleofMan = AddLanguage("gv-IM", "Manx (Isle of Man)"); @@ -461,6 +468,7 @@ namespace Squidex.Infrastructure public static readonly Language ItalianItaly = AddLanguage("it-IT", "Italian (Italy)"); public static readonly Language ItalianSanMarino = AddLanguage("it-SM", "Italian (San Marino)"); public static readonly Language ItalianVaticanCity = AddLanguage("it-VA", "Italian (Vatican City)"); + public static readonly Language InuktitutCanada = AddLanguage("iu-CA", "Inuktitut (Canada)"); public static readonly Language JapaneseJapan = AddLanguage("ja-JP", "Japanese (Japan)"); public static readonly Language GeorgianGeorgia = AddLanguage("ka-GE", "Georgian (Georgia)"); public static readonly Language KikuyuKenya = AddLanguage("ki-KE", "Kikuyu (Kenya)"); @@ -470,18 +478,17 @@ namespace Squidex.Infrastructure public static readonly Language KannadaIndia = AddLanguage("kn-IN", "Kannada (India)"); public static readonly Language KoreanNorthKorea = AddLanguage("ko-KP", "Korean (North Korea)"); public static readonly Language KoreanKorea = AddLanguage("ko-KR", "Korean (Korea)"); - public static readonly Language KanuriNigeria = AddLanguage("kr-NG", "Kanuri (Nigeria)"); public static readonly Language CornishUnitedKingdom = AddLanguage("kw-GB", "Cornish (United Kingdom)"); public static readonly Language KyrgyzKyrgyzstan = AddLanguage("ky-KG", "Kyrgyz (Kyrgyzstan)"); public static readonly Language LuxembourgishLuxembourg = AddLanguage("lb-LU", "Luxembourgish (Luxembourg)"); public static readonly Language GandaUganda = AddLanguage("lg-UG", "Ganda (Uganda)"); public static readonly Language LingalaAngola = AddLanguage("ln-AO", "Lingala (Angola)"); - public static readonly Language LingalaCongoDRC = AddLanguage("ln-CD", "Lingala (Congo DRC)"); + public static readonly Language LingalaCongoDRC = AddLanguage("ln-CD", "Lingala (Congo [DRC])"); public static readonly Language LingalaCentralAfricanRepublic = AddLanguage("ln-CF", "Lingala (Central African Republic)"); public static readonly Language LingalaCongo = AddLanguage("ln-CG", "Lingala (Congo)"); public static readonly Language LaoLaos = AddLanguage("lo-LA", "Lao (Laos)"); public static readonly Language LithuanianLithuania = AddLanguage("lt-LT", "Lithuanian (Lithuania)"); - public static readonly Language LubaKatangaCongoDRC = AddLanguage("lu-CD", "Luba-Katanga (Congo DRC)"); + public static readonly Language LubaKatangaCongoDRC = AddLanguage("lu-CD", "Luba-Katanga (Congo [DRC])"); public static readonly Language LatvianLatvia = AddLanguage("lv-LV", "Latvian (Latvia)"); public static readonly Language MalagasyMadagascar = AddLanguage("mg-MG", "Malagasy (Madagascar)"); public static readonly Language MaoriNewZealand = AddLanguage("mi-NZ", "Maori (New Zealand)"); @@ -537,9 +544,9 @@ namespace Squidex.Infrastructure public static readonly Language RussianUkraine = AddLanguage("ru-UA", "Russian (Ukraine)"); public static readonly Language KinyarwandaRwanda = AddLanguage("rw-RW", "Kinyarwanda (Rwanda)"); public static readonly Language SanskritIndia = AddLanguage("sa-IN", "Sanskrit (India)"); - public static readonly Language SamiNorthernFinland = AddLanguage("se-FI", "Sami, Northern (Finland)"); - public static readonly Language SamiNorthernNorway = AddLanguage("se-NO", "Sami, Northern (Norway)"); - public static readonly Language SamiNorthernSweden = AddLanguage("se-SE", "Sami, Northern (Sweden)"); + public static readonly Language NorthernSamiFinland = AddLanguage("se-FI", "Northern Sami (Finland)"); + public static readonly Language NorthernSamiNorway = AddLanguage("se-NO", "Northern Sami (Norway)"); + public static readonly Language NorthernSamiSweden = AddLanguage("se-SE", "Northern Sami (Sweden)"); public static readonly Language SangoCentralAfricanRepublic = AddLanguage("sg-CF", "Sango (Central African Republic)"); public static readonly Language SinhalaSriLanka = AddLanguage("si-LK", "Sinhala (Sri Lanka)"); public static readonly Language SlovakSlovakia = AddLanguage("sk-SK", "Slovak (Slovakia)"); @@ -551,14 +558,14 @@ namespace Squidex.Infrastructure public static readonly Language AlbanianAlbania = AddLanguage("sq-AL", "Albanian (Albania)"); public static readonly Language AlbanianMacedoniaFYRO = AddLanguage("sq-MK", "Albanian (Macedonia, FYRO)"); public static readonly Language AlbanianKosovo = AddLanguage("sq-XK", "Albanian (Kosovo)"); - public static readonly Language siSwatiSwaziland = AddLanguage("ss-SZ", "siSwati (Swaziland)"); + public static readonly Language siSwatiEswatini = AddLanguage("ss-SZ", "siSwati (Eswatini)"); public static readonly Language siSwatiSouthAfrica = AddLanguage("ss-ZA", "siSwati (South Africa)"); public static readonly Language SesothoLesotho = AddLanguage("st-LS", "Sesotho (Lesotho)"); public static readonly Language SesothoSouthAfrica = AddLanguage("st-ZA", "Sesotho (South Africa)"); public static readonly Language SwedishÅlandIslands = AddLanguage("sv-AX", "Swedish (Åland Islands)"); public static readonly Language SwedishFinland = AddLanguage("sv-FI", "Swedish (Finland)"); public static readonly Language SwedishSweden = AddLanguage("sv-SE", "Swedish (Sweden)"); - public static readonly Language KiswahiliCongoDRC = AddLanguage("sw-CD", "Kiswahili (Congo DRC)"); + public static readonly Language KiswahiliCongoDRC = AddLanguage("sw-CD", "Kiswahili (Congo [DRC])"); public static readonly Language KiswahiliKenya = AddLanguage("sw-KE", "Kiswahili (Kenya)"); public static readonly Language KiswahiliTanzania = AddLanguage("sw-TZ", "Kiswahili (Tanzania)"); public static readonly Language KiswahiliUganda = AddLanguage("sw-UG", "Kiswahili (Uganda)"); @@ -588,11 +595,11 @@ namespace Squidex.Infrastructure public static readonly Language isiXhosaSouthAfrica = AddLanguage("xh-ZA", "isiXhosa (South Africa)"); public static readonly Language YorubaBenin = AddLanguage("yo-BJ", "Yoruba (Benin)"); public static readonly Language YorubaNigeria = AddLanguage("yo-NG", "Yoruba (Nigeria)"); - public static readonly Language ChineseSimplifiedChina = AddLanguage("zh-CN", "Chinese (Simplified, China)"); - public static readonly Language ChineseTraditionalHongKongSAR = AddLanguage("zh-HK", "Chinese (Traditional, Hong Kong SAR)"); - public static readonly Language ChineseTraditionalMacaoSAR = AddLanguage("zh-MO", "Chinese (Traditional, Macao SAR)"); - public static readonly Language ChineseSimplifiedSingapore = AddLanguage("zh-SG", "Chinese (Simplified, Singapore)"); - public static readonly Language ChineseTraditionalTaiwan = AddLanguage("zh-TW", "Chinese (Traditional, Taiwan)"); + public static readonly Language ChineseChina = AddLanguage("zh-CN", "Chinese (China)"); + public static readonly Language ChineseSingapore = AddLanguage("zh-SG", "Chinese (Singapore)"); + public static readonly Language ChineseHongKongSAR = AddLanguage("zh-HK", "Chinese (Hong Kong SAR)"); + public static readonly Language ChineseMacaoSAR = AddLanguage("zh-MO", "Chinese (Macao SAR)"); + public static readonly Language ChineseTaiwan = AddLanguage("zh-TW", "Chinese (Taiwan)"); public static readonly Language isiZuluSouthAfrica = AddLanguage("zu-ZA", "isiZulu (South Africa)"); } } diff --git a/backend/src/Squidex.Infrastructure/LanguagesInitializer.cs b/backend/src/Squidex.Infrastructure/LanguagesInitializer.cs index e60793cfa..3e5440b8d 100644 --- a/backend/src/Squidex.Infrastructure/LanguagesInitializer.cs +++ b/backend/src/Squidex.Infrastructure/LanguagesInitializer.cs @@ -28,7 +28,10 @@ namespace Squidex.Infrastructure { if (!string.IsNullOrWhiteSpace(key) && !string.IsNullOrWhiteSpace(value)) { - Language.AddLanguage(key, value); + if (!Language.TryGetLanguage(key, out _)) + { + Language.AddLanguage(key, value); + } } } diff --git a/backend/src/Squidex.Infrastructure/Log/BackgroundRequestLogStore.cs b/backend/src/Squidex.Infrastructure/Log/BackgroundRequestLogStore.cs index 5119f9d76..f8a21951b 100644 --- a/backend/src/Squidex.Infrastructure/Log/BackgroundRequestLogStore.cs +++ b/backend/src/Squidex.Infrastructure/Log/BackgroundRequestLogStore.cs @@ -57,7 +57,7 @@ namespace Squidex.Infrastructure.Log { var localJobs = Interlocked.Exchange(ref jobs, new ConcurrentQueue()); - if (localJobs.Count > 0) + if (!localJobs.IsEmpty) { var pages = (int)Math.Ceiling((double)localJobs.Count / BatchSize); diff --git a/backend/src/Squidex.Infrastructure/NamedId{T}.cs b/backend/src/Squidex.Infrastructure/NamedId{T}.cs index b93671e34..4dae47778 100644 --- a/backend/src/Squidex.Infrastructure/NamedId{T}.cs +++ b/backend/src/Squidex.Infrastructure/NamedId{T}.cs @@ -8,14 +8,11 @@ using System; using System.Diagnostics.CodeAnalysis; -#pragma warning disable RECS0108 // Warns about static fields in generic types - namespace Squidex.Infrastructure { public delegate bool Parser(ReadOnlySpan input, out T result); - [Equals(DoNotAddEqualityOperators = true)] - public sealed class NamedId where T : notnull + public sealed record NamedId where T : notnull { private static readonly int GuidLength = Guid.Empty.ToString().Length; @@ -50,7 +47,7 @@ namespace Squidex.Infrastructure { if (parser(span.Slice(0, GuidLength), out var id)) { - result = new NamedId(id, value.Substring(GuidLength + 1)); + result = new NamedId(id, value[(GuidLength + 1)..]); return true; } @@ -64,7 +61,7 @@ namespace Squidex.Infrastructure { if (parser(span.Slice(0, index), out var id)) { - result = new NamedId(id, value.Substring(index + 1)); + result = new NamedId(id, value[(index + 1)..]); return true; } diff --git a/backend/src/Squidex.Infrastructure/Net/IPAddressComparer.cs b/backend/src/Squidex.Infrastructure/Net/IPAddressComparer.cs index 0a5f8f939..fd8a11c98 100644 --- a/backend/src/Squidex.Infrastructure/Net/IPAddressComparer.cs +++ b/backend/src/Squidex.Infrastructure/Net/IPAddressComparer.cs @@ -6,7 +6,6 @@ // ========================================================================== using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Net; namespace Squidex.Infrastructure.Net @@ -19,7 +18,7 @@ namespace Squidex.Infrastructure.Net { } - public int Compare([AllowNull] IPAddress x, [AllowNull] IPAddress y) + public int Compare(IPAddress? x, IPAddress? y) { if (x == null || y == null) { diff --git a/backend/src/Squidex.Infrastructure/Orleans/GrainState.cs b/backend/src/Squidex.Infrastructure/Orleans/GrainState.cs index d688acabd..a62ef9326 100644 --- a/backend/src/Squidex.Infrastructure/Orleans/GrainState.cs +++ b/backend/src/Squidex.Infrastructure/Orleans/GrainState.cs @@ -46,13 +46,13 @@ namespace Squidex.Infrastructure.Orleans if (context.GrainIdentity.PrimaryKeyString != null) { - var store = context.ActivationServices.GetService>(); + var store = context.ActivationServices.GetRequiredService>(); persistence = store.WithSnapshots(GetType(), context.GrainIdentity.PrimaryKeyString, ApplyState); } else { - var store = context.ActivationServices.GetService>(); + var store = context.ActivationServices.GetRequiredService>(); persistence = store.WithSnapshots(GetType(), context.GrainIdentity.PrimaryKey, ApplyState); } diff --git a/backend/src/Squidex.Infrastructure/Orleans/J.cs b/backend/src/Squidex.Infrastructure/Orleans/J.cs index aee59a82d..630dad17d 100644 --- a/backend/src/Squidex.Infrastructure/Orleans/J.cs +++ b/backend/src/Squidex.Infrastructure/Orleans/J.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Squidex.Infrastructure.Json; #pragma warning disable SA1401 // Fields must be private +#pragma warning disable CA2211 // Non-constant fields should not be visible namespace Squidex.Infrastructure.Orleans { diff --git a/backend/src/Squidex.Infrastructure/Queries/OData/EdmModelExtensions.cs b/backend/src/Squidex.Infrastructure/Queries/OData/EdmModelExtensions.cs index bf25ddb59..f360c996e 100644 --- a/backend/src/Squidex.Infrastructure/Queries/OData/EdmModelExtensions.cs +++ b/backend/src/Squidex.Infrastructure/Queries/OData/EdmModelExtensions.cs @@ -35,7 +35,7 @@ namespace Squidex.Infrastructure.Queries.OData if (query.StartsWith("?", StringComparison.Ordinal)) { - query = query.Substring(1); + query = query[1..]; } var parser = new ODataUriParser(model, new Uri($"{path}?{query}", UriKind.Relative)); diff --git a/backend/src/Squidex.Infrastructure/Queries/OData/FilterVisitor.cs b/backend/src/Squidex.Infrastructure/Queries/OData/FilterVisitor.cs index b98515750..9d366ce54 100644 --- a/backend/src/Squidex.Infrastructure/Queries/OData/FilterVisitor.cs +++ b/backend/src/Squidex.Infrastructure/Queries/OData/FilterVisitor.cs @@ -55,7 +55,7 @@ namespace Squidex.Infrastructure.Queries.OData return ClrFilter.Empty(PropertyPathVisitor.Visit(fieldNode)); } - var valueNode = nodeIn.Parameters.ElementAtOrDefault(1); + var valueNode = nodeIn.Parameters.ElementAt(1); if (string.Equals(nodeIn.Name, "endswith", StringComparison.OrdinalIgnoreCase)) { diff --git a/backend/src/Squidex.Infrastructure/RefToken.cs b/backend/src/Squidex.Infrastructure/RefToken.cs index e8fd9ca91..c54b5e2ad 100644 --- a/backend/src/Squidex.Infrastructure/RefToken.cs +++ b/backend/src/Squidex.Infrastructure/RefToken.cs @@ -10,20 +10,17 @@ using System.Diagnostics.CodeAnalysis; namespace Squidex.Infrastructure { - [Equals(DoNotAddEqualityOperators = true)] - public sealed class RefToken + public sealed record RefToken { public string Type { get; } public string Identifier { get; } - [IgnoreDuringEquals] public bool IsClient { get { return string.Equals(Type, RefTokenType.Client, StringComparison.OrdinalIgnoreCase); } } - [IgnoreDuringEquals] public bool IsSubject { get { return string.Equals(Type, RefTokenType.Subject, StringComparison.OrdinalIgnoreCase); } @@ -57,7 +54,7 @@ namespace Squidex.Infrastructure if (idx > 0 && idx < value.Length - 1) { - result = new RefToken(value.Substring(0, idx), value.Substring(idx + 1)); + result = new RefToken(value.Substring(0, idx), value[(idx + 1)..]); return true; } diff --git a/backend/src/Squidex.Infrastructure/Reflection/Equality/DeepEqualityComparer.cs b/backend/src/Squidex.Infrastructure/Reflection/Equality/DeepEqualityComparer.cs index 4a7ceda20..f5a6fe230 100644 --- a/backend/src/Squidex.Infrastructure/Reflection/Equality/DeepEqualityComparer.cs +++ b/backend/src/Squidex.Infrastructure/Reflection/Equality/DeepEqualityComparer.cs @@ -6,7 +6,6 @@ // ========================================================================== using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; namespace Squidex.Infrastructure.Reflection.Equality { @@ -20,7 +19,7 @@ namespace Squidex.Infrastructure.Reflection.Equality this.comparer = comparer ?? SimpleEquals.Build(typeof(T)); } - public bool Equals([AllowNull] T x, [AllowNull] T y) + public bool Equals(T? x, T? y) { return comparer.IsEquals(x, y); } diff --git a/backend/src/Squidex.Infrastructure/Security/Permission.Part.cs b/backend/src/Squidex.Infrastructure/Security/Permission.Part.cs index d05e4ce0d..5dcb2341e 100644 --- a/backend/src/Squidex.Infrastructure/Security/Permission.Part.cs +++ b/backend/src/Squidex.Infrastructure/Security/Permission.Part.cs @@ -53,7 +53,7 @@ namespace Squidex.Infrastructure.Security { result[j] = Parse(current.Slice(0, i)); - current = current.Slice(i + 1); + current = current[(i + 1)..]; currentSpan = current.Span; i = 0; @@ -84,7 +84,7 @@ namespace Squidex.Infrastructure.Security { isExclusion = true; - current = current.Slice(1); + current = current[1..]; currentSpan = current.Span; } @@ -109,7 +109,7 @@ namespace Squidex.Infrastructure.Security { alternatives[j] = current.Slice(0, i); - current = current.Slice(i + 1); + current = current[(i + 1)..]; currentSpan = current.Span; i = 0; diff --git a/backend/src/Squidex.Infrastructure/Security/Permission.cs b/backend/src/Squidex.Infrastructure/Security/Permission.cs index 5355a3891..1261b7273 100644 --- a/backend/src/Squidex.Infrastructure/Security/Permission.cs +++ b/backend/src/Squidex.Infrastructure/Security/Permission.cs @@ -6,35 +6,28 @@ // ========================================================================== using System; -using System.Diagnostics.CodeAnalysis; namespace Squidex.Infrastructure.Security { - [Equals(DoNotAddEqualityOperators = true)] - public sealed partial class Permission : IComparable + public sealed partial class Permission : IComparable, IEquatable { public const string Any = "*"; public const string Exclude = "^"; - private readonly string id; private Part[] path; - public string Id - { - get { return id; } - } + public string Id { get; } - [IgnoreDuringEquals] private Part[] Path { - get { return path ??= Part.ParsePath(id); } + get { return path ??= Part.ParsePath(Id); } } public Permission(string id) { Guard.NotNullOrEmpty(id, nameof(id)); - this.id = id; + Id = id; } public bool Allows(Permission permission) @@ -90,7 +83,7 @@ namespace Squidex.Infrastructure.Security public bool StartsWith(string test) { - return id.StartsWith(test, StringComparison.OrdinalIgnoreCase); + return Id.StartsWith(test, StringComparison.OrdinalIgnoreCase); } public override bool Equals(object? obj) @@ -100,22 +93,22 @@ namespace Squidex.Infrastructure.Security public bool Equals(Permission? other) { - return other != null && string.Equals(id, other.id, StringComparison.OrdinalIgnoreCase); + return other != null && other.Id.Equals(Id); } public override int GetHashCode() { - return id.GetHashCode(); + return Id.GetHashCode(); } public override string ToString() { - return id; + return Id; } - public int CompareTo([AllowNull] Permission other) + public int CompareTo(Permission? other) { - return other == null ? -1 : string.Compare(id, other.id, StringComparison.Ordinal); + return other == null ? -1 : string.Compare(Id, other.Id, StringComparison.Ordinal); } } } diff --git a/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj b/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj index 30b3226b4..ca01d21f9 100644 --- a/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj +++ b/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable @@ -14,15 +14,10 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + all runtime; build; native; contentfiles; analyzers @@ -30,22 +25,21 @@ - + - + - - + + - + - - - + + ..\..\Squidex.ruleset diff --git a/backend/src/Squidex.Infrastructure/States/Store.cs b/backend/src/Squidex.Infrastructure/States/Store.cs index f4b4335c0..b9b88e11d 100644 --- a/backend/src/Squidex.Infrastructure/States/Store.cs +++ b/backend/src/Squidex.Infrastructure/States/Store.cs @@ -67,7 +67,7 @@ namespace Squidex.Infrastructure.States public ISnapshotStore GetSnapshotStore() { - return (ISnapshotStore)services.GetService(typeof(ISnapshotStore)); + return (ISnapshotStore)services.GetService(typeof(ISnapshotStore))!; } } } diff --git a/backend/src/Squidex.Infrastructure/Tasks/PartitionedActionBlock.cs b/backend/src/Squidex.Infrastructure/Tasks/PartitionedActionBlock.cs index 18c26c6fc..c7ed09805 100644 --- a/backend/src/Squidex.Infrastructure/Tasks/PartitionedActionBlock.cs +++ b/backend/src/Squidex.Infrastructure/Tasks/PartitionedActionBlock.cs @@ -80,7 +80,7 @@ namespace Squidex.Infrastructure.Tasks }); } - public DataflowMessageStatus OfferMessage(DataflowMessageHeader messageHeader, TInput messageValue, ISourceBlock source, bool consumeToAccept) + public DataflowMessageStatus OfferMessage(DataflowMessageHeader messageHeader, TInput messageValue, ISourceBlock? source, bool consumeToAccept) { return distributor.OfferMessage(messageHeader, messageValue, source, consumeToAccept); } diff --git a/backend/src/Squidex.Infrastructure/Translations/DeepLTranslator.cs b/backend/src/Squidex.Infrastructure/Translations/DeepLTranslator.cs index 984d1c234..29023355c 100644 --- a/backend/src/Squidex.Infrastructure/Translations/DeepLTranslator.cs +++ b/backend/src/Squidex.Infrastructure/Translations/DeepLTranslator.cs @@ -14,8 +14,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.Options; using Squidex.Infrastructure.Json; -#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. - namespace Squidex.Infrastructure.Translations { [ExcludeFromCodeCoverage] @@ -70,11 +68,11 @@ namespace Squidex.Infrastructure.Translations parameters["source_lang"] = GetLanguageCode(sourceLanguage); } - var body = new FormUrlEncodedContent(parameters); + var body = new FormUrlEncodedContent(parameters!); using (var response = await httpClient.PostAsync(Url, body, ct)) { - var responseString = await response.Content.ReadAsStringAsync(); + var responseString = await response.Content.ReadAsStringAsync(ct); if (response.IsSuccessStatusCode) { diff --git a/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs b/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs index cf54cb817..102d3177f 100644 --- a/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs +++ b/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs @@ -58,7 +58,7 @@ namespace Squidex.Infrastructure.Translations indexOfStart++; - var indexOfEnd = span.Slice(indexOfStart).IndexOf('}'); + var indexOfEnd = span[indexOfStart..].IndexOf('}'); if (indexOfEnd < 0) { @@ -119,13 +119,13 @@ namespace Squidex.Infrastructure.Translations { sb.Append(char.ToLower(variableValue[0])); - sb.Append(variableValue.AsSpan().Slice(1)); + sb.Append(variableValue.AsSpan()[1..]); } else if (shouldUpper && !char.IsUpper(variableValue[0])) { sb.Append(char.ToUpper(variableValue[0])); - sb.Append(variableValue.AsSpan().Slice(1)); + sb.Append(variableValue.AsSpan()[1..]); } else { @@ -133,7 +133,7 @@ namespace Squidex.Infrastructure.Translations } } - span = span.Slice(indexOfEnd + 1); + span = span[(indexOfEnd + 1)..]; } sb.Append(span); diff --git a/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs b/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs index 53d8683bc..785547e72 100644 --- a/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs +++ b/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs @@ -14,8 +14,6 @@ using System.Threading.Tasks; using Squidex.Infrastructure.Timers; using Squidex.Log; -#pragma warning disable SA1401 // Fields must be private - namespace Squidex.Infrastructure.UsageTracking { public sealed class BackgroundUsageTracker : DisposableObjectBase, IUsageTracker @@ -60,7 +58,7 @@ namespace Squidex.Infrastructure.UsageTracking { var localUsages = Interlocked.Exchange(ref jobs, new ConcurrentDictionary<(string Key, string Category, DateTime Date), Counters>()); - if (localUsages.Count > 0) + if (!localUsages.IsEmpty) { var updates = new UsageUpdate[localUsages.Count]; var updateIndex = 0; diff --git a/backend/src/Squidex.Infrastructure/Validation/AbsoluteUrlAttribute.cs b/backend/src/Squidex.Infrastructure/Validation/AbsoluteUrlAttribute.cs index 24089e5d7..07c70f850 100644 --- a/backend/src/Squidex.Infrastructure/Validation/AbsoluteUrlAttribute.cs +++ b/backend/src/Squidex.Infrastructure/Validation/AbsoluteUrlAttribute.cs @@ -21,9 +21,9 @@ namespace Squidex.Infrastructure.Validation return T.Get("annotations_AbsoluteUrl", new { property }); } - public override bool IsValid(object value) + public override bool IsValid(object? value) { - return !(value is Uri uri) || uri.IsAbsoluteUri; + return value is not Uri uri || uri.IsAbsoluteUri; } } } diff --git a/backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs b/backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs index fb224e3ab..5c6e37e0b 100644 --- a/backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs +++ b/backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs @@ -15,9 +15,9 @@ namespace Squidex.Infrastructure.Validation [AttributeUsage(AttributeTargets.Property)] public class LocalizedEmailAddressAttribute : ValidationAttribute { - public override bool IsValid(object value) + public override bool IsValid(object? value) { - return !(value is string s) || s.IsEmail(); + return value is not string s || s.IsEmail(); } public override string FormatErrorMessage(string name) diff --git a/backend/src/Squidex.Infrastructure/Validation/ValidationException.cs b/backend/src/Squidex.Infrastructure/Validation/ValidationException.cs index c97024271..ae1401d45 100644 --- a/backend/src/Squidex.Infrastructure/Validation/ValidationException.cs +++ b/backend/src/Squidex.Infrastructure/Validation/ValidationException.cs @@ -62,12 +62,12 @@ namespace Squidex.Infrastructure.Validation if (!error.EndsWith(".", StringComparison.OrdinalIgnoreCase)) { - sb.Append("."); + sb.Append('.'); } if (i < errors.Count - 1) { - sb.Append(" "); + sb.Append(' '); } } } diff --git a/backend/src/Squidex.Infrastructure/Validation/ValidationExtensions.cs b/backend/src/Squidex.Infrastructure/Validation/ValidationExtensions.cs index d22f7336b..8056065a5 100644 --- a/backend/src/Squidex.Infrastructure/Validation/ValidationExtensions.cs +++ b/backend/src/Squidex.Infrastructure/Validation/ValidationExtensions.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.Text.RegularExpressions; #pragma warning disable RECS0026 // Possible unassigned object created by 'new' +#pragma warning disable CA1806 // Do not ignore method results namespace Squidex.Infrastructure.Validation { diff --git a/backend/src/Squidex.Shared/Squidex.Shared.csproj b/backend/src/Squidex.Shared/Squidex.Shared.csproj index f0bec00de..e33595843 100644 --- a/backend/src/Squidex.Shared/Squidex.Shared.csproj +++ b/backend/src/Squidex.Shared/Squidex.Shared.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable diff --git a/backend/src/Squidex.Shared/Users/UserExtensions.cs b/backend/src/Squidex.Shared/Users/UserExtensions.cs index 9d458a8cb..89f9e7dbe 100644 --- a/backend/src/Squidex.Shared/Users/UserExtensions.cs +++ b/backend/src/Squidex.Shared/Users/UserExtensions.cs @@ -84,7 +84,7 @@ namespace Squidex.Shared.Users public static List<(string Name, string Value)> GetCustomProperties(this IUser user) { return user.Claims.Where(x => x.Type.StartsWith(SquidexClaimTypes.CustomPrefix, StringComparison.OrdinalIgnoreCase)) - .Select(x => (x.Type.Substring(SquidexClaimTypes.CustomPrefix.Length + 1), x.Value)).ToList(); + .Select(x => (x.Type[(SquidexClaimTypes.CustomPrefix.Length + 1)..], x.Value)).ToList(); } public static bool HasClaim(this IUser user, string type) diff --git a/backend/src/Squidex.Web/ApiController.cs b/backend/src/Squidex.Web/ApiController.cs index dee44fbe6..29e37a8fe 100644 --- a/backend/src/Squidex.Web/ApiController.cs +++ b/backend/src/Squidex.Web/ApiController.cs @@ -68,7 +68,7 @@ namespace Squidex.Web { var request = context.HttpContext.Request; - if (!request.PathBase.HasValue || !request.PathBase.Value.EndsWith("/api", StringComparison.OrdinalIgnoreCase)) + if (!request.PathBase.HasValue || request.PathBase.Value?.EndsWith("/api", StringComparison.OrdinalIgnoreCase) != true) { context.Result = new RedirectResult("/"); } diff --git a/backend/src/Squidex.Web/ApiExceptionConverter.cs b/backend/src/Squidex.Web/ApiExceptionConverter.cs index 24f3a103d..2b2f4065a 100644 --- a/backend/src/Squidex.Web/ApiExceptionConverter.cs +++ b/backend/src/Squidex.Web/ApiExceptionConverter.cs @@ -16,8 +16,6 @@ using Microsoft.AspNetCore.Mvc; using Squidex.Infrastructure; using Squidex.Infrastructure.Translations; using Squidex.Infrastructure.Validation; -using BadHttpRequestExceptionIIS = Microsoft.AspNetCore.Server.IIS.BadHttpRequestException; -using BadHttpRequestExceptionKestrel = Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException; namespace Squidex.Web { @@ -108,10 +106,7 @@ namespace Squidex.Web case DecoderFallbackException _: return (CreateError(400, exception.Message), true); - case BadHttpRequestExceptionIIS ex: - return (CreateError(ex.StatusCode, ex.Message), true); - - case BadHttpRequestExceptionKestrel ex: + case BadHttpRequestException ex: return (CreateError(ex.StatusCode, ex.Message), true); default: diff --git a/backend/src/Squidex.Web/ApiExceptionFilterAttribute.cs b/backend/src/Squidex.Web/ApiExceptionFilterAttribute.cs index 892ac986c..28a71eb2e 100644 --- a/backend/src/Squidex.Web/ApiExceptionFilterAttribute.cs +++ b/backend/src/Squidex.Web/ApiExceptionFilterAttribute.cs @@ -33,7 +33,7 @@ namespace Squidex.Web if (!wellKnown) { - var log = context.HttpContext.RequestServices.GetService(); + var log = context.HttpContext.RequestServices.GetRequiredService(); log.LogError(context.Exception, w => w .WriteProperty("message", "An unexpected exception has occurred.")); diff --git a/backend/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs b/backend/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs index 6227c7ce4..17bef171c 100644 --- a/backend/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs +++ b/backend/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs @@ -77,7 +77,7 @@ namespace Squidex.Web.CommandMiddlewares { if (etag.StartsWith("W/", StringComparison.OrdinalIgnoreCase)) { - etag = etag.Substring(2); + etag = etag[2..]; } if (long.TryParse(etag, NumberStyles.Any, CultureInfo.InvariantCulture, out version)) diff --git a/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithSchemaIdCommandMiddleware.cs b/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithSchemaIdCommandMiddleware.cs index 503d21cf8..3c8195745 100644 --- a/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithSchemaIdCommandMiddleware.cs +++ b/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithSchemaIdCommandMiddleware.cs @@ -44,7 +44,7 @@ namespace Squidex.Web.CommandMiddlewares private NamedId GetSchemaId() { - var feature = httpContextAccessor.HttpContext.Features.Get(); + var feature = httpContextAccessor.HttpContext?.Features.Get(); if (feature == null) { diff --git a/backend/src/Squidex.Web/Json/TypedJsonInheritanceConverter.cs b/backend/src/Squidex.Web/Json/TypedJsonInheritanceConverter.cs index cd89067ea..11262e7bb 100644 --- a/backend/src/Squidex.Web/Json/TypedJsonInheritanceConverter.cs +++ b/backend/src/Squidex.Web/Json/TypedJsonInheritanceConverter.cs @@ -53,7 +53,7 @@ namespace Squidex.Web.Json if (method != null && method.IsStatic) { - var types = (IEnumerable)method.Invoke(null, new object[0])!; + var types = (IEnumerable)method.Invoke(null, Array.Empty())!; foreach (var type in types) { diff --git a/backend/src/Squidex.Web/Pipeline/AppResolver.cs b/backend/src/Squidex.Web/Pipeline/AppResolver.cs index d88061e0f..16f61412b 100644 --- a/backend/src/Squidex.Web/Pipeline/AppResolver.cs +++ b/backend/src/Squidex.Web/Pipeline/AppResolver.cs @@ -82,7 +82,7 @@ namespace Squidex.Web.Pipeline if (!AllowAnonymous(context) && !HasPermission(appName, requestContext)) { - if (string.IsNullOrWhiteSpace(user.Identity.AuthenticationType)) + if (string.IsNullOrWhiteSpace(user.Identity?.AuthenticationType)) { context.Result = new UnauthorizedResult(); } diff --git a/backend/src/Squidex.Web/Pipeline/CachingManager.cs b/backend/src/Squidex.Web/Pipeline/CachingManager.cs index eb289eb0d..a89fe7b22 100644 --- a/backend/src/Squidex.Web/Pipeline/CachingManager.cs +++ b/backend/src/Squidex.Web/Pipeline/CachingManager.cs @@ -231,7 +231,7 @@ namespace Squidex.Web.Pipeline { Guard.NotNull(httpContext, nameof(httpContext)); - var cacheContext = httpContextAccessor.HttpContext.Features.Get(); + var cacheContext = httpContextAccessor.HttpContext?.Features.Get(); cacheContext?.Finish(httpContext.Response, stringBuilderPool); } diff --git a/backend/src/Squidex.Web/Pipeline/FileCallbackResultExecutor.cs b/backend/src/Squidex.Web/Pipeline/FileCallbackResultExecutor.cs index 437637d7b..dd58e2d2e 100644 --- a/backend/src/Squidex.Web/Pipeline/FileCallbackResultExecutor.cs +++ b/backend/src/Squidex.Web/Pipeline/FileCallbackResultExecutor.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; using Squidex.Assets; -using Squidex.Infrastructure; namespace Squidex.Web.Pipeline { diff --git a/backend/src/Squidex.Web/Pipeline/UsageStream.cs b/backend/src/Squidex.Web/Pipeline/UsageStream.cs index 2e878945a..d63b5fe93 100644 --- a/backend/src/Squidex.Web/Pipeline/UsageStream.cs +++ b/backend/src/Squidex.Web/Pipeline/UsageStream.cs @@ -10,6 +10,8 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +#pragma warning disable CA1835 // Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync' + namespace Squidex.Web.Pipeline { internal sealed class UsageStream : Stream @@ -53,7 +55,7 @@ namespace Squidex.Web.Pipeline this.inner = inner; } - public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object? state) + public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state) { var result = inner.BeginWrite(buffer, offset, count, callback, state); diff --git a/backend/src/Squidex.Web/Squidex.Web.csproj b/backend/src/Squidex.Web/Squidex.Web.csproj index 6dadcc10d..e913c3f2e 100644 --- a/backend/src/Squidex.Web/Squidex.Web.csproj +++ b/backend/src/Squidex.Web/Squidex.Web.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/src/Squidex/Areas/Api/Config/OpenApi/ScopesProcessor.cs b/backend/src/Squidex/Areas/Api/Config/OpenApi/ScopesProcessor.cs index 5b78839f6..27d304af5 100644 --- a/backend/src/Squidex/Areas/Api/Config/OpenApi/ScopesProcessor.cs +++ b/backend/src/Squidex/Areas/Api/Config/OpenApi/ScopesProcessor.cs @@ -40,7 +40,7 @@ namespace Squidex.Areas.Api.Config.OpenApi if (authorizeAttributes.Any()) { - var scopes = authorizeAttributes.Where(a => a.Roles != null).SelectMany(a => a.Roles.Split(',')).Distinct().ToList(); + var scopes = authorizeAttributes.Where(a => a.Roles != null).SelectMany(a => a.Roles!.Split(',')).Distinct().ToList(); context.OperationDescription.Operation.Security.Add(new OpenApiSecurityRequirement { diff --git a/backend/src/Squidex/Areas/Api/Controllers/Apps/AppsController.cs b/backend/src/Squidex/Areas/Api/Controllers/Apps/AppsController.cs index d4015e872..2b04ceb89 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Apps/AppsController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Apps/AppsController.cs @@ -26,6 +26,8 @@ using Squidex.Log; using Squidex.Shared; using Squidex.Web; +#pragma warning disable CA2016 // Forward the 'CancellationToken' parameter to methods that take one + namespace Squidex.Areas.Api.Controllers.Apps { /// diff --git a/backend/src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs b/backend/src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs index 0da340ac7..184aa5f85 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs @@ -22,7 +22,7 @@ using Squidex.Infrastructure.Commands; using Squidex.Log; using Squidex.Web; -#pragma warning disable 1573 +#pragma warning disable CA2016 // Forward the 'CancellationToken' parameter to methods that take one namespace Squidex.Areas.Api.Controllers.Assets { @@ -103,7 +103,7 @@ namespace Squidex.Areas.Api.Controllers.Assets [ApiPermission] [ApiCosts(0.5)] [AllowAnonymous] - [Obsolete] + [Obsolete("Use overload with app name")] public async Task GetAssetContent(DomainId id, [FromQuery] AssetContentQueryDto queries) { var asset = await assetRepository.FindAssetAsync(id); diff --git a/backend/src/Squidex/Areas/Api/Controllers/Assets/Models/AssetDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Assets/Models/AssetDto.cs index e48b1d81e..d53172f07 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Assets/Models/AssetDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Assets/Models/AssetDto.cs @@ -133,7 +133,7 @@ namespace Squidex.Areas.Api.Controllers.Assets.Models /// /// Determines of the created file is an image. /// - [Obsolete] + [Obsolete("Use Type instead")] public bool IsImage { get { return Type == AssetType.Image; } @@ -142,7 +142,7 @@ namespace Squidex.Areas.Api.Controllers.Assets.Models /// /// The width of the image in pixels if the asset is an image. /// - [Obsolete] + [Obsolete("Use Metdata instead")] public int? PixelWidth { get { return Metadata.GetPixelWidth(); } @@ -151,7 +151,7 @@ namespace Squidex.Areas.Api.Controllers.Assets.Models /// /// The height of the image in pixels if the asset is an image. /// - [Obsolete] + [Obsolete("Use Metdata instead")] public int? PixelHeight { get { return Metadata.GetPixelHeight(); } diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemaOpenApiGenerator.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemaOpenApiGenerator.cs index d9533f1de..6b143676f 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemaOpenApiGenerator.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemaOpenApiGenerator.cs @@ -23,7 +23,6 @@ namespace Squidex.Areas.Api.Controllers.Contents.Generator { public sealed class SchemaOpenApiGenerator { - private readonly ContentSchemaBuilder schemaBuilder = new ContentSchemaBuilder(); private readonly OpenApiDocument document; private readonly JsonSchema contentSchema; private readonly JsonSchema dataSchema; @@ -56,7 +55,7 @@ namespace Squidex.Areas.Api.Controllers.Contents.Generator dataSchema = schemaResolver($"{schemaType}Dto", schema.BuildJsonSchema(partitionResolver, schemaResolver)); - contentSchema = schemaResolver($"{schemaType}ContentDto", schemaBuilder.CreateContentSchema(schema, dataSchema)); + contentSchema = schemaResolver($"{schemaType}ContentDto", ContentSchemaBuilder.CreateContentSchema(schema, dataSchema)); } public void GenerateSchemaOperations() diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs index 25b027ffa..86418bfc2 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs @@ -100,7 +100,7 @@ namespace Squidex.Areas.Api.Controllers.Contents.Generator private JsonSchema AppendSchema(string name, JsonSchema schema) { - name = char.ToUpperInvariant(name[0]) + name.Substring(1); + name = char.ToUpperInvariant(name[0]) + name[1..]; return new JsonSchema { Reference = document.Definitions.GetOrAdd(name, schema, (k, c) => c) }; } diff --git a/backend/src/Squidex/Areas/Api/Controllers/Statistics/Models/CallsUsageDtoDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Statistics/Models/CallsUsageDtoDto.cs index 851d0f944..d1d79435c 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Statistics/Models/CallsUsageDtoDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Statistics/Models/CallsUsageDtoDto.cs @@ -11,8 +11,6 @@ using Squidex.Domain.Apps.Entities.Apps.Plans; using Squidex.Infrastructure.UsageTracking; using Squidex.Infrastructure.Validation; -#pragma warning disable CS0618 // Type or member is obsolete - namespace Squidex.Areas.Api.Controllers.Statistics.Models { public sealed class CallsUsageDtoDto diff --git a/backend/src/Squidex/Areas/Api/Controllers/Users/UsersController.cs b/backend/src/Squidex/Areas/Api/Controllers/Users/UsersController.cs index 9f4f036c0..98e6fe384 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Users/UsersController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Users/UsersController.cs @@ -108,7 +108,7 @@ namespace Squidex.Areas.Api.Controllers.Users .WriteProperty("status", "Failed")); } - return Ok(new UserDto[0]); + return Ok(Array.Empty()); } /// @@ -193,7 +193,7 @@ namespace Squidex.Areas.Api.Controllers.Users if (response.IsSuccessStatusCode) { - var contentType = response.Content.Headers.ContentType.ToString(); + var contentType = response.Content.Headers.ContentType?.ToString(); var etag = response.Headers.ETag; diff --git a/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs b/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs index c4ae98280..bc47afaf5 100644 --- a/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs +++ b/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs @@ -26,12 +26,12 @@ namespace Squidex.Areas.Frontend.Middlewares public static bool IsIndex(this HttpContext context) { - return context.Request.Path.Value.EndsWith("/index.html", StringComparison.OrdinalIgnoreCase); + return context.Request.Path.Value?.EndsWith("/index.html", StringComparison.OrdinalIgnoreCase) == true; } public static bool IsHtmlPath(this HttpContext context) { - return context.Request.Path.Value.EndsWith(".html", StringComparison.OrdinalIgnoreCase); + return context.Request.Path.Value?.EndsWith(".html", StringComparison.OrdinalIgnoreCase) == true; } public static bool IsNotModified(this HttpResponse response) @@ -62,7 +62,7 @@ namespace Squidex.Areas.Frontend.Middlewares uiOptions.More["info"] = values.ToString(); } - var notifo = httpContext.RequestServices.GetService>(); + var notifo = httpContext.RequestServices!.GetRequiredService>(); if (notifo.Value.IsConfigured()) { diff --git a/backend/src/Squidex/Areas/IdentityServer/Controllers/Account/AccountController.cs b/backend/src/Squidex/Areas/IdentityServer/Controllers/Account/AccountController.cs index 94e87703c..696a9b252 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Controllers/Account/AccountController.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Controllers/Account/AccountController.cs @@ -31,6 +31,8 @@ using Squidex.Shared.Identity; using Squidex.Shared.Users; using Squidex.Web; +#pragma warning disable CA1827 // Do not use Count() or LongCount() when Any() can be used + namespace Squidex.Areas.IdentityServer.Controllers.Account { public sealed class AccountController : IdentityServerController @@ -153,7 +155,7 @@ namespace Squidex.Areas.IdentityServer.Controllers.Account { await signInManager.SignOutAsync(); - if (User?.Identity.IsAuthenticated == true) + if (User.Identity?.IsAuthenticated == true) { var provider = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; @@ -291,7 +293,7 @@ namespace Squidex.Areas.IdentityServer.Controllers.Account } else { - var email = externalLogin.Principal.FindFirst(ClaimTypes.Email).Value; + var email = externalLogin.Principal.FindFirst(ClaimTypes.Email)?.Value!; user = await userManager.FindByEmailWithClaimsAsync(email); diff --git a/backend/src/Squidex/Areas/IdentityServer/Controllers/Extensions.cs b/backend/src/Squidex/Areas/IdentityServer/Controllers/Extensions.cs index a9a748bd6..42c250066 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Controllers/Extensions.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Controllers/Extensions.cs @@ -41,7 +41,7 @@ namespace Squidex.Areas.IdentityServer.Controllers var externalProviders = externalSchemes .Where(x => x.Name != OpenIdConnectDefaults.AuthenticationScheme) .Where(x => x.Name != Constants.ApiSecurityScheme) - .Select(x => new ExternalProvider(x.Name, x.DisplayName)) + .Select(x => new ExternalProvider(x.Name, x.DisplayName ?? x.Name)) .ToList(); return externalProviders; diff --git a/backend/src/Squidex/Areas/IdentityServer/Controllers/IdentityServerController.cs b/backend/src/Squidex/Areas/IdentityServer/Controllers/IdentityServerController.cs index efafc7dc7..5f98eaaeb 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Controllers/IdentityServerController.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Controllers/IdentityServerController.cs @@ -18,7 +18,7 @@ namespace Squidex.Areas.IdentityServer.Controllers { var request = context.HttpContext.Request; - if (!request.PathBase.HasValue || !request.PathBase.Value.EndsWith("/identity-server", StringComparison.OrdinalIgnoreCase)) + if (!request.PathBase.HasValue || request.PathBase.Value?.EndsWith("/identity-server", StringComparison.OrdinalIgnoreCase) != true) { context.Result = new NotFoundResult(); } diff --git a/backend/src/Squidex/Areas/IdentityServer/Views/Extensions.cs b/backend/src/Squidex/Areas/IdentityServer/Views/Extensions.cs index eb16259f5..0ca60ff02 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Views/Extensions.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Views/Extensions.cs @@ -21,11 +21,11 @@ namespace Squidex.Areas.IdentityServer.Views if (contentPath[0] == '~') { - var segment = new PathString(contentPath.Substring(1)); + var segment = new PathString(contentPath[1..]); var applicationPath = urlHelper.ActionContext.HttpContext.Request.PathBase; - if (applicationPath.HasValue) + if (applicationPath.Value != null) { var indexOfLastPart = applicationPath.Value.LastIndexOf('/'); diff --git a/backend/src/Squidex/Areas/OrleansDashboard/Middlewares/OrleansDashboardAuthenticationMiddleware.cs b/backend/src/Squidex/Areas/OrleansDashboard/Middlewares/OrleansDashboardAuthenticationMiddleware.cs index ce9ae44a4..78b6f269d 100644 --- a/backend/src/Squidex/Areas/OrleansDashboard/Middlewares/OrleansDashboardAuthenticationMiddleware.cs +++ b/backend/src/Squidex/Areas/OrleansDashboard/Middlewares/OrleansDashboardAuthenticationMiddleware.cs @@ -33,7 +33,7 @@ namespace Squidex.Areas.OrleansDashboard.Middlewares if (authentication.Succeeded) { - if (authentication.Principal.Permissions().Allows(OrleansPermissions)) + if (authentication.Principal?.Permissions().Allows(OrleansPermissions) == true) { await next(context); } diff --git a/backend/src/Squidex/Areas/Portal/Middlewares/PortalDashboardAuthenticationMiddleware.cs b/backend/src/Squidex/Areas/Portal/Middlewares/PortalDashboardAuthenticationMiddleware.cs index 0f8d8bbfd..b157b73c7 100644 --- a/backend/src/Squidex/Areas/Portal/Middlewares/PortalDashboardAuthenticationMiddleware.cs +++ b/backend/src/Squidex/Areas/Portal/Middlewares/PortalDashboardAuthenticationMiddleware.cs @@ -37,7 +37,7 @@ namespace Squidex.Areas.Portal.Middlewares } else { - context.User = authentication.Principal; + context.User = authentication.Principal!; await next(context); } diff --git a/backend/src/Squidex/Config/Authentication/OidcHandler.cs b/backend/src/Squidex/Config/Authentication/OidcHandler.cs index c88a56e24..fcde1287f 100644 --- a/backend/src/Squidex/Config/Authentication/OidcHandler.cs +++ b/backend/src/Squidex/Config/Authentication/OidcHandler.cs @@ -23,7 +23,7 @@ namespace Squidex.Config.Authentication public override Task TokenValidated(TokenValidatedContext context) { - var identity = (ClaimsIdentity)context.Principal.Identity; + var identity = (ClaimsIdentity)context.Principal!.Identity!; if (!string.IsNullOrWhiteSpace(options.OidcRoleClaimType) && options.OidcRoleMapping?.Count >= 0) { diff --git a/backend/src/Squidex/Config/Domain/AssetServices.cs b/backend/src/Squidex/Config/Domain/AssetServices.cs index 17d01025d..af9edcdae 100644 --- a/backend/src/Squidex/Config/Domain/AssetServices.cs +++ b/backend/src/Squidex/Config/Domain/AssetServices.cs @@ -20,7 +20,6 @@ using Squidex.Domain.Apps.Entities.History; using Squidex.Domain.Apps.Entities.Search; using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; -using Squidex.Log; namespace Squidex.Config.Domain { diff --git a/backend/src/Squidex/Config/Domain/EventSourcingServices.cs b/backend/src/Squidex/Config/Domain/EventSourcingServices.cs index 6e60a860e..8316ed9e9 100644 --- a/backend/src/Squidex/Config/Domain/EventSourcingServices.cs +++ b/backend/src/Squidex/Config/Domain/EventSourcingServices.cs @@ -99,7 +99,7 @@ namespace Squidex.Config.Domain { var allEventConsumers = c.GetServices(); - return new EventConsumerFactory(n => allEventConsumers.FirstOrDefault(x => x.Name == n)); + return new EventConsumerFactory(n => allEventConsumers.First(x => x.Name == n)); }); } } diff --git a/backend/src/Squidex/Config/Domain/InfrastructureServices.cs b/backend/src/Squidex/Config/Domain/InfrastructureServices.cs index 17cab2d16..948012389 100644 --- a/backend/src/Squidex/Config/Domain/InfrastructureServices.cs +++ b/backend/src/Squidex/Config/Domain/InfrastructureServices.cs @@ -34,8 +34,6 @@ using Squidex.Pipeline.Robots; using Squidex.Web; using Squidex.Web.Pipeline; -#pragma warning disable RECS0092 // Convert field to readonly - namespace Squidex.Config.Domain { public static class InfrastructureServices diff --git a/backend/src/Squidex/Config/Domain/LoggingServices.cs b/backend/src/Squidex/Config/Domain/LoggingServices.cs index b81e35b76..666d00106 100644 --- a/backend/src/Squidex/Config/Domain/LoggingServices.cs +++ b/backend/src/Squidex/Config/Domain/LoggingServices.cs @@ -14,7 +14,6 @@ using Microsoft.Extensions.Logging; using Squidex.Domain.Apps.Entities.Apps; using Squidex.Infrastructure.Log; using Squidex.Log; -using Squidex.Log.Adapter; using Squidex.Web.Pipeline; namespace Squidex.Config.Domain diff --git a/backend/src/Squidex/Config/Domain/StoreServices.cs b/backend/src/Squidex/Config/Domain/StoreServices.cs index 6ad2be384..ac989f42f 100644 --- a/backend/src/Squidex/Config/Domain/StoreServices.cs +++ b/backend/src/Squidex/Config/Domain/StoreServices.cs @@ -35,7 +35,6 @@ using Squidex.Infrastructure.Log; using Squidex.Infrastructure.Migrations; using Squidex.Infrastructure.States; using Squidex.Infrastructure.UsageTracking; -using Squidex.Log; namespace Squidex.Config.Domain { diff --git a/backend/src/Squidex/Config/Orleans/OrleansServices.cs b/backend/src/Squidex/Config/Orleans/OrleansServices.cs index ee19b136d..7d308a636 100644 --- a/backend/src/Squidex/Config/Orleans/OrleansServices.cs +++ b/backend/src/Squidex/Config/Orleans/OrleansServices.cs @@ -20,8 +20,6 @@ using Squidex.Infrastructure; using Squidex.Infrastructure.Orleans; using Squidex.Web; -#pragma warning disable CS0618 // Type or member is obsolete - namespace Squidex.Config.Orleans { public static class OrleansServices diff --git a/backend/src/Squidex/Pipeline/Plugins/PluginExtensions.cs b/backend/src/Squidex/Pipeline/Plugins/PluginExtensions.cs index 78c7ffae1..34fb4be87 100644 --- a/backend/src/Squidex/Pipeline/Plugins/PluginExtensions.cs +++ b/backend/src/Squidex/Pipeline/Plugins/PluginExtensions.cs @@ -63,7 +63,7 @@ namespace Squidex.Pipeline.Plugins { var pluginManager = app.ApplicationServices.GetRequiredService(); - pluginManager.Log(app.ApplicationServices.GetService()); + pluginManager.Log(app.ApplicationServices.GetRequiredService()); } } } diff --git a/backend/src/Squidex/Pipeline/Squid/SquidMiddleware.cs b/backend/src/Squidex/Pipeline/Squid/SquidMiddleware.cs index 4b496d288..d129234cf 100644 --- a/backend/src/Squidex/Pipeline/Squid/SquidMiddleware.cs +++ b/backend/src/Squidex/Pipeline/Squid/SquidMiddleware.cs @@ -112,7 +112,7 @@ namespace Squidex.Pipeline.Squid if (line.Length > 0) { - line.Append(" "); + line.Append(' '); } line.Append(word); diff --git a/backend/src/Squidex/Squidex.csproj b/backend/src/Squidex/Squidex.csproj index 305a1217e..e44860193 100644 --- a/backend/src/Squidex/Squidex.csproj +++ b/backend/src/Squidex/Squidex.csproj @@ -1,9 +1,9 @@  - netcoreapp3.1 + net5.0 Latest true - 8.0 + 9.0 enable @@ -32,38 +32,38 @@ - - + + - - - - - + + + + + - + - + - - + + - + - + diff --git a/backend/src/Squidex/Startup.cs b/backend/src/Squidex/Startup.cs index 22f3d276e..e9f0210d7 100644 --- a/backend/src/Squidex/Startup.cs +++ b/backend/src/Squidex/Startup.cs @@ -21,8 +21,6 @@ using Squidex.Config.Web; using Squidex.Pipeline.Plugins; using Squidex.Web.Pipeline; -#pragma warning disable CS0618 // Type or member is obsolete - namespace Squidex { public sealed class Startup diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/AppClientsTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/AppClientsTests.cs index 021cb98cf..cc3ba649a 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/AppClientsTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/AppClientsTests.cs @@ -23,15 +23,15 @@ namespace Squidex.Domain.Apps.Core.Model.Apps { var clients_1 = clients_0.Add("2", "my-secret"); - clients_1["2"].Should().BeEquivalentTo(new AppClient("2", "my-secret", Role.Editor)); + clients_1["2"].Should().BeEquivalentTo(new AppClient("2", "my-secret")); } [Fact] public void Should_assign_clients_with_permission() { - var clients_1 = clients_0.Add("2", new AppClient("my-name", "my-secret", Role.Reader)); + var clients_1 = clients_0.Add("2", "my-secret", Role.Reader); - clients_1["2"].Should().BeEquivalentTo(new AppClient("my-name", "my-secret", Role.Reader)); + clients_1["2"].Should().BeEquivalentTo(new AppClient("2", "my-secret") with { Role = Role.Reader }); } [Fact] @@ -42,20 +42,12 @@ namespace Squidex.Domain.Apps.Core.Model.Apps Assert.Throws(() => clients_1.Add("2", "my-secret")); } - [Fact] - public void Should_do_nothing_if_assigning_client_object_with_same_id() - { - var clients_1 = clients_0.Add("2", "my-secret"); - - clients_1.Add("2", new AppClient("my-name", "my-secret", "my-role")); - } - [Fact] public void Should_update_client_with_role() { var client_1 = clients_0.Update("1", role: Role.Reader); - client_1["1"].Should().BeEquivalentTo(new AppClient("1", "my-secret", Role.Reader)); + client_1["1"].Should().BeEquivalentTo(new AppClient("1", "my-secret") with { Role = Role.Reader }); } [Fact] @@ -63,7 +55,7 @@ namespace Squidex.Domain.Apps.Core.Model.Apps { var client_1 = clients_0.Update("1", name: "New-Name"); - client_1["1"].Should().BeEquivalentTo(new AppClient("New-Name", "my-secret", Role.Editor)); + client_1["1"].Should().BeEquivalentTo(new AppClient("New-Name", "my-secret")); } [Fact] @@ -71,7 +63,7 @@ namespace Squidex.Domain.Apps.Core.Model.Apps { var client_1 = clients_0.Update("1", allowAnonymous: true); - client_1["1"].Should().BeEquivalentTo(new AppClient("1", "my-secret", Role.Editor, 0, 0, true)); + client_1["1"].Should().BeEquivalentTo(new AppClient("1", "my-secret") with { AllowAnonymous = true }); } [Fact] @@ -79,7 +71,7 @@ namespace Squidex.Domain.Apps.Core.Model.Apps { var client_1 = clients_0.Update("1", apiCallsLimit: 1000); - client_1["1"].Should().BeEquivalentTo(new AppClient("1", "my-secret", Role.Editor, 1000, 0, false)); + client_1["1"].Should().BeEquivalentTo(new AppClient("1", "my-secret") with { ApiCallsLimit = 1000 }); } [Fact] @@ -87,7 +79,7 @@ namespace Squidex.Domain.Apps.Core.Model.Apps { var client_1 = clients_0.Update("1", apiTrafficLimit: 1000); - client_1["1"].Should().BeEquivalentTo(new AppClient("1", "my-secret", Role.Editor, 0, 1000, false)); + client_1["1"].Should().BeEquivalentTo(new AppClient("1", "my-secret") with { ApiTrafficLimit = 1000 }); } [Fact] diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/AppPatternsTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/AppPatternsTests.cs index 7beb8f999..1837562c2 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/AppPatternsTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/AppPatternsTests.cs @@ -31,23 +31,23 @@ namespace Squidex.Domain.Apps.Core.Model.Apps { var patterns_1 = patterns_0.Add(id, "NewPattern", "New Pattern", "Message"); - patterns_1[id].Should().BeEquivalentTo(new AppPattern("NewPattern", "New Pattern", "Message")); + patterns_1[id].Should().BeEquivalentTo(new AppPattern("NewPattern", "New Pattern") with { Message = "Message" }); } [Fact] public void Should_do_nothing_if_adding_pattern_with_same_id() { - var patterns_1 = patterns_0.Add(id, "NewPattern", "New Pattern", "Message"); + var patterns_1 = patterns_0.Add(firstId, "Default", "Default Pattern", "Message"); - patterns_1.Add(id, "NewPattern", "New Pattern", "Message"); + Assert.Same(patterns_1, patterns_0); } [Fact] public void Should_update_pattern() { - var patterns_1 = patterns_0.Update(firstId, "UpdatePattern", "Update Pattern", "Message"); + var patterns_1 = patterns_0.Update(firstId, "UpdatePattern", "Update Pattern"); - patterns_1[firstId].Should().BeEquivalentTo(new AppPattern("UpdatePattern", "Update Pattern", "Message")); + patterns_1[firstId].Should().BeEquivalentTo(new AppPattern("UpdatePattern", "Update Pattern")); } [Fact] diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/LanguagesConfigTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/LanguagesConfigTests.cs index 8c8007b2c..f7e26cd60 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/LanguagesConfigTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Apps/LanguagesConfigTests.cs @@ -12,6 +12,7 @@ using Squidex.Infrastructure; using Xunit; #pragma warning disable SA1310 // Field names must not contain underscore +#pragma warning disable CA1806 // Do not ignore method results namespace Squidex.Domain.Apps.Core.Model.Apps { diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/ContentDataTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/ContentDataTests.cs index d7b0295d5..ca6ce94c5 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/ContentDataTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/ContentDataTests.cs @@ -9,8 +9,6 @@ using Squidex.Domain.Apps.Core.Contents; using Squidex.Infrastructure.Json.Objects; using Xunit; -#pragma warning disable xUnit2013 // Do not use equality check to check for collection size. - namespace Squidex.Domain.Apps.Core.Model.Contents { public class ContentDataTests diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/WorkflowJsonTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/WorkflowJsonTests.cs index c3ce6e534..4b94ce916 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/WorkflowJsonTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/WorkflowJsonTests.cs @@ -77,7 +77,7 @@ namespace Squidex.Domain.Apps.Core.Model.Contents var result = serialized.ToTransition(); - Assert.Equal(source.Role, result?.Roles.Single()); + Assert.Equal(source.Role, result?.Roles?.Single()); } } } \ No newline at end of file diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/WorkflowTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/WorkflowTests.cs index 62b028a80..f6f926f3b 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/WorkflowTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/Contents/WorkflowTests.cs @@ -74,7 +74,7 @@ namespace Squidex.Domain.Apps.Core.Model.Contents Assert.True(found); Assert.Equal("ToArchivedExpr", transition?.Expression); - Assert.Equal("ToArchivedRole", transition?.Roles.Single()); + Assert.Equal("ToArchivedRole", transition?.Roles?.Single()); } [Fact] @@ -116,14 +116,14 @@ namespace Squidex.Domain.Apps.Core.Model.Contents Assert.Equal(Status.Archived, status1); Assert.Equal("ToArchivedExpr", transition1?.Expression); - Assert.Equal("ToArchivedRole", transition1?.Roles.Single()); + Assert.Equal("ToArchivedRole", transition1?.Roles?.Single()); Assert.Same(workflow.Steps[status1], step1); var (status2, step2, transition2) = transitions[1]; Assert.Equal(Status.Published, status2); Assert.Equal("ToPublishedExpr", transition2?.Expression); - Assert.Equal("ToPublishedRole", transition2?.Roles.Single()); + Assert.Equal("ToPublishedRole", transition2?.Roles?.Single()); Assert.Same(workflow.Steps[status2], step2); } diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/InvariantPartitionTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/InvariantPartitionTests.cs index e3dfc7068..451fb6ffb 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/InvariantPartitionTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Model/InvariantPartitionTests.cs @@ -8,8 +8,6 @@ using System.Linq; using Xunit; -#pragma warning disable xUnit2013 // Do not use equality check to check for collection size. - namespace Squidex.Domain.Apps.Core.Model { public class InvariantPartitionTests diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/DefaultValues/DefaultValuesTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/DefaultValues/DefaultValuesTests.cs index 14a394696..ec64e8e72 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/DefaultValues/DefaultValuesTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/DefaultValues/DefaultValuesTests.cs @@ -14,8 +14,6 @@ using Squidex.Infrastructure; using Squidex.Infrastructure.Json.Objects; using Xunit; -#pragma warning disable xUnit2004 // Do not use equality check to test for boolean conditions - namespace Squidex.Domain.Apps.Core.Operations.DefaultValues { public class DefaultValuesTests diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ExtractReferenceIds/ReferenceExtractionTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ExtractReferenceIds/ReferenceExtractionTests.cs index 447e1edc7..b1f874bcf 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ExtractReferenceIds/ReferenceExtractionTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ExtractReferenceIds/ReferenceExtractionTests.cs @@ -15,8 +15,6 @@ using Squidex.Infrastructure; using Squidex.Infrastructure.Json.Objects; using Xunit; -#pragma warning disable xUnit2013 // Do not use equality check to check for collection size. - namespace Squidex.Domain.Apps.Core.Operations.ExtractReferenceIds { public class ReferenceExtractionTests diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/GenerateJsonSchema/JsonSchemaTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/GenerateJsonSchema/JsonSchemaTests.cs index 45966ba28..b42655896 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/GenerateJsonSchema/JsonSchemaTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/GenerateJsonSchema/JsonSchemaTests.cs @@ -61,7 +61,7 @@ namespace Squidex.Domain.Apps.Core.Operations.GenerateJsonSchema var jsonSchema = schema.BuildJsonSchema(languagesConfig.ToResolver(), (n, s) => new JsonSchema { Reference = s }); - Assert.NotNull(new ContentSchemaBuilder().CreateContentSchema(schema, jsonSchema)); + Assert.NotNull(ContentSchemaBuilder.CreateContentSchema(schema, jsonSchema)); } private static HashSet AllPropertyNames(JsonSchema schema) diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs index 275e01151..8969ae945 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs @@ -28,6 +28,8 @@ using Squidex.Shared.Identity; using Squidex.Shared.Users; using Xunit; +#pragma warning disable CA2012 // Use ValueTasks correctly + namespace Squidex.Domain.Apps.Core.Operations.HandleRules { public class RuleEventFormatterCompareTests diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterTests.cs index 655713b55..9fbe977a5 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterTests.cs @@ -26,6 +26,8 @@ using Squidex.Shared.Identity; using Squidex.Shared.Users; using Xunit; +#pragma warning disable CA2012 // Use ValueTasks correctly + namespace Squidex.Domain.Apps.Core.Operations.HandleRules { public class RuleEventFormatterTests diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleServiceTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleServiceTests.cs index 99c37c102..3fbe98183 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleServiceTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleServiceTests.cs @@ -26,8 +26,6 @@ using Squidex.Infrastructure.Reflection; using Squidex.Log; using Xunit; -#pragma warning disable xUnit2009 // Do not use boolean check to check for string equality - namespace Squidex.Domain.Apps.Core.Operations.HandleRules { public class RuleServiceTests diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/JintUserTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/JintUserTests.cs index 25bc436ec..104b6032e 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/JintUserTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/JintUserTests.cs @@ -12,8 +12,6 @@ using Squidex.Infrastructure.Security; using Squidex.Shared.Identity; using Xunit; -#pragma warning disable xUnit2004 // Do not use equality check to test for boolean conditions - namespace Squidex.Domain.Apps.Core.Operations.Scripting { public class JintUserTests diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/MockupHttpHandler.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/MockupHttpHandler.cs index ecc595966..68d2e7e05 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/MockupHttpHandler.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Scripting/MockupHttpHandler.cs @@ -25,7 +25,7 @@ namespace Squidex.Domain.Apps.Core.Operations.Scripting public void ShouldBeUrl(string url) { - Assert.Equal(url, madeRequest.RequestUri.ToString()); + Assert.Equal(url, madeRequest.RequestUri?.ToString()); } public void ShouldBeHeader(string key, string value) diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/AssetsFieldTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/AssetsFieldTests.cs index f7bb847c4..61f46abc1 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/AssetsFieldTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/AssetsFieldTests.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs index 09477bd87..d07f0cb99 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs @@ -213,7 +213,7 @@ namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators return new ReferencesValidator(properties.IsRequired, properties, FoundReferences(schemaId1)); } - private IValidator Validator(ReferencesFieldProperties properties, DomainId schemaId, params (DomainId Id, Status Status)[] references) + private static IValidator Validator(ReferencesFieldProperties properties, DomainId schemaId, params (DomainId Id, Status Status)[] references) { return new ReferencesValidator(properties.IsRequired, properties, FoundReferences(schemaId, references)); } diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/StringLengthValidatorTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/StringLengthValidatorTests.cs index bc15bcfa8..ebb19306d 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/StringLengthValidatorTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/StringLengthValidatorTests.cs @@ -111,7 +111,7 @@ namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators for (var i = 0; i < size; i++) { - sb.Append("x"); + sb.Append('x'); } return sb.ToString(); diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/StringTextValidatorTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/StringTextValidatorTests.cs index 19fed832a..9db9685fd 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/StringTextValidatorTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/StringTextValidatorTests.cs @@ -176,7 +176,7 @@ namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators for (var i = 0; i < size; i++) { - sb.Append("x"); + sb.Append('x'); } return sb.ToString(); @@ -188,8 +188,8 @@ namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators for (var i = 0; i < size; i++) { - sb.Append("x"); - sb.Append(" "); + sb.Append('x'); + sb.Append(' '); } return sb.ToString(); diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/UniqueValidatorTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/UniqueValidatorTests.cs index 1d5d7c8af..75c858a6c 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/UniqueValidatorTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/UniqueValidatorTests.cs @@ -99,7 +99,7 @@ namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators Assert.Empty(errors); } - private CheckUniqueness FoundDuplicates(DomainId id, Action? filter = null) + private static CheckUniqueness FoundDuplicates(DomainId id, Action? filter = null) { return filterNode => { diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj b/backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj index b3bb64b4e..5336592f3 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net5.0 Squidex.Domain.Apps.Core - 8.0 + 9.0 enable @@ -14,9 +14,9 @@ - - - + + + diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppCommandMiddlewareTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppCommandMiddlewareTests.cs index 14aef2cb0..68909cabe 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppCommandMiddlewareTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppCommandMiddlewareTests.cs @@ -19,8 +19,6 @@ using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Validation; using Xunit; -#pragma warning disable IDE0067 // Dispose objects before losing scope - namespace Squidex.Domain.Apps.Entities.Apps { public class AppCommandMiddlewareTests : HandlerTestBase diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/BackupAppsTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/BackupAppsTests.cs index b0c4af2c4..a498a16b9 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/BackupAppsTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/BackupAppsTests.cs @@ -19,8 +19,6 @@ using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Json.Objects; using Xunit; -#pragma warning disable IDE0067 // Dispose objects before losing scope - namespace Squidex.Domain.Apps.Entities.Apps { public class BackupAppsTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Guards/GuardAppRolesTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Guards/GuardAppRolesTests.cs index e281b6214..8f3057b7c 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Guards/GuardAppRolesTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Guards/GuardAppRolesTests.cs @@ -85,7 +85,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Guards { var roles_1 = roles_0.Add(roleName); - var clients_1 = clients.Add("1", new AppClient("client", "1", roleName)); + var clients_1 = clients.Add("1", "my-secret", roleName); var command = new DeleteRole { Name = roleName }; diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs index 0c1e7234f..53f76579f 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs @@ -22,8 +22,6 @@ using Squidex.Infrastructure.Security; using Squidex.Infrastructure.Validation; using Xunit; -#pragma warning disable SA1133 // Do not combine attributes - namespace Squidex.Domain.Apps.Entities.Apps.Indexes { public sealed class AppsIndexTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Plans/UsageGateTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Plans/UsageGateTests.cs index 051d57f7f..d9ca6990e 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Plans/UsageGateTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Plans/UsageGateTests.cs @@ -63,7 +63,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans public async Task Should_return_true_if_over_client_limit() { A.CallTo(() => appEntity.Clients) - .Returns(AppClients.Empty.Add(clientId, new AppClient(clientId, clientId, Role.Developer, 100))); + .Returns(AppClients.Empty.Add(clientId, clientId).Update(clientId, apiCallsLimit: 1000)); apiCallsCurrent = 1000; apiCallsBlocking = 1600; diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetChangedTriggerHandlerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetChangedTriggerHandlerTests.cs index 12b666f0f..7d16f27b2 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetChangedTriggerHandlerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetChangedTriggerHandlerTests.cs @@ -21,8 +21,6 @@ using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Xunit; -#pragma warning disable SA1401 // Fields must be private - namespace Squidex.Domain.Apps.Entities.Assets { public class AssetChangedTriggerHandlerTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetDomainObjectGrainTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetDomainObjectGrainTests.cs index 820a7a3be..2706855b2 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetDomainObjectGrainTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetDomainObjectGrainTests.cs @@ -11,6 +11,7 @@ using Squidex.Infrastructure.Orleans; using Xunit; #pragma warning disable RECS0026 // Possible unassigned object created by 'new' +#pragma warning disable CA1806 // Do not ignore method results namespace Squidex.Domain.Apps.Entities.Assets { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetFolderDomainObjectGrainTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetFolderDomainObjectGrainTests.cs index 50ba20ba7..43c3bd68d 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetFolderDomainObjectGrainTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetFolderDomainObjectGrainTests.cs @@ -11,6 +11,7 @@ using Squidex.Infrastructure.Orleans; using Xunit; #pragma warning disable RECS0026 // Possible unassigned object created by 'new' +#pragma warning disable CA1806 // Do not ignore method results namespace Squidex.Domain.Apps.Entities.Assets { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/BackupAssetsTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/BackupAssetsTests.cs index 95a74fdf4..56ba78c29 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/BackupAssetsTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/BackupAssetsTests.cs @@ -21,8 +21,6 @@ using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.EventSourcing; using Xunit; -#pragma warning disable IDE0067 // Dispose objects before losing scope - namespace Squidex.Domain.Apps.Entities.Assets { public class BackupAssetsTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Comments/CommentTriggerHandlerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Comments/CommentTriggerHandlerTests.cs index 9558dccec..423107dff 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Comments/CommentTriggerHandlerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Comments/CommentTriggerHandlerTests.cs @@ -102,7 +102,7 @@ namespace Squidex.Domain.Apps.Entities.Comments [Fact] public async Task Should_not_create_enriched_events_when_mentions_is_empty() { - var envelope = Envelope.Create(new CommentCreated { Mentions = new string[0] }); + var envelope = Envelope.Create(new CommentCreated { Mentions = Array.Empty() }); var result = await sut.CreateEnrichedEventsAsync(envelope); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentChangedTriggerHandlerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentChangedTriggerHandlerTests.cs index a81ff1d8f..8812b3f59 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentChangedTriggerHandlerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentChangedTriggerHandlerTests.cs @@ -24,9 +24,6 @@ using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Xunit; -#pragma warning disable SA1401 // Fields must be private -#pragma warning disable RECS0070 - namespace Squidex.Domain.Apps.Entities.Contents { public class ContentChangedTriggerHandlerTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentDomainObjectGrainTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentDomainObjectGrainTests.cs index 2636d1bc7..523c0c5b7 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentDomainObjectGrainTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentDomainObjectGrainTests.cs @@ -11,6 +11,7 @@ using Squidex.Infrastructure.Orleans; using Xunit; #pragma warning disable RECS0026 // Possible unassigned object created by 'new' +#pragma warning disable CA1806 // Do not ignore method results namespace Squidex.Domain.Apps.Entities.Contents { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs index fddced9b2..db53d8983 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs @@ -26,7 +26,6 @@ using Squidex.Infrastructure.Json; using Squidex.Log; using Xunit; -#pragma warning disable SA1311 // Static readonly fields must begin with upper-case letter #pragma warning disable SA1401 // Fields must be private namespace Squidex.Domain.Apps.Entities.Contents.GraphQL diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ContentEnricherTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ContentEnricherTests.cs index b1c9d258a..ed98a310a 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ContentEnricherTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ContentEnricherTests.cs @@ -52,7 +52,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries [Fact] public async Task Should_only_invoke_pre_enrich_for_empty_results() { - var source = new IContentEntity[0]; + var source = Array.Empty(); var step1 = A.Fake(); var step2 = A.Fake(); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ContentQueryServiceTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ContentQueryServiceTests.cs index 54f2e0206..0de10819b 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ContentQueryServiceTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ContentQueryServiceTests.cs @@ -23,8 +23,6 @@ using Squidex.Shared; using Squidex.Shared.Identity; using Xunit; -#pragma warning disable SA1401 // Fields must be private - namespace Squidex.Domain.Apps.Entities.Contents.Queries { public class ContentQueryServiceTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/EnrichWithWorkflowsTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/EnrichWithWorkflowsTests.cs index bd213f07c..bccdb8701 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/EnrichWithWorkflowsTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/EnrichWithWorkflowsTests.cs @@ -57,7 +57,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries await sut.EnrichAsync(requestContext, new[] { content }, null!); - Assert.Equal(Status.Published, content.NextStatuses.Single().Status); + Assert.Equal(Status.Published, content.NextStatuses?.Single().Status); A.CallTo(() => contentWorkflow.GetNextAsync(content, A._, requestContext.User)) .MustNotHaveHappened(); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ResolveAssetsTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ResolveAssetsTests.cs index eec644181..3824943de 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ResolveAssetsTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ResolveAssetsTests.cs @@ -5,6 +5,7 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== +using System; using System.Linq; using System.Threading.Tasks; using FakeItEasy; @@ -149,7 +150,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries { var contents = new[] { - CreateContent(new[] { DomainId.NewGuid() }, new DomainId[0]) + CreateContent(new[] { DomainId.NewGuid() }, Array.Empty()) }; var ctx = new Context(Mocks.ApiUser(), Mocks.App(appId)); @@ -167,7 +168,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries { var contents = new[] { - CreateContent(new[] { DomainId.NewGuid() }, new DomainId[0]) + CreateContent(new[] { DomainId.NewGuid() }, Array.Empty()) }; var ctx = new Context(Mocks.FrontendUser(), Mocks.App(appId)).WithoutContentEnrichment(true); @@ -185,7 +186,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries { var contents = new[] { - CreateContent(new DomainId[0], new DomainId[0]) + CreateContent(Array.Empty(), Array.Empty()) }; await sut.EnrichAsync(requestContext, contents, schemaProvider); @@ -204,7 +205,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries var contents = new[] { - CreateContent(new[] { id1, id2 }, new DomainId[0]) + CreateContent(new[] { id1, id2 }, Array.Empty()) }; await sut.EnrichAsync(requestContext, contents, schemaProvider); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ResolveReferencesTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ResolveReferencesTests.cs index 6c9dedc45..f87ec446a 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ResolveReferencesTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Queries/ResolveReferencesTests.cs @@ -235,7 +235,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries { var contents = new[] { - CreateContent(new[] { DomainId.NewGuid() }, new DomainId[0]) + CreateContent(new[] { DomainId.NewGuid() }, Array.Empty()) }; var ctx = new Context(Mocks.ApiUser(), Mocks.App(appId)); @@ -253,7 +253,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries { var contents = new[] { - CreateContent(new[] { DomainId.NewGuid() }, new DomainId[0]) + CreateContent(new[] { DomainId.NewGuid() }, Array.Empty()) }; var ctx = new Context(Mocks.FrontendUser(), Mocks.App(appId)).WithoutContentEnrichment(true); @@ -271,7 +271,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries { var contents = new[] { - CreateContent(new DomainId[0], new DomainId[0]) + CreateContent(Array.Empty(), Array.Empty()) }; await sut.EnrichAsync(requestContext, contents, schemaProvider); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/TestData/FakeUrlGenerator.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/TestData/FakeUrlGenerator.cs index 6be67c08f..7853dd3d0 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/TestData/FakeUrlGenerator.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/TestData/FakeUrlGenerator.cs @@ -66,11 +66,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.TestData throw new NotSupportedException(); } - public string ContentsUI(NamedId appId) - { - throw new NotSupportedException(); - } - public string ContentsUI(NamedId appId, NamedId schemaId) { throw new NotSupportedException(); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerTestsBase.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerTestsBase.cs index 0dc223aad..2b7867045 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerTestsBase.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerTestsBase.cs @@ -19,9 +19,7 @@ using Squidex.Infrastructure.EventSourcing; using Xunit; #pragma warning disable SA1401 // Fields should be private -#pragma warning disable SA1114 // Parameter list should follow declaration #pragma warning disable SA1115 // Parameter should follow comma -#pragma warning disable RECS0021 // Warns about calls to virtual member functions occuring in the constructor namespace Squidex.Domain.Apps.Entities.Contents.Text { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/GuardRuleTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/GuardRuleTests.cs index fb4fc6a8f..59f3595cd 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/GuardRuleTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/GuardRuleTests.cs @@ -18,8 +18,6 @@ using Squidex.Infrastructure.Collections; using Squidex.Infrastructure.Validation; using Xunit; -#pragma warning disable SA1310 // Field names must not contain underscore - namespace Squidex.Domain.Apps.Entities.Rules.Guards { public class GuardRuleTests : IClassFixture diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleDequeuerGrainTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleDequeuerGrainTests.cs index d906f2cc5..010e81733 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleDequeuerGrainTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleDequeuerGrainTests.cs @@ -16,8 +16,6 @@ using Squidex.Infrastructure; using Squidex.Log; using Xunit; -#pragma warning disable RECS0165 // Asynchronous methods should return a Task instead of void - namespace Squidex.Domain.Apps.Entities.Rules { public class RuleDequeuerGrainTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Guards/GuardSchemaFieldTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Guards/GuardSchemaFieldTests.cs index db4e8edef..89223a084 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Guards/GuardSchemaFieldTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Guards/GuardSchemaFieldTests.cs @@ -17,7 +17,6 @@ using Squidex.Infrastructure.Validation; using Xunit; #pragma warning disable SA1310 // Field names must not contain underscore -#pragma warning disable SA1401 // Fields must be private namespace Squidex.Domain.Apps.Entities.Schemas.Guards { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs index 0b92802cc..4910a936f 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs @@ -21,8 +21,6 @@ using Squidex.Infrastructure.Orleans; using Squidex.Infrastructure.Validation; using Xunit; -#pragma warning disable SA1133 // Do not combine attributes - namespace Squidex.Domain.Apps.Entities.Schemas.Indexes { public class SchemasIndexTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemaChangedTriggerHandlerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemaChangedTriggerHandlerTests.cs index 2dba39190..fbeb8f2c4 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemaChangedTriggerHandlerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/SchemaChangedTriggerHandlerTests.cs @@ -21,8 +21,6 @@ using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Xunit; -#pragma warning disable SA1401 // Fields must be private - namespace Squidex.Domain.Apps.Entities.Schemas { public class SchemaChangedTriggerHandlerTests diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj index 9f7009d16..8e13a6807 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net5.0 Squidex.Domain.Apps.Entities - 8.0 + 9.0 enable @@ -19,11 +19,11 @@ - - - - - + + + + + diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Tags/GrainTagServiceTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Tags/GrainTagServiceTests.cs index dca427418..c50e3a268 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Tags/GrainTagServiceTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Tags/GrainTagServiceTests.cs @@ -30,12 +30,6 @@ namespace Squidex.Domain.Apps.Entities.Tags sut = new GrainTagService(grainFactory); } - [Fact] - public void Should_provide_name() - { - Assert.Equal("Tags", sut.Name); - } - [Fact] public async Task Should_call_grain_when_clearing() { diff --git a/backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj b/backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj index 7cb2c123f..57fe19b88 100644 --- a/backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj +++ b/backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net5.0 Squidex.Domain.Users - 8.0 + 9.0 enable @@ -15,7 +15,7 @@ - + diff --git a/backend/tests/Squidex.Infrastructure.Tests/Commands/InMemoryCommandBusTests.cs b/backend/tests/Squidex.Infrastructure.Tests/Commands/InMemoryCommandBusTests.cs index 82eb2d224..3bdd3141f 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Commands/InMemoryCommandBusTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/Commands/InMemoryCommandBusTests.cs @@ -57,7 +57,7 @@ namespace Squidex.Infrastructure.Commands [Fact] public async Task Should_not_set_handled_if_no_handler_registered() { - var sut = new InMemoryCommandBus(new ICommandMiddleware[0]); + var sut = new InMemoryCommandBus(Array.Empty()); var ctx = await sut.PublishAsync(command); Assert.False(ctx.IsCompleted); diff --git a/backend/tests/Squidex.Infrastructure.Tests/DisposableObjectBaseTests.cs b/backend/tests/Squidex.Infrastructure.Tests/DisposableObjectBaseTests.cs index 3a478eddd..4d008c9fb 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/DisposableObjectBaseTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/DisposableObjectBaseTests.cs @@ -8,8 +8,6 @@ using System; using Xunit; -#pragma warning disable RECS0002 // Convert anonymous method to method group - namespace Squidex.Infrastructure { public class DisposableObjectBaseTests diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/EventStoreTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/EventStoreTests.cs index 50275c211..46c053c7b 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/EventStoreTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/EventStoreTests.cs @@ -179,8 +179,8 @@ namespace Squidex.Infrastructure.EventSourcing new StoredEvent(streamName, "Position", 3, events2[1]) }; - ShouldBeEquivalentTo(readEventsFromPosition.TakeLast(2), expectedFromPosition); - ShouldBeEquivalentTo(readEventsFromBeginning.TakeLast(4), expectedFromBeginning); + ShouldBeEquivalentTo(readEventsFromPosition?.TakeLast(2), expectedFromPosition); + ShouldBeEquivalentTo(readEventsFromBeginning?.TakeLast(4), expectedFromBeginning); } [Fact] @@ -240,7 +240,7 @@ namespace Squidex.Infrastructure.EventSourcing .Select((x, i) => new StoredEvent(streamName, "Position", i + offset, events[i + offset])) .ToArray(); - var expected2 = new StoredEvent[0]; + var expected2 = Array.Empty(); var readEvents1 = await Sut.QueryLatestAsync(streamName, take); var readEvents2 = await Sut.QueryLatestAsync(streamName, 0); @@ -341,7 +341,7 @@ namespace Squidex.Infrastructure.EventSourcing private static void ShouldBeEquivalentTo(IEnumerable? actual, params StoredEvent[] expected) { - var actualArray = actual.Select(x => new StoredEvent(x.StreamName, "Position", x.EventStreamNumber, x.Data)).ToArray(); + var actualArray = actual?.Select(x => new StoredEvent(x.StreamName, "Position", x.EventStreamNumber, x.Data)).ToArray(); actualArray.Should().BeEquivalentTo(expected); } diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Grains/EventConsumerManagerGrainTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Grains/EventConsumerManagerGrainTests.cs index 5d405708f..a5d5e5f19 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Grains/EventConsumerManagerGrainTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Grains/EventConsumerManagerGrainTests.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using FakeItEasy; using FluentAssertions; using Orleans; -using Orleans.Concurrency; using Orleans.Core; using Orleans.Runtime; using Xunit; diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs index c180e5608..65d655dc1 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs @@ -41,6 +41,8 @@ namespace Squidex.Infrastructure.EventSourcing public void Dispose() { Cleanup(); + + GC.SuppressFinalize(this); } } diff --git a/backend/tests/Squidex.Infrastructure.Tests/GuardTests.cs b/backend/tests/Squidex.Infrastructure.Tests/GuardTests.cs index 30daaf96c..0ea600aa4 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/GuardTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/GuardTests.cs @@ -308,7 +308,7 @@ namespace Squidex.Infrastructure [Fact] public void NotEmpty_should_throw_for_empty_collection() { - Assert.Throws(() => Guard.NotEmpty(new int[0], "parameter")); + Assert.Throws(() => Guard.NotEmpty(Array.Empty(), "parameter")); } [Fact] diff --git a/backend/tests/Squidex.Infrastructure.Tests/MongoDb/DomainIdSerializerTests.cs b/backend/tests/Squidex.Infrastructure.Tests/MongoDb/DomainIdSerializerTests.cs index a68bdf3d3..781e27025 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/MongoDb/DomainIdSerializerTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/MongoDb/DomainIdSerializerTests.cs @@ -69,7 +69,7 @@ namespace Squidex.Infrastructure.MongoDb Assert.Equal(result.Id.ToString(), id.ToString()); } - public TOut SerializeAndDeserialize(TIn source) + public static TOut SerializeAndDeserialize(TIn source) { var stream = new MemoryStream(); diff --git a/backend/tests/Squidex.Infrastructure.Tests/Reflection/SimpleEqualsTests.cs b/backend/tests/Squidex.Infrastructure.Tests/Reflection/SimpleEqualsTests.cs index 8a1b79c67..9e358fa4a 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Reflection/SimpleEqualsTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/Reflection/SimpleEqualsTests.cs @@ -8,10 +8,11 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using Squidex.Infrastructure.Collections; using Xunit; +#pragma warning disable CA1822 // Mark members as static + namespace Squidex.Infrastructure.Reflection { public class SimpleEqualsTests @@ -40,7 +41,7 @@ namespace Squidex.Infrastructure.Reflection return Equals(obj as CustomEquals); } - public bool Equals([AllowNull] CustomEquals other) + public bool Equals(CustomEquals? other) { return other != null && other.value == value; } diff --git a/backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj b/backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj index 4d89f846f..7460c0dd0 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj +++ b/backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net5.0 Squidex.Infrastructure - 8.0 + 9.0 enable @@ -16,8 +16,8 @@ - - + + all @@ -34,6 +34,7 @@ ..\..\Squidex.ruleset + en diff --git a/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceSnapshotTests.cs b/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceSnapshotTests.cs index 0fd5d8686..34b58e690 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceSnapshotTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceSnapshotTests.cs @@ -11,8 +11,6 @@ using FakeItEasy; using Squidex.Infrastructure.EventSourcing; using Xunit; -#pragma warning disable RECS0002 // Convert anonymous method to method group - namespace Squidex.Infrastructure.States { public class PersistenceSnapshotTests diff --git a/backend/tests/Squidex.Infrastructure.Tests/TestHelpers/BinaryFormatterHelper.cs b/backend/tests/Squidex.Infrastructure.Tests/TestHelpers/BinaryFormatterHelper.cs index c67e30e00..215e9a77f 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/TestHelpers/BinaryFormatterHelper.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/TestHelpers/BinaryFormatterHelper.cs @@ -8,6 +8,8 @@ using System.IO; using System.Runtime.Serialization.Formatters.Binary; +#pragma warning disable SYSLIB0011 // Type or member is obsolete + namespace Squidex.Infrastructure.TestHelpers { public static class BinaryFormatterHelper @@ -18,7 +20,7 @@ namespace Squidex.Infrastructure.TestHelpers { var stream = new MemoryStream(); - Formatter.Serialize(stream, source); + Formatter.Serialize(stream, source!); stream.Position = 0; diff --git a/backend/tests/Squidex.Web.Tests/ApiExceptionFilterAttributeTests.cs b/backend/tests/Squidex.Web.Tests/ApiExceptionFilterAttributeTests.cs index 76f976c8a..f02e50ce2 100644 --- a/backend/tests/Squidex.Web.Tests/ApiExceptionFilterAttributeTests.cs +++ b/backend/tests/Squidex.Web.Tests/ApiExceptionFilterAttributeTests.cs @@ -196,7 +196,7 @@ namespace Squidex.Web var result = new ObjectResult(problem) { StatusCode = problem.Status }; - return new ResultExecutingContext(actionContext, new List(), result, null); + return new ResultExecutingContext(actionContext, new List(), result, null!); } private ExceptionContext Error(Exception exception) @@ -229,20 +229,20 @@ namespace Squidex.Web return actionContext; } - private static void Validate(int statusCode, IActionResult actionResult, Exception? exception) + private static void Validate(int statusCode, IActionResult? actionResult, Exception? exception) { - var result = (ObjectResult)actionResult; + var result = actionResult as ObjectResult; - var error = (ErrorDto)result.Value; + var error = result?.Value as ErrorDto; - Assert.NotNull(error.Type); + Assert.NotNull(error?.Type); - Assert.Equal(statusCode, result.StatusCode); - Assert.Equal(statusCode, error.StatusCode); + Assert.Equal(statusCode, result?.StatusCode); + Assert.Equal(statusCode, error?.StatusCode); if (exception != null) { - Assert.Equal(exception.Message, error.Message); + Assert.Equal(exception.Message, error?.Message); } } } diff --git a/backend/tests/Squidex.Web.Tests/ApiPermissionAttributeTests.cs b/backend/tests/Squidex.Web.Tests/ApiPermissionAttributeTests.cs index 645806e20..9737d7443 100644 --- a/backend/tests/Squidex.Web.Tests/ApiPermissionAttributeTests.cs +++ b/backend/tests/Squidex.Web.Tests/ApiPermissionAttributeTests.cs @@ -47,7 +47,7 @@ namespace Squidex.Web { isNextCalled = true; - return Task.FromResult(null); + return Task.FromResult(null!); }; } diff --git a/backend/tests/Squidex.Web.Tests/CommandMiddlewares/ETagCommandMiddlewareTests.cs b/backend/tests/Squidex.Web.Tests/CommandMiddlewares/ETagCommandMiddlewareTests.cs index 98729e997..2c03c307a 100644 --- a/backend/tests/Squidex.Web.Tests/CommandMiddlewares/ETagCommandMiddlewareTests.cs +++ b/backend/tests/Squidex.Web.Tests/CommandMiddlewares/ETagCommandMiddlewareTests.cs @@ -95,7 +95,7 @@ namespace Squidex.Web.CommandMiddlewares await sut.HandleAsync(context); - Assert.Equal(new StringValues("17"), httpContextAccessor.HttpContext.Response.Headers[HeaderNames.ETag]); + Assert.Equal(new StringValues("17"), httpContextAccessor.HttpContext!.Response.Headers[HeaderNames.ETag]); } [Fact] @@ -108,7 +108,7 @@ namespace Squidex.Web.CommandMiddlewares await sut.HandleAsync(context); - Assert.Equal(new StringValues("17"), httpContextAccessor.HttpContext.Response.Headers[HeaderNames.ETag]); + Assert.Equal(new StringValues("17"), httpContextAccessor.HttpContext!.Response.Headers[HeaderNames.ETag]); } private CommandContext Ctx(ICommand command) diff --git a/backend/tests/Squidex.Web.Tests/Pipeline/ApiCostsFilterTests.cs b/backend/tests/Squidex.Web.Tests/Pipeline/ApiCostsFilterTests.cs index 09899811b..95fcfd38c 100644 --- a/backend/tests/Squidex.Web.Tests/Pipeline/ApiCostsFilterTests.cs +++ b/backend/tests/Squidex.Web.Tests/Pipeline/ApiCostsFilterTests.cs @@ -36,13 +36,13 @@ namespace Squidex.Web.Pipeline new ActionExecutingContext( new ActionContext(httpContext, new RouteData(), new ActionDescriptor()), - new List(), new Dictionary(), null); + new List(), new Dictionary(), null!); next = () => { isNextCalled = true; - return Task.FromResult(null); + return Task.FromResult(null!); }; sut = new ApiCostsFilter(usageGate); diff --git a/backend/tests/Squidex.Web.Tests/Pipeline/AppResolverTests.cs b/backend/tests/Squidex.Web.Tests/Pipeline/AppResolverTests.cs index b1c5a2bf5..991a90d6b 100644 --- a/backend/tests/Squidex.Web.Tests/Pipeline/AppResolverTests.cs +++ b/backend/tests/Squidex.Web.Tests/Pipeline/AppResolverTests.cs @@ -55,7 +55,7 @@ namespace Squidex.Web.Pipeline { isNextCalled = true; - return Task.FromResult(null); + return Task.FromResult(null!); }; sut = new AppResolver(appProvider); diff --git a/backend/tests/Squidex.Web.Tests/Pipeline/CachingFilterTests.cs b/backend/tests/Squidex.Web.Tests/Pipeline/CachingFilterTests.cs index 9abfc1a2a..5a783a01b 100644 --- a/backend/tests/Squidex.Web.Tests/Pipeline/CachingFilterTests.cs +++ b/backend/tests/Squidex.Web.Tests/Pipeline/CachingFilterTests.cs @@ -71,7 +71,7 @@ namespace Squidex.Web.Pipeline [Fact] public async Task Should_append_authorization_as_header_when_user_has_subject() { - var identity = (ClaimsIdentity)httpContext.User.Identity; + var identity = (ClaimsIdentity)httpContext.User.Identity!; identity.AddClaim(new Claim(OpenIdClaims.Subject, "my-id")); @@ -83,7 +83,7 @@ namespace Squidex.Web.Pipeline [Fact] public async Task Should_append_client_id_as_header_when_user_has_client_but_no_subject() { - var identity = (ClaimsIdentity)httpContext.User.Identity; + var identity = (ClaimsIdentity)httpContext.User.Identity!; identity.AddClaim(new Claim(OpenIdClaims.ClientId, "my-client")); diff --git a/backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs b/backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs index 70d77706e..c23f319d4 100644 --- a/backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs +++ b/backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs @@ -55,7 +55,7 @@ namespace Squidex.Web.Pipeline { isNextCalled = true; - return Task.FromResult(null); + return Task.FromResult(null!); }; sut = new SchemaResolver(appProvider); diff --git a/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj b/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj index 726c05611..bde484de3 100644 --- a/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj +++ b/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net5.0 Squidex.Web - 8.0 + 9.0 enable @@ -14,7 +14,7 @@ - + diff --git a/backend/tools/Benchmarks/Benchmarks.csproj b/backend/tools/Benchmarks/Benchmarks.csproj index fcc456da6..7726262e7 100644 --- a/backend/tools/Benchmarks/Benchmarks.csproj +++ b/backend/tools/Benchmarks/Benchmarks.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net5.0 diff --git a/backend/tools/GenerateLanguages/GenerateLanguages.csproj b/backend/tools/GenerateLanguages/GenerateLanguages.csproj index 337b9f152..10282f5e8 100644 --- a/backend/tools/GenerateLanguages/GenerateLanguages.csproj +++ b/backend/tools/GenerateLanguages/GenerateLanguages.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net5.0 Exe diff --git a/backend/tools/GenerateLanguages/Program.cs b/backend/tools/GenerateLanguages/Program.cs index 7cd25828e..9538d3ccb 100644 --- a/backend/tools/GenerateLanguages/Program.cs +++ b/backend/tools/GenerateLanguages/Program.cs @@ -31,13 +31,25 @@ namespace GenerateLanguages writer.WriteLine("// =========================================================================="); writer.WriteLine("// "); writer.WriteLine(); + writer.WriteLine("using System;"); writer.WriteLine("using System.CodeDom.Compiler;"); + writer.WriteLine("using System.Collections.Generic;"); writer.WriteLine(); writer.WriteLine("namespace Squidex.Infrastructure"); writer.WriteLine("{"); writer.WriteLine(" [GeneratedCode(\"LanguagesGenerator\", \"1.0\")]"); - writer.WriteLine(" partial class Language"); + writer.WriteLine(" public partial record Language"); writer.WriteLine(" {"); + writer.WriteLine(" private static readonly Dictionary AllLanguagesField = new Dictionary(StringComparer.OrdinalIgnoreCase);"); + writer.WriteLine(" private static readonly Dictionary AllLanguagesNames = new Dictionary(StringComparer.OrdinalIgnoreCase);"); + writer.WriteLine(); + writer.WriteLine(" internal static Language AddLanguage(string iso2Code, string englishName)"); + writer.WriteLine(" {"); + writer.WriteLine(" AllLanguagesNames[iso2Code] = englishName;"); + writer.WriteLine(); + writer.WriteLine(" return AllLanguagesField.GetOrAdd(iso2Code, code => new Language(code));"); + writer.WriteLine(" }"); + writer.WriteLine(); var languages = GetLanguages(languageCodesFile).ToList(); @@ -104,7 +116,7 @@ namespace GenerateLanguages if (uniqueCodes.Add(iso2Code)) { - yield return (iso2Code, line.Substring(6, line.Length - 7)); + yield return (iso2Code, line[6..^1]); } else { diff --git a/backend/tools/Migrator/Migrator.csproj b/backend/tools/Migrator/Migrator.csproj index dd528f98a..a1b2660fd 100644 --- a/backend/tools/Migrator/Migrator.csproj +++ b/backend/tools/Migrator/Migrator.csproj @@ -1,8 +1,8 @@  Exe - netcoreapp3.1 - 8.0 + net5.0 + 9.0 enable diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj b/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj index 375a59eaf..329119bce 100644 --- a/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj +++ b/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj @@ -1,7 +1,7 @@  Exe - netcoreapp3.1 + net5.0 diff --git a/backend/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj b/backend/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj index fd98135ea..f8c89425f 100644 --- a/backend/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj +++ b/backend/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net5.0 diff --git a/backend/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj b/backend/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj index f8cb2eb62..f413f010b 100644 --- a/backend/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj +++ b/backend/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net5.0 TestSuite diff --git a/frontend/app/framework/angular/routers/parent-link.directive.ts b/frontend/app/framework/angular/routers/parent-link.directive.ts index df93d8cfe..730d185c7 100644 --- a/frontend/app/framework/angular/routers/parent-link.directive.ts +++ b/frontend/app/framework/angular/routers/parent-link.directive.ts @@ -48,9 +48,7 @@ export class ParentLinkDirective extends ResourceOwner implements OnInit { @HostListener('click') public onClick(): boolean { - this.router.navigateByUrl(this.url, { - queryParamsHandling: 'preserve' - }); + this.router.navigateByUrl(this.url); return false; } diff --git a/frontend/package-lock.json b/frontend/package-lock.json index fedce4a33..2434d186f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -5,16 +5,16 @@ "requires": true, "dependencies": { "@angular-devkit/build-optimizer": { - "version": "0.1001.6", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.1001.6.tgz", - "integrity": "sha512-lZfqaQCaspszk+uc8w1rTlvZlhxPoKCMT8vwNRDpf5CD19GUO1HziYppPXGhV9hdS4HXAKi/Ji7qzCxI72Kwmg==", + "version": "0.1100.1", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.1100.1.tgz", + "integrity": "sha512-PpqBmDd+/cmaMj9MURe5pSSudo+Qz6BrGdzvYB16ekSp8bSDYLUriv5NvE/bm+ODKwo3jHgFrwWLiwK65vQcxQ==", "dev": true, "requires": { "loader-utils": "2.0.0", "source-map": "0.7.3", - "tslib": "2.0.1", - "typescript": "4.0.2", - "webpack-sources": "1.4.3" + "tslib": "2.0.3", + "typescript": "4.0.5", + "webpack-sources": "2.0.1" }, "dependencies": { "source-map": { @@ -23,40 +23,55 @@ "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true }, - "tslib": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", - "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==", - "dev": true - }, "typescript": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", - "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz", + "integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==", "dev": true + }, + "webpack-sources": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.0.1.tgz", + "integrity": "sha512-A9oYz7ANQBK5EN19rUXbvNgfdfZf5U2gP0769OXsj9CvYkCR6OHOsd6OKyEy4H38GGxpsQPKIL83NC64QY6Xmw==", + "dev": true, + "requires": { + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } } } }, "@angular-devkit/core": { - "version": "10.1.6", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.1.6.tgz", - "integrity": "sha512-RhZCbX2I+ukR6/yu1OxwtyveBkQy+knRSQ7oxsBbwkS4M0XzmUswlf0p8lTfJI9pxrJnc2SODatMfEKeOYWmkA==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-11.0.1.tgz", + "integrity": "sha512-ui3g7w/0SpU9oq8uwN9upR8Y1eOXZ+P2p3NyDydBrR7ZEfEkRLS1mhozN/ib8farrwK5N3kIIJxMb5t3187Hng==", "dev": true, "requires": { - "ajv": "6.12.4", + "ajv": "6.12.6", "fast-json-stable-stringify": "2.1.0", "magic-string": "0.25.7", - "rxjs": "6.6.2", + "rxjs": "6.6.3", "source-map": "0.7.3" }, "dependencies": { - "rxjs": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz", - "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==", + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { - "tslib": "^1.9.0" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "source-map": { @@ -64,55 +79,51 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true } } }, "@angular/animations": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-10.1.5.tgz", - "integrity": "sha512-RbUIluxgE5pSWWdODlcEAQuRqc/D1A2v275zBsMFjwJg3/cZl/z+RWcFJedHpJHEtbz7Aay1UWHu9jhXfA8elg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-11.0.0.tgz", + "integrity": "sha512-RGaAnZOI73bPnNWrJq/p8sc+hpUBhScq139M6r4qQjQPsPahazL6v6hHAgRhZNemqw164d1oE4K/22O/i0E3Tw==", "requires": { "tslib": "^2.0.0" } }, "@angular/cdk": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-10.2.4.tgz", - "integrity": "sha512-Ccm/iRb6zELWwMem6qTnFCalMVX/aS17hhN65efpNKrH3ovhyQSPWtF4p9IaEJ3rZpfXqXMPBneJ9ZXAA/iKog==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-11.0.0.tgz", + "integrity": "sha512-kfgEE/LDYMZB4NICChzWn/nTEeoZ3wxrYsDDcy2Qj+57zUmJcxBLL1h+tawYCy3a1g7ypDLYX7yrbPEBE7/EXQ==", "requires": { "parse5": "^5.0.0", "tslib": "^2.0.0" } }, "@angular/common": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/common/-/common-10.1.5.tgz", - "integrity": "sha512-xo10mSQYuf6x1XrnTfwt3Rs7JtSMkSyrJtAS/vNQKdBP/8zmn6pP9zRpp7vhQ5qF+W3HN8rPLb+YI2F6uaGjBg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-11.0.0.tgz", + "integrity": "sha512-chlbtxR7jpPs3Rc1ymdp3UfUzqEr57OFIxVMG6hROODclPQQk/7oOHdQB4hpUObaF9y4ZTLeKHKWiR/twi21Pg==", "requires": { "tslib": "^2.0.0" } }, "@angular/compiler": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-10.1.5.tgz", - "integrity": "sha512-3LyFkEzs6P6YYKkE/6E4PasMd58EBddOt9kR9kPmj9Atv/BLY3nc5RSWkOe4rK4GnBVP+ByzQiT9Fn5CiQnG/g==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-11.0.0.tgz", + "integrity": "sha512-I7wVhdqvhtBTQTtW61z0lwPb1LiQQ0NOwjsbfN5sAc7/uwxw7em+Kyb/XJgBwgaTKtAL8bZEzdoQGLdsSKQF2g==", "dev": true, "requires": { "tslib": "^2.0.0" } }, "@angular/compiler-cli": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-10.1.5.tgz", - "integrity": "sha512-AJ4eOHUxgDdfq/EagUlhJ6HaNlHajtmPkhXp2HmNMNN1nPN55VZSvN43Co2gdAHiFENqsTNlnQH630aXaDyVbQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-11.0.0.tgz", + "integrity": "sha512-zrd/cU9syZ8XuQ3ItfIGaKDn1ZBCWyiqdLVRH9VDmyNqQFiCc/VWQ9Th9z8qpLptgdpzE9+lKFgeZJTDtbcveQ==", "dev": true, "requires": { + "@babel/core": "^7.8.6", + "@babel/types": "^7.8.6", "canonical-path": "1.0.0", "chokidar": "^3.0.0", "convert-source-map": "^1.5.1", @@ -128,6 +139,44 @@ "yargs": "15.3.0" }, "dependencies": { + "@babel/core": { + "version": "7.12.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz", + "integrity": "sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.1", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.1", + "@babel/parser": "^7.12.3", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -143,25 +192,25 @@ } }, "@angular/core": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-10.1.5.tgz", - "integrity": "sha512-B8j1B5vkBmzyan78kMJhw7dfhe7znmujbeDU7qRgRcIllc9pVJv7D133Yze6JFiLVg21PfyFYs8FBJNeq39hxQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-11.0.0.tgz", + "integrity": "sha512-FNewyMwYy+kGdw1xWfrtaPD2cSQs3kDVFbl8mNMSzp933W5yMsHDvjXb0+nPFqEb8ywEIdm3MsBMK0y3iBWZQw==", "requires": { "tslib": "^2.0.0" } }, "@angular/forms": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-10.1.5.tgz", - "integrity": "sha512-fkXKCwXL0XeFMUkmzJpm+FHYrv1CCfFGxYEBQ/bzfd3Op+dFJqEPiOwK3wG943Y09THday6H509RwwEIyF/4yw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-11.0.0.tgz", + "integrity": "sha512-hP6GF1ZkxKQp7Y+EVbEe9PPDQPrUQNdfVxphCWQYwu3tm8+tn1r91KVXkp2MA3M4Fh6Xo2HQEU2d+VXv4w0iNQ==", "requires": { "tslib": "^2.0.0" } }, "@angular/localize": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-10.1.5.tgz", - "integrity": "sha512-wEiF9lLWulTwGFqFJ4dJ+mBiyylE0amJR4leUGHKu6iwjPUQUBCqReCapfvLLTfgt3nbq7DtVqlqxj7KW7w+xg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-11.0.0.tgz", + "integrity": "sha512-jd23nuy1//DLUoaLRh/dj7C3Mb1z9i4hrirOOFDvErWDvydJJf4gM5GvEM72Mle4nVjMsRdEZJYN8Of8EWJXSQ==", "requires": { "@babel/core": "7.8.3", "glob": "7.1.2", @@ -169,25 +218,25 @@ } }, "@angular/platform-browser": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-10.1.5.tgz", - "integrity": "sha512-qMAoPHt6dgXMtieI4zx/s5yX7FFRRUDp1R4GMBCZHPN3p66WdEVxBJo4p5RWhZJioXpUwKz8Xvc+Rrh7r0KDBA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-11.0.0.tgz", + "integrity": "sha512-p8sF6JfaBI+YyLpp5OSg6UcCqjtLKRR+Otq1P/tro5SuxrsrBNRVU8j0tl/crkScsMwAvgmJ1joRyUKdI2mUGQ==", "requires": { "tslib": "^2.0.0" } }, "@angular/platform-browser-dynamic": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-10.1.5.tgz", - "integrity": "sha512-wxHm1UFCtB+oU+IJ6pACGmjO9H8KVzJOLYL5hp2w0k8s7k7Zg73f6BdRgWWEEYv6uYIfF77qtKwgbH0X5H9S+w==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-11.0.0.tgz", + "integrity": "sha512-NAmKGhHK+tl7dr/Hcqxvr/813Opec3Mv0IRwIgmKdlpZd7qAwT/mw4RnO4YPSEoDOM6hqGt7GdlWrSDX802duQ==", "requires": { "tslib": "^2.0.0" } }, "@angular/platform-server": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/platform-server/-/platform-server-10.1.5.tgz", - "integrity": "sha512-n+6LEklqyzVdMiHRoGTU1MXECL/f6PdrLOJ8p5w5vak8dLQu83AHTO8SNC/YjrLanLgEXZXTG76AfGJbcMbiEw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/platform-server/-/platform-server-11.0.0.tgz", + "integrity": "sha512-0LsA4u5kCDKMOxcWf4HFH3PNYIhFcnzP/TYqYfIkY/GpQeC5agxWzddJofNi7g/Lh1UoK5hzf+3Ewn3o/aBxjA==", "requires": { "domino": "^2.1.2", "tslib": "^2.0.0", @@ -195,9 +244,9 @@ } }, "@angular/router": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@angular/router/-/router-10.1.5.tgz", - "integrity": "sha512-tY88ZzoBrc9K67wi5V1NLnurd3r9bYR2csZ6/zJeOE+Vdxz9ChSaglgh9T0vQdbVEAjVGPP5QtYaFO2Xv4qOIg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-11.0.0.tgz", + "integrity": "sha512-10ZeobfK3HqVeWS6zjdKU16ccxFtdCHkxT11bnFg3Jwq9vKt+LI5KitAkCI5rYTY3DRfVzasRkqBzZfZMkbftw==", "requires": { "tslib": "^2.0.0" } @@ -233,11 +282,11 @@ } }, "@babel/generator": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", - "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "requires": { - "@babel/types": "^7.11.5", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -260,6 +309,71 @@ "@babel/types": "^7.10.4" } }, + "@babel/helper-member-expression-to-functions": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz", + "integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, + "@babel/helper-module-imports": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.5" + } + }, + "@babel/helper-module-transforms": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", + "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "lodash": "^4.17.19" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-replace-supers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + } + }, + "@babel/helper-simple-access": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", + "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.1" + } + }, "@babel/helper-split-export-declaration": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", @@ -274,13 +388,13 @@ "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==" }, "@babel/helpers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", - "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", "requires": { "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/highlight": { @@ -294,9 +408,9 @@ } }, "@babel/parser": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", - "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==" + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", + "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==" }, "@babel/template": { "version": "7.10.4", @@ -309,25 +423,25 @@ } }, "@babel/traverse": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", - "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", + "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.5", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.5", - "@babel/types": "^7.11.5", + "@babel/parser": "^7.12.5", + "@babel/types": "^7.12.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" } }, "@babel/types": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", - "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "version": "7.12.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", + "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", "requires": { "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.19", @@ -349,14 +463,48 @@ } }, "@ngtools/webpack": { - "version": "10.1.6", - "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-10.1.6.tgz", - "integrity": "sha512-EOHGM/4AwOWrKlwVAyBkxdMdPmHc9qXRATg3SD0MXmNPX92tU94uZaP7cHqMzuUYl9D+0MzzXRtYSocl7bN1SQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-11.0.1.tgz", + "integrity": "sha512-z62qQ4J5LhDxW68HjYYCRo+sDK/5yHwX4fCCY2iXngyTtA5cQbGI5WXr3+9B4foX64ft5WvV0WJkx8mjE/VR6w==", "dev": true, "requires": { - "@angular-devkit/core": "10.1.6", - "enhanced-resolve": "4.3.0", - "webpack-sources": "1.4.3" + "@angular-devkit/core": "11.0.1", + "enhanced-resolve": "5.3.1", + "webpack-sources": "2.0.1" + }, + "dependencies": { + "enhanced-resolve": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.3.1.tgz", + "integrity": "sha512-G1XD3MRGrGfNcf6Hg0LVZG7GIKcYkbfHa5QMxt1HDUTdYoXH0JR1xXyg+MaKLF73E9A27uWNVxvFivNRYeUB6w==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "tapable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.1.1.tgz", + "integrity": "sha512-Wib1S8m2wdpLbmQz0RBEVosIyvb/ykfKXf3ZIDqvWoMg/zTNm6G/tDSuUM61J1kNCDXWJrLHGSFeMhAG+gAGpQ==", + "dev": true + }, + "webpack-sources": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.0.1.tgz", + "integrity": "sha512-A9oYz7ANQBK5EN19rUXbvNgfdfZf5U2gP0769OXsj9CvYkCR6OHOsd6OKyEy4H38GGxpsQPKIL83NC64QY6Xmw==", + "dev": true, + "requires": { + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" + } + } } }, "@nodelib/fs.scandir": { @@ -441,9 +589,9 @@ "dev": true }, "@types/jasmine": { - "version": "3.5.14", - "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.14.tgz", - "integrity": "sha512-Fkgk536sHPqcOtd+Ow+WiUNuk0TSo/BntKkF8wSvcd6M2FvPjeXcUE6Oz/bwDZiUZEaXLslAgw00Q94Pnx6T4w==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.1.tgz", + "integrity": "sha512-eeSCVhBsgwHNS1FmaMu4zrLxfykCTWJMLFZv7lmyrZQjw7foUUXoPu4GukSN9v7JvUw7X+/aDH3kCaymirBSTg==", "dev": true }, "@types/jquery": { @@ -492,9 +640,9 @@ "dev": true }, "@types/node": { - "version": "14.11.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.8.tgz", - "integrity": "sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw==", + "version": "14.14.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz", + "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==", "dev": true }, "@types/parse-json": { @@ -516,9 +664,9 @@ "dev": true }, "@types/react": { - "version": "16.9.52", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.52.tgz", - "integrity": "sha512-EHRjmnxiNivwhGdMh9sz1Yw9AUxTSZFxKqdBWAAzyZx3sufWwx6ogqHYh/WB1m/I4ZpjkoZLExF5QTy2ekVi/Q==", + "version": "16.9.56", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.56.tgz", + "integrity": "sha512-gIkl4J44G/qxbuC6r2Xh+D3CGZpJ+NdWTItAPmZbR5mUS+JQ8Zvzpl0ea5qT/ZT3ZNTUcDKUVqV3xBE8wv/DyQ==", "dev": true, "requires": { "@types/prop-types": "*", @@ -526,9 +674,9 @@ } }, "@types/react-dom": { - "version": "16.9.8", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.8.tgz", - "integrity": "sha512-ykkPQ+5nFknnlU6lDd947WbQ6TE3NNzbQAkInC2EKY1qeYdTKp7onFusmYZb+ityzx2YviqT6BXSu+LyWWJwcA==", + "version": "16.9.9", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.9.tgz", + "integrity": "sha512-jE16FNWO3Logq/Lf+yvEAjKzhpST/Eac8EMd1i4dgZdMczfgqC8EjpxwNgEe3SExHYLliabXDh9DEhhqnlXJhg==", "dev": true, "requires": { "@types/react": "*" @@ -923,9 +1071,9 @@ "dev": true }, "angular-gridster2": { - "version": "10.1.6", - "resolved": "https://registry.npmjs.org/angular-gridster2/-/angular-gridster2-10.1.6.tgz", - "integrity": "sha512-k0aWhX2N8E3cux4goPVs4za3FiekH++NvfsxruKG/gI5jXUOYrz1qsK66oYgrJM0zy9zGcBUU0jKIZiC8pklag==", + "version": "10.1.7", + "resolved": "https://registry.npmjs.org/angular-gridster2/-/angular-gridster2-10.1.7.tgz", + "integrity": "sha512-tlM6zm1+WNZUWu3GS73sl8z7FJgM/SdqmO/A5uz7HelqBv/tVMXln9Nv4flc8pkgIl7vvCGIgksavYfgWnpYIw==", "requires": { "tslib": "^2.0.0" } @@ -1251,9 +1399,9 @@ "dev": true }, "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "axobject-query": { @@ -1617,15 +1765,6 @@ "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==", "dev": true }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -1768,21 +1907,13 @@ } }, "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", "dev": true, "requires": { - "bn.js": "^4.1.0", + "bn.js": "^5.0.0", "randombytes": "^2.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } } }, "browserify-sign": { @@ -1831,15 +1962,16 @@ } }, "browserslist": { - "version": "4.14.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz", - "integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==", + "version": "4.14.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", + "integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001135", - "electron-to-chromium": "^1.3.571", - "escalade": "^3.1.0", - "node-releases": "^1.1.61" + "caniuse-lite": "^1.0.30001157", + "colorette": "^1.2.1", + "electron-to-chromium": "^1.3.591", + "escalade": "^3.1.1", + "node-releases": "^1.1.66" } }, "buffer": { @@ -2039,9 +2171,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001148", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001148.tgz", - "integrity": "sha512-E66qcd0KMKZHNJQt9hiLZGE3J4zuTqE1OnU53miEVtylFbwOEmeA5OsRu90noZful+XGSQOni1aT2tiqu/9yYw==", + "version": "1.0.30001158", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001158.tgz", + "integrity": "sha512-s5loVYY+yKpuVA3HyW8BarzrtJvwHReuzugQXlv1iR3LKSReoFXRm86mT6hT7PEF5RxW+XQZg+6nYjlywYzQ+g==", "dev": true }, "canonical-path": { @@ -2148,9 +2280,9 @@ } }, "circular-dependency-plugin": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/circular-dependency-plugin/-/circular-dependency-plugin-5.2.0.tgz", - "integrity": "sha512-7p4Kn/gffhQaavNfyDFg7LS5S/UT1JAjyGd4UqR2+jzoYF02eDkj0Ec3+48TsIa4zghjLY87nQHIh/ecK9qLdw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/circular-dependency-plugin/-/circular-dependency-plugin-5.2.2.tgz", + "integrity": "sha512-g38K9Cm5WRwlaH6g03B9OEz/0qRizI+2I7n+Gz+L5DxXJAPAiWQvwlYNm1V1jkdpUv95bOe/ASm2vfi/G560jQ==", "dev": true }, "circular-json": { @@ -2330,9 +2462,9 @@ "integrity": "sha512-UGb/ueu20U4xqWk8hZB3xIfV2/SFqnSLYONiM3wTMDqko0bsYrsAkGGhqUzbRkYm89aBKPyHtuNEbVWF9FTFzw==" }, "codemirror-graphql": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/codemirror-graphql/-/codemirror-graphql-0.12.2.tgz", - "integrity": "sha512-rzqXM5C0PijOlGGGVcVY+h9HOinb7oBgvUIOXXTXbW209rjYkWfTfj9Wn8zsdNYHjUADlAlir3uavxIYnFfDKQ==", + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/codemirror-graphql/-/codemirror-graphql-0.12.3.tgz", + "integrity": "sha512-u0TooVA2MWGNV+Bio89RCTRW9P5FqegB1V9rnz9I0QKoGXX/c9z9/Fc+nj18p8jxkWK8ii8d7hkz7vsNsHxdkw==", "requires": { "graphql-language-service-interface": "^2.4.2", "graphql-language-service-parser": "^1.6.4" @@ -2655,9 +2787,9 @@ } }, "copy-webpack-plugin": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.2.1.tgz", - "integrity": "sha512-VH2ZTMIBsx4p++Lmpg77adZ0KUyM5gFR/9cuTrbneNnJlcQXUFvsNariPqq2dq2kV3F2skHiDGPQCyKWy1+U0Q==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.3.1.tgz", + "integrity": "sha512-SyIMdP6H3v+zPU+VIhKRsK0ZEF82KZ93JBlKOoIW8SkkuI84FSrHxG+aMTE1u4csbi9PLRqqWTIK+bfJ2xsFuQ==", "dev": true, "requires": { "cacache": "^15.0.5", @@ -2685,9 +2817,9 @@ } }, "core-js": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", - "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.7.0.tgz", + "integrity": "sha512-NwS7fI5M5B85EwpWuIwJN4i/fbisQUwLwiSNUWeXlkAZ0sbBjLEvLvFLf1uzAUV66PcEPt4xCGCmOZSxVf3xzA==" }, "core-util-is": { "version": "1.0.2", @@ -2758,30 +2890,24 @@ "integrity": "sha512-dcru3l4IwfswR0SDpegJa9GBFTcGLpuTwPlkbe8Y3chg8IxumGo+JNY19H6Y7jT5JVCdQubVMwM8gE2vUitzug==" }, "cross-spawn": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", - "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "dependencies": { - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "isexe": "^2.0.0" } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true } } }, @@ -2946,16 +3072,16 @@ } }, "css-loader": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.0.0.tgz", - "integrity": "sha512-9g35eXRBgjvswyJWoqq/seWp+BOxvUl8IinVNTsUBFFxtwfEYvlmEn6ciyn0liXGbGh5HyJjPGCuobDSfqMIVg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.0.1.tgz", + "integrity": "sha512-cXc2ti9V234cq7rJzFKhirb2L2iPy8ZjALeVJAozXYz9te3r4eqLSixNAbMDJSgJEQywqXzs8gonxaboeKqwiw==", "dev": true, "requires": { - "camelcase": "^6.1.0", + "camelcase": "^6.2.0", "cssesc": "^3.0.0", "icss-utils": "^5.0.0", "loader-utils": "^2.0.0", - "postcss": "^8.1.1", + "postcss": "^8.1.4", "postcss-modules-extract-imports": "^3.0.0", "postcss-modules-local-by-default": "^4.0.0", "postcss-modules-scope": "^3.0.0", @@ -2966,9 +3092,9 @@ }, "dependencies": { "camelcase": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz", - "integrity": "sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true }, "semver": { @@ -3284,9 +3410,9 @@ } }, "csstype": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.3.tgz", - "integrity": "sha512-jPl+wbWPOWJ7SXsWyqGRk3lGecbar0Cb0OvZF/r/ZU011R4YqiRehgkQ9p4eQfo9DSDLqLL3wHwfxeJiuIsNag==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.5.tgz", + "integrity": "sha512-uVDi8LpBUKQj6sdxNaTetL6FpeCqTjOvAQuQUa/qAqq8oOd4ivkbhgnqayl0dnPal8Tb/yB1tF+gOvCBiicaiQ==", "dev": true }, "currently-unhandled": { @@ -3891,9 +4017,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.579", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.579.tgz", - "integrity": "sha512-9HaGm4UDxCtcmIqWWdv79pGgpRZWTqr+zg6kxp0MelSHfe1PNjrI8HXy1HgTSy4p0iQETGt8/ElqKFLW008BSA==", + "version": "1.3.596", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.596.tgz", + "integrity": "sha512-nLO2Wd2yU42eSoNJVQKNf89CcEGqeFZd++QsnN2XIgje1s/19AgctfjLIbPORlvcCO8sYjLwX4iUgDdusOY8Sg==", "dev": true }, "elliptic": { @@ -4064,9 +4190,15 @@ "dev": true }, "entities": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", - "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" + }, + "env-paths": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", + "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==", + "dev": true }, "errno": { "version": "0.1.7", @@ -4729,9 +4861,9 @@ "dev": true }, "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", - "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", + "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -4773,9 +4905,9 @@ } }, "file-loader": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.1.1.tgz", - "integrity": "sha512-Klt8C4BjWSXYQAfhpYYkG4qHNTna4toMHEbWrI5IuVoxbU6uiDKeKAP99R8mmbJi3lvewn/jQBOgU4+NS3tDQw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", + "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", "dev": true, "requires": { "loader-utils": "^2.0.0", @@ -5149,52 +5281,6 @@ "dev": true, "optional": true }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - }, - "dependencies": { - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -5282,9 +5368,9 @@ } }, "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==" + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" }, "get-caller-file": { "version": "2.0.5", @@ -5423,21 +5509,21 @@ "dev": true }, "graphiql": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/graphiql/-/graphiql-1.0.5.tgz", - "integrity": "sha512-jrTmKvFzarM3u1RKXM1FFyvyo6TU4eUTfi3K04c8peGPNhPWA31xl20lE2Y5tP+XoWZZN0bqyCfEMDijSJ62lA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/graphiql/-/graphiql-1.0.6.tgz", + "integrity": "sha512-PgKEfWkXxU4Lx92eSEcLF/2en5bjGplxNwwLCKEQ82xU7t8wfj4UL46Zwx40E9LcxJum6KRfGzMjcY+bNwHzpQ==", "requires": { "codemirror": "^5.54.0", - "codemirror-graphql": "^0.12.2", + "codemirror-graphql": "^0.12.3", "copy-to-clipboard": "^3.2.0", "entities": "^2.0.0", "markdown-it": "^10.0.0" } }, "graphql": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.3.0.tgz", - "integrity": "sha512-GTCJtzJmkFLWRfFJuoo9RWWa/FfamUHgiFosxi/X1Ani4AVWbeyBenZTNX6dM+7WSbbFfTo/25eh0LLkwHMw2w==" + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.4.0.tgz", + "integrity": "sha512-EB3zgGchcabbsU9cFe1j+yxdzKQKAbGUWRb13DsrsMN1yyfmmIq+2+L5MqVWcDCE4V89R5AyUOi7sMOGxdsYtA==" }, "graphql-language-service-interface": { "version": "2.4.2", @@ -6083,9 +6169,9 @@ "dev": true }, "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true }, "iferr": { @@ -6182,12 +6268,6 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, - "in-publish": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", - "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==", - "dev": true - }, "indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", @@ -6575,12 +6655,6 @@ "path-is-inside": "^1.0.2" } }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -6893,9 +6967,9 @@ "dev": true }, "jest-worker": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.5.0.tgz", - "integrity": "sha512-kTw66Dn4ZX7WpjZ7T/SUDgRhapFRKWmisVAF0Rv4Fu8SLFD7eLbqpLvbxVqYhSgaWa7I+bW7pHnbyfNsH6stug==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", "dev": true, "requires": { "@types/node": "*", @@ -7574,12 +7648,19 @@ "linkify-it": "^2.0.0", "mdurl": "^1.0.1", "uc.micro": "^1.0.5" + }, + "dependencies": { + "entities": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==" + } } }, "marked": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-1.2.0.tgz", - "integrity": "sha512-tiRxakgbNPBr301ihe/785NntvYyhxlqcL3YaC8CaxJQh7kiaEtrN9B/eK2I2943Yjkh5gw25chYFDQhOMCwMA==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.2.4.tgz", + "integrity": "sha512-6x5TFGCTKSQBLTZtOburGxCxFEBJEGYVLwCMTBCxzvyuisGcC20UNzDSJhCr/cJ/Kmh6ulfJm10g6WWEAJ3kvg==" }, "md5.js": { "version": "1.3.5", @@ -7722,29 +7803,14 @@ } }, "mini-css-extract-plugin": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.0.0.tgz", - "integrity": "sha512-IsmrPv1nkdSUtFCDrAsuv5kg0k/27sLxfXqSz8vLjnbRKrNgoRdQrUNA4MppawvD+GHLkNP6L1P93Bw50ALkbg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.3.1.tgz", + "integrity": "sha512-jIOheqh9EU98rqj6ZaFTYNNDSFqdakNqaUZfkYwaXPjI9batmXVXX+K71NrqRAgtoGefELBMld1EQ7dqSAD5SQ==", "dev": true, "requires": { "loader-utils": "^2.0.0", - "normalize-url": "1.9.1", "schema-utils": "^3.0.0", "webpack-sources": "^1.1.0" - }, - "dependencies": { - "normalize-url": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", - "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", - "dev": true, - "requires": { - "object-assign": "^4.0.1", - "prepend-http": "^1.0.0", - "query-string": "^4.1.0", - "sort-keys": "^1.0.0" - } - } } }, "minimalistic-assert": { @@ -7955,9 +8021,9 @@ "dev": true }, "nanoid": { - "version": "3.1.12", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.12.tgz", - "integrity": "sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==", + "version": "3.1.16", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.16.tgz", + "integrity": "sha512-+AK8MN0WHji40lj8AEuwLOvLSbWYApQpre/aFJZD71r43wVRLrOYS4FmJOPQYon1TqB462RzrrxlfA74XRES8w==", "dev": true }, "nanomatch": { @@ -8036,74 +8102,50 @@ "dev": true }, "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", + "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", "dev": true, "requires": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.3", + "nopt": "^5.0.0", + "npmlog": "^4.1.2", + "request": "^2.88.2", + "rimraf": "^3.0.2", + "semver": "^7.3.2", + "tar": "^6.0.2", + "which": "^2.0.2" }, "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { - "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, - "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" + "isexe": "^2.0.0" } } } @@ -8163,29 +8205,28 @@ } }, "node-releases": { - "version": "1.1.61", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.61.tgz", - "integrity": "sha512-DD5vebQLg8jLCOzwupn954fbIiZht05DAZs0k2u8NStSe6h9XdsuIQL8hSRKYiU8WUQRznmSDrKGbv3ObOmC7g==", + "version": "1.1.66", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.66.tgz", + "integrity": "sha512-JHEQ1iWPGK+38VLB2H9ef2otU4l8s3yAMt9Xf934r6+ojCYDMHPMqvCc9TnzfeFSP1QEOeU6YZEd3+De0LTCgg==", "dev": true }, "node-sass": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", - "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-5.0.0.tgz", + "integrity": "sha512-opNgmlu83ZCF792U281Ry7tak9IbVC+AKnXGovcQ8LG8wFaJv6cLnRlc6DIHlmNxWEexB5bZxi9SZ9JyUuOYjw==", "dev": true, "requires": { "async-foreach": "^0.1.3", "chalk": "^1.1.1", - "cross-spawn": "^3.0.0", + "cross-spawn": "^7.0.3", "gaze": "^1.0.0", "get-stdin": "^4.0.1", "glob": "^7.0.3", - "in-publish": "^2.0.0", "lodash": "^4.17.15", "meow": "^3.7.0", "mkdirp": "^0.5.1", "nan": "^2.13.2", - "node-gyp": "^3.8.0", + "node-gyp": "^7.1.0", "npmlog": "^4.0.0", "request": "^2.88.0", "sass-graph": "2.2.5", @@ -8245,9 +8286,9 @@ } }, "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, "requires": { "abbrev": "1" @@ -8611,22 +8652,6 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", @@ -8836,9 +8861,9 @@ "dev": true }, "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { @@ -8890,9 +8915,9 @@ "dev": true }, "pikaday": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/pikaday/-/pikaday-1.8.0.tgz", - "integrity": "sha512-SgGxMYX0NHj9oQnMaSyAipr2gOrbB4Lfs/TJTb6H6hRHs39/5c5VZi73Q8hr53+vWjdn6HzkWcj8Vtl3c9ziaA==" + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/pikaday/-/pikaday-1.8.2.tgz", + "integrity": "sha512-TNtsE+34BIax3WtkB/qqu5uepV1McKYEgvL3kWzU7aqPCpMEN6rBF3AOwu4WCwAealWlBGobXny/9kJb49C1ew==" }, "pinkie": { "version": "2.0.4", @@ -8962,14 +8987,14 @@ "dev": true }, "postcss": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.1.1.tgz", - "integrity": "sha512-9DGLSsjooH3kSNjTZUOt2eIj2ZTW0VI2PZ/3My+8TC7KIbH2OKwUlISfDsf63EP4aiRUt3XkEWMWvyJHvJelEg==", + "version": "8.1.7", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.1.7.tgz", + "integrity": "sha512-llCQW1Pz4MOPwbZLmOddGM9eIJ8Bh7SZ2Oj5sxZva77uVaotYDsYTch1WBTNu7fUY0fpWp0fdt7uW40D4sRiiQ==", "dev": true, "requires": { "colorette": "^1.2.1", "line-column": "^1.0.2", - "nanoid": "^3.1.12", + "nanoid": "^3.1.16", "source-map": "^0.6.1" }, "dependencies": { @@ -9937,49 +9962,14 @@ } }, "postcss-import": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-12.0.1.tgz", - "integrity": "sha512-3Gti33dmCjyKBgimqGxL3vcV8w9+bsHwO5UrBawp796+jdardbcFl4RP5w/76BwNL7aGzpKstIfF9I+kdE8pTw==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-13.0.0.tgz", + "integrity": "sha512-LPUbm3ytpYopwQQjqgUH4S3EM/Gb9QsaSPP/5vnoi+oKVy3/mIk2sc0Paqw7RL57GpScm9MdIMUypw2znWiBpg==", "dev": true, "requires": { - "postcss": "^7.0.1", - "postcss-value-parser": "^3.2.3", + "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", "resolve": "^1.1.7" - }, - "dependencies": { - "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "postcss-initial": { @@ -11564,12 +11554,6 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true - }, "pretty-error": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", @@ -11638,12 +11622,6 @@ "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -11729,16 +11707,6 @@ "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true }, - "query-string": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", - "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", - "dev": true, - "requires": { - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - } - }, "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -11805,24 +11773,22 @@ } }, "react": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz", - "integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.1.tgz", + "integrity": "sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w==", "requires": { "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2" + "object-assign": "^4.1.1" } }, "react-dom": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.13.1.tgz", - "integrity": "sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.1.tgz", + "integrity": "sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.19.1" + "scheduler": "^0.20.1" } }, "react-is": { @@ -12371,9 +12337,9 @@ } }, "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", "dev": true }, "run-queue": { @@ -12686,9 +12652,9 @@ } }, "sass-loader": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.0.3.tgz", - "integrity": "sha512-W4+FV5oUdYy0PnC11ZoPrcAexODgDCa3ngxoy5X5qBhZYoPz9FPjb6Oox8Aa0ZYEyx34k8AQfOVuvqefOSAAUQ==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.1.0.tgz", + "integrity": "sha512-ZCKAlczLBbFd3aGAhowpYEy69Te3Z68cg8bnHHl6WnSCvnKpbM6pQrz957HWMa8LKVuhnD9uMplmMAHwGQtHeg==", "dev": true, "requires": { "klona": "^2.0.4", @@ -12713,9 +12679,9 @@ "dev": true }, "scheduler": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", - "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.1.tgz", + "integrity": "sha512-LKTe+2xNJBNxu/QhHvDR14wUXHRQbVY5ZOYpOGWRzhydZUqrLb2JBvLPY7cAqFmqrWuDED0Mjk7013SZiOz6Bw==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -12985,18 +12951,18 @@ } }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "shelljs": { @@ -13059,9 +13025,9 @@ "dev": true }, "slugify": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.5.tgz", - "integrity": "sha512-WpECLAgYaxHoEAJ8Q1Lo8HOs1ngn7LN7QjXgOLbmmfkcWvosyk4ZTXkTzKyhngK640USTZUlgoQJfED1kz5fnQ==" + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.6.tgz", + "integrity": "sha512-ZdJIgv9gdrYwhXqxsH9pv7nXxjUEyQ6nqhngRxoAAOlmMGA28FDq5O4/5US4G2/Nod7d1ovNcgURQJ7kHq50KQ==" }, "snapdragon": { "version": "0.8.2", @@ -13374,15 +13340,6 @@ } } }, - "sort-keys": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", - "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -13660,12 +13617,6 @@ } } }, - "strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", - "dev": true - }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -13804,12 +13755,12 @@ } }, "sugarss": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-3.0.1.tgz", - "integrity": "sha512-xW0tTjuJdd3VSsPH2dLgNDzESka1+Ul3GYVziyhX7GyXQboOARDaeEU++IjhOZPnoKoMENsU0tvtrCKr1sJwlw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-3.0.3.tgz", + "integrity": "sha512-uxa2bbuc+w7ov7DyYIhF6bM0qZF3UkFT5/nE8AJgboiVnKsBDbwxs++dehEIe1JNhpMaGJc37wGQ2QrrWey2Sg==", "dev": true, "requires": { - "postcss": "^8.1.0" + "postcss": "^8.1.6" } }, "supports-color": { @@ -14029,9 +13980,9 @@ "dev": true }, "terser": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.5.tgz", - "integrity": "sha512-Qw3CZAMmmfU824AoGKalx+riwocSI5Cs0PoGp9RdSLfmxkmJgyBxqLBP/isDNtFyhHnitikvRMZzyVgeq+U+Tg==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.4.0.tgz", + "integrity": "sha512-3dZunFLbCJis9TAF2VnX+VrQLctRUmt1p3W2kCsJuZE4ZgWqh//+1MZ62EanewrqKoUf4zIaDGZAvml4UDc0OQ==", "dev": true, "requires": { "commander": "^2.20.0", @@ -14078,9 +14029,9 @@ "dev": true }, "timers-browserify": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", - "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", "dev": true, "requires": { "setimmediate": "^1.0.4" @@ -14213,9 +14164,9 @@ "dev": true }, "ts-loader": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.5.tgz", - "integrity": "sha512-MvLXmjDxl2Mhv17nvkrB6BrpC8FTwSb7K38oIgdUI6BMx4XgVbljmcoOzlrYn4wyjNTFQ3utd7s2TyigJyR3YA==", + "version": "8.0.11", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.11.tgz", + "integrity": "sha512-06X+mWA2JXoXJHYAesUUL4mHFYhnmyoCdQVMXofXF552Lzd4wNwSGg7unJpttqUP7ziaruM8d7u8LUB6I1sgzA==", "dev": true, "requires": { "chalk": "^2.3.0", @@ -14685,9 +14636,9 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, "v8-compile-cache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, "validate-npm-package-license": { @@ -14724,14 +14675,14 @@ } }, "vis-data": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/vis-data/-/vis-data-7.1.0.tgz", - "integrity": "sha512-uWhBJD3NPlQqAWMYZ7P2WHtBeUrnt25vH6WiZwrwTbyv75g58WrzmxQmf1muRLyPeAydWRmuEC+ptGaKUtMKew==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/vis-data/-/vis-data-7.1.1.tgz", + "integrity": "sha512-Z5+caySDqoKL9yxbI3c/CKmUcSvROSZstuvwxbOsUpdxHpxFYEUgxC1EH4lSB1ykEaM54MVMM1UcwB9oNaWFlw==" }, "vis-network": { - "version": "8.3.3", - "resolved": "https://registry.npmjs.org/vis-network/-/vis-network-8.3.3.tgz", - "integrity": "sha512-zXSJnAZoOCzp4NQyT9I2w+h5tFy/pDzBcRKZ2BPPGzJGFGnvWQG812R768X59UltKWQlbYSOQ3BGV4Z6RYsheA==" + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/vis-network/-/vis-network-8.5.3.tgz", + "integrity": "sha512-6Lvu7hWjm7tJS5b+b/U0GVDx75QdlknRKmGwvVQosN4pc3HjzU3vXB+yXfqNHIxk5eQuWCQT+/GsE4GGF2BkDg==" }, "vis-util": { "version": "4.3.4", @@ -14756,21 +14707,21 @@ "integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==" }, "watchpack": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", - "integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", + "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", "dev": true, "requires": { "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.0" + "watchpack-chokidar2": "^2.0.1" } }, "watchpack-chokidar2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", - "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", + "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", "dev": true, "optional": true, "requires": { @@ -15544,6 +15495,27 @@ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -16392,9 +16364,9 @@ "dev": true }, "zone.js": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.11.1.tgz", - "integrity": "sha512-KcZawpmVgS+3U2rzKTM6fLKaCX1QDv3//NxiSOOsqpQY/r5hl+xpYikPwY93Sp7CAB+J5mZJpb/YubxEYLGK5g==", + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.11.3.tgz", + "integrity": "sha512-Y4hTHoh4VcxU5BDGAqEoOnOiyT254w6CiHtpQxAJUSMZPyVgdbKf+5R7Mwz6xsPhMIeBXk5rTopRZDpjssTCUg==", "requires": { "tslib": "^2.0.0" } diff --git a/frontend/package.json b/frontend/package.json index 776da8f6b..5e8227bee 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,75 +17,76 @@ "postinstall": "ngcc --properties esm5 browser module main --first-only --create-ivy-entry-points" }, "dependencies": { - "@angular/animations": "10.1.5", - "@angular/cdk": "10.2.4", - "@angular/common": "10.1.5", - "@angular/core": "10.1.5", - "@angular/forms": "10.1.5", - "@angular/localize": "10.1.5", - "@angular/platform-browser": "10.1.5", - "@angular/platform-browser-dynamic": "10.1.5", - "@angular/platform-server": "10.1.5", - "@angular/router": "10.1.5", + "@angular/animations": "11.0.0", + "@angular/cdk": "11.0.0", + "@angular/common": "11.0.0", + "@angular/core": "11.0.0", + "@angular/forms": "11.0.0", + "@angular/localize": "11.0.0", + "@angular/platform-browser": "11.0.0", + "@angular/platform-browser-dynamic": "11.0.0", + "@angular/platform-server": "11.0.0", + "@angular/router": "11.0.0", "@egjs/hammerjs": "2.0.17", "@types/codemirror": "0.0.98", "ace-builds": "1.4.12", - "angular-gridster2": "10.1.6", + "angular-gridster2": "10.1.7", "angular-mentions": "1.2.0", "angular2-chartjs": "0.5.1", "babel-polyfill": "6.26.0", "bootstrap": "4.5.3", - "core-js": "3.6.5", + "core-js": "3.7.0", "cropperjs": "2.0.0-alpha.1", "date-fns": "2.16.1", "font-awesome": "4.7.0", - "graphiql": "1.0.5", - "graphql": "15.3.0", + "graphiql": "1.0.6", + "graphql": "15.4.0", "image-focus": "1.1.2", "keycharm": "0.4.0", - "marked": "1.2.0", + "marked": "1.2.4", "mersenne-twister": "1.1.0", "mousetrap": "1.6.5", "ngx-color-picker": "10.1.0", "oidc-client": "1.10.1", - "pikaday": "1.8.0", + "pikaday": "1.8.2", "progressbar.js": "1.1.0", - "react": "16.13.1", - "react-dom": "16.13.1", + "prop-types": "^15.7.2", + "react": "17.0.1", + "react-dom": "17.0.1", "rxjs": "6.6.3", "simplemde": "1.11.2", - "slugify": "1.4.5", + "slugify": "1.4.6", "tinymce": "5.5.1", "tslib": "2.0.3", - "vis-data": "7.1.0", - "vis-network": "8.3.3", + "vis-data": "7.1.1", + "vis-network": "8.5.3", "vis-util": "4.3.4", - "zone.js": "0.11.1" + "zone.js": "0.11.3" }, "devDependencies": { - "@angular-devkit/build-optimizer": "0.1001.6", - "@angular/compiler": "10.1.5", - "@angular/compiler-cli": "10.1.5", - "@ngtools/webpack": "10.1.6", + "@angular-devkit/build-optimizer": "0.1100.1", + "@angular/compiler": "11.0.0", + "@angular/compiler-cli": "11.0.0", + "@ngtools/webpack": "11.0.1", "@types/core-js": "2.5.4", - "@types/jasmine": "3.5.14", + "@types/jasmine": "3.6.1", "@types/marked": "1.1.0", "@types/mersenne-twister": "1.1.2", "@types/mousetrap": "1.6.4", - "@types/node": "14.11.8", - "@types/react": "16.9.52", - "@types/react-dom": "16.9.8", + "@types/node": "14.14.7", + "@types/react": "16.9.56", + "@types/react-dom": "16.9.9", "@types/simplemde": "1.11.7", "@types/tinymce": "4.6.0", - "browserslist": "4.14.5", - "caniuse-lite": "1.0.30001148", - "circular-dependency-plugin": "5.2.0", + "browserslist": "4.14.7", + "caniuse-lite": "1.0.30001158", + "circular-dependency-plugin": "5.2.2", "codelyzer": "6.0.1", - "copy-webpack-plugin": "6.2.1", - "css-loader": "5.0.0", + "copy-webpack-plugin": "6.3.1", + "css-loader": "5.0.1", "cssnano": "4.1.10", - "entities": "2.0.3", - "file-loader": "6.1.1", + "entities": "2.1.0", + "file-loader": "6.2.0", "html-loader": "1.3.2", "html-webpack-plugin": "4.5.0", "ignore-loader": "0.1.2", @@ -101,10 +102,10 @@ "karma-mocha-reporter": "2.2.5", "karma-sourcemap-loader": "0.3.8", "karma-webpack": "4.0.2", - "mini-css-extract-plugin": "1.0.0", - "node-sass": "4.14.1", + "mini-css-extract-plugin": "1.3.1", + "node-sass": "5.0.0", "optimize-css-assets-webpack-plugin": "5.0.4", - "postcss-import": "12.0.1", + "postcss-import": "13.0.0", "postcss-loader": "4.0.4", "postcss-preset-env": "6.7.0", "raw-loader": "4.0.2", @@ -113,11 +114,11 @@ "rxjs-tslint": "0.1.8", "sass-lint": "1.13.1", "sass-lint-webpack": "1.0.3", - "sass-loader": "10.0.3", + "sass-loader": "10.1.0", "style-loader": "2.0.0", - "sugarss": "3.0.1", + "sugarss": "3.0.3", "terser-webpack-plugin": "4.2.3", - "ts-loader": "8.0.5", + "ts-loader": "8.0.11", "tsconfig-paths-webpack-plugin": "3.3.0", "tslint": "6.1.3", "tslint-immutable": "6.0.1",