Browse Source

Updated several packages and simplified code with roslyn analzer. (#838)

* Updated several packages and simplified code with roslyn analzer.

* Fix graphql.

* Fix tests.

* Fix GraphQL.
pull/840/head
Sebastian Stehle 4 years ago
committed by GitHub
parent
commit
cf94209847
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      backend/.editorconfig
  2. 1
      backend/extensions/Squidex.Extensions/Actions/Algolia/AlgoliaActionHandler.cs
  3. 2
      backend/extensions/Squidex.Extensions/Actions/AzureQueue/AzureQueueActionHandler.cs
  4. 2
      backend/extensions/Squidex.Extensions/Actions/Discourse/DiscourseActionHandler.cs
  5. 1
      backend/extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchActionHandler.cs
  6. 2
      backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs
  7. 2
      backend/extensions/Squidex.Extensions/Actions/Fastly/FastlyActionHandler.cs
  8. 2
      backend/extensions/Squidex.Extensions/Actions/Kafka/KafkaActionHandler.cs
  9. 2
      backend/extensions/Squidex.Extensions/Actions/Medium/MediumActionHandler.cs
  10. 2
      backend/extensions/Squidex.Extensions/Actions/Prerender/PrerenderActionHandler.cs
  11. 2
      backend/extensions/Squidex.Extensions/Actions/Script/ScriptActionHandler.cs
  12. 2
      backend/extensions/Squidex.Extensions/Actions/SignalR/SignalRAction.cs
  13. 2
      backend/extensions/Squidex.Extensions/Actions/SignalR/SignalRActionHandler.cs
  14. 2
      backend/extensions/Squidex.Extensions/Actions/Slack/SlackActionHandler.cs
  15. 2
      backend/extensions/Squidex.Extensions/Actions/Twitter/TweetActionHandler.cs
  16. 2
      backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs
  17. 2
      backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs
  18. 10
      backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj
  19. 8
      backend/extensions/Squidex.Extensions/Text/Azure/AzureTextIndex.cs
  20. 8
      backend/extensions/Squidex.Extensions/Text/ElasticSearch/ElasticSearchTextIndex.cs
  21. 2
      backend/src/Migrations/Migrations.csproj
  22. 8
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppClients.cs
  23. 6
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppContributors.cs
  24. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppImage.cs
  25. 10
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/LanguagesConfig.cs
  26. 6
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/Role.cs
  27. 4
      backend/src/Squidex.Domain.Apps.Core.Model/Apps/Roles.cs
  28. 4
      backend/src/Squidex.Domain.Apps.Core.Model/Contents/ContentData.cs
  29. 4
      backend/src/Squidex.Domain.Apps.Core.Model/Contents/GeoJsonValue.cs
  30. 8
      backend/src/Squidex.Domain.Apps.Core.Model/Contents/Workflows.cs
  31. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Named.cs
  32. 4
      backend/src/Squidex.Domain.Apps.Core.Model/Partitioning.cs
  33. 8
      backend/src/Squidex.Domain.Apps.Core.Model/Rules/Rule.cs
  34. 4
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldBase.cs
  35. 8
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldCollection.cs
  36. 4
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldRule.cs
  37. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/NestedField{T}.cs
  38. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/RootField.cs
  39. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/RootField{T}.cs
  40. 4
      backend/src/Squidex.Domain.Apps.Core.Model/Schemas/Schema.cs
  41. 3
      backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj
  42. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/ContentConverter.cs
  43. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/FieldConverters.cs
  44. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/StringFormatter.cs
  45. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/ValueConverters.cs
  46. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/DefaultValues/DefaultValueExtensions.cs
  47. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/DefaultValues/DefaultValueFactory.cs
  48. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/EventSynchronization/SchemaSynchronizer.cs
  49. 20
      backend/src/Squidex.Domain.Apps.Core.Operations/ExtractReferenceIds/ContentReferencesExtensions.cs
  50. 6
      backend/src/Squidex.Domain.Apps.Core.Operations/GenerateFilters/FilterExtensions.cs
  51. 14
      backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonSchemaExtensions.cs
  52. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventJsonSchemaGenerator.cs
  53. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleActionRegistration.cs
  54. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/IScriptDescriptor.cs
  55. 12
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/JintScriptEngine.cs
  56. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptContext.cs
  57. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingCompleter.cs
  58. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/WritableContext.cs
  59. 7
      backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj
  60. 10
      backend/src/Squidex.Domain.Apps.Core.Operations/Tags/TagNormalizer.cs
  61. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/Templates/FluidTemplateEngine.cs
  62. 14
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ContentValidator.cs
  63. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/IValidator.cs
  64. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/IValidatorsFactory.cs
  65. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/JsonValueConverter.cs
  66. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/JsonValueValidator.cs
  67. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/AllowedValuesValidator.cs
  68. 6
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/AssetsValidator.cs
  69. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/CollectionItemValidator.cs
  70. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/FieldValidator.cs
  71. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/PatternValidator.cs
  72. 6
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/ReferencesValidator.cs
  73. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/UniqueValidator.cs
  74. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetFolderRepository_SnapshotStore.cs
  75. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository_SnapshotStore.cs
  76. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository_SnapshotStore.cs
  77. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryById.cs
  78. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryByIds.cs
  79. 12
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryByQuery.cs
  80. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryScheduled.cs
  81. 4
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs
  82. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Schemas/MongoSchemasHash.cs
  83. 2
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Squidex.Domain.Apps.Entities.MongoDb.csproj
  84. 4
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Text/AtlasTextIndex.cs
  85. 8
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Text/MongoTextIndexBase.cs
  86. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettingsGrain.cs
  87. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppLogStore.cs
  88. 14
      backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardApp.cs
  89. 6
      backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppClients.cs
  90. 4
      backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppContributors.cs
  91. 6
      backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppLanguages.cs
  92. 6
      backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppRoles.cs
  93. 6
      backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppWorkflows.cs
  94. 4
      backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/ConfigAppPlansProvider.cs
  95. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/RedirectToCheckoutResult.cs
  96. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageGate.cs
  97. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs
  98. 2
      backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs
  99. 4
      backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsJintExtension.cs
  100. 4
      backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetCommandMiddleware.cs

3
backend/.editorconfig

@ -85,9 +85,6 @@ dotnet_diagnostic.MA0038.severity = none
# MA0039: Do not write your own certificate validation method
dotnet_diagnostic.MA0039.severity = none
# MA0048: File name must match type name
dotnet_diagnostic.MA0048.severity = none
# MA0049: Type name should not match containing namespace
dotnet_diagnostic.MA0049.severity = none

1
backend/extensions/Squidex.Extensions/Actions/Algolia/AlgoliaActionHandler.cs

@ -13,6 +13,7 @@ using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
using Squidex.Domain.Apps.Core.Scripting;
#pragma warning disable IDE0059 // Value assigned to symbol is never used
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Algolia
{

2
backend/extensions/Squidex.Extensions/Actions/AzureQueue/AzureQueueActionHandler.cs

@ -10,6 +10,8 @@ using Microsoft.WindowsAzure.Storage.Queue;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.AzureQueue
{
public sealed class AzureQueueActionHandler : RuleActionHandler<AzureQueueAction, AzureQueueJob>

2
backend/extensions/Squidex.Extensions/Actions/Discourse/DiscourseActionHandler.cs

@ -9,6 +9,8 @@ using System.Text;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Discourse
{
public sealed class DiscourseActionHandler : RuleActionHandler<DiscourseAction, DiscourseJob>

1
backend/extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchActionHandler.cs

@ -12,6 +12,7 @@ using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
using Squidex.Domain.Apps.Core.Scripting;
#pragma warning disable IDE0059 // Value assigned to symbol is never used
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.ElasticSearch
{

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

@ -11,6 +11,8 @@ using MimeKit.Text;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Email
{
public sealed class EmailActionHandler : RuleActionHandler<EmailAction, EmailJob>

2
backend/extensions/Squidex.Extensions/Actions/Fastly/FastlyActionHandler.cs

@ -9,6 +9,8 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
using Squidex.Infrastructure;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Fastly
{
public sealed class FastlyActionHandler : RuleActionHandler<FastlyAction, FastlyJob>

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

@ -8,6 +8,8 @@
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Kafka
{
public sealed class KafkaActionHandler : RuleActionHandler<KafkaAction, KafkaJob>

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

@ -11,6 +11,8 @@ using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
using Squidex.Infrastructure.Http;
using Squidex.Infrastructure.Json;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Medium
{
public sealed class MediumActionHandler : RuleActionHandler<MediumAction, MediumJob>

2
backend/extensions/Squidex.Extensions/Actions/Prerender/PrerenderActionHandler.cs

@ -9,6 +9,8 @@ using System.Text;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Prerender
{
public sealed class PrerenderActionHandler : RuleActionHandler<PrerenderAction, PrerenderJob>

2
backend/extensions/Squidex.Extensions/Actions/Script/ScriptActionHandler.cs

@ -9,6 +9,8 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
using Squidex.Domain.Apps.Core.Scripting;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Script
{
public sealed class ScriptActionHandler : RuleActionHandler<ScriptAction, ScriptJob>

2
backend/extensions/Squidex.Extensions/Actions/SignalR/SignalRAction.cs

@ -11,6 +11,8 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure.Validation;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.SignalR
{
[RuleAction(

2
backend/extensions/Squidex.Extensions/Actions/SignalR/SignalRActionHandler.cs

@ -10,6 +10,8 @@ using Microsoft.Azure.SignalR.Management;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.SignalR
{
public sealed class SignalRActionHandler : RuleActionHandler<SignalRAction, SignalRJob>

2
backend/extensions/Squidex.Extensions/Actions/Slack/SlackActionHandler.cs

@ -9,6 +9,8 @@ using System.Text;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Slack
{
public sealed class SlackActionHandler : RuleActionHandler<SlackAction, SlackJob>

2
backend/extensions/Squidex.Extensions/Actions/Twitter/TweetActionHandler.cs

@ -10,6 +10,8 @@ using Microsoft.Extensions.Options;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Twitter
{
public sealed class TweetActionHandler : RuleActionHandler<TweetAction, TweetJob>

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

@ -10,6 +10,8 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure.Validation;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Webhook
{
[RuleAction(

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

@ -10,6 +10,8 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
using Squidex.Infrastructure;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Extensions.Actions.Webhook
{
public sealed class WebhookActionHandler : RuleActionHandler<WebhookAction, WebhookJob>

10
backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj

@ -15,18 +15,18 @@
<PackageReference Include="Confluent.Kafka" Version="1.8.2" />
<PackageReference Include="Confluent.SchemaRegistry.Serdes" Version="1.3.0" />
<PackageReference Include="CoreTweet" Version="1.0.0.483" />
<PackageReference Include="Elasticsearch.Net" Version="7.16.0" />
<PackageReference Include="Google.Cloud.Diagnostics.Common" Version="4.3.1" />
<PackageReference Include="Elasticsearch.Net" Version="7.17.0" />
<PackageReference Include="Google.Cloud.Diagnostics.Common" Version="4.4.0" />
<PackageReference Include="Google.Cloud.Logging.V2" Version="3.4.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
<PackageReference Include="Meziantou.Analyzer" Version="1.0.689">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Azure.CognitiveServices.Vision.ComputerVision" Version="7.0.1" />
<PackageReference Include="Microsoft.Azure.SignalR.Management" Version="1.13.0" />
<PackageReference Include="Microsoft.Azure.SignalR.Management" Version="1.15.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.OData.Core" Version="7.9.4" />
<PackageReference Include="Microsoft.OData.Core" Version="7.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NodaTime" Version="3.0.9" />
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.0.0-beta.3" />

8
backend/extensions/Squidex.Extensions/Text/Azure/AzureTextIndex.cs

@ -73,8 +73,8 @@ namespace Squidex.Extensions.Text.Azure
public async Task<List<DomainId>> SearchAsync(IAppEntity app, GeoQuery query, SearchScope scope,
CancellationToken ct = default)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(query, nameof(query));
Guard.NotNull(app);
Guard.NotNull(query);
var result = new List<(DomainId Id, double Score)>();
@ -86,8 +86,8 @@ namespace Squidex.Extensions.Text.Azure
public async Task<List<DomainId>> SearchAsync(IAppEntity app, TextQuery query, SearchScope scope,
CancellationToken ct = default)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(query, nameof(query));
Guard.NotNull(app);
Guard.NotNull(query);
var parsed = queryParser.Parse(query.Text);

8
backend/extensions/Squidex.Extensions/Text/ElasticSearch/ElasticSearchTextIndex.cs

@ -71,8 +71,8 @@ namespace Squidex.Extensions.Text.ElasticSearch
public async Task<List<DomainId>> SearchAsync(IAppEntity app, GeoQuery query, SearchScope scope,
CancellationToken ct = default)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(query, nameof(query));
Guard.NotNull(app);
Guard.NotNull(query);
var serveField = GetServeField(scope);
@ -133,8 +133,8 @@ namespace Squidex.Extensions.Text.ElasticSearch
public async Task<List<DomainId>> SearchAsync(IAppEntity app, TextQuery query, SearchScope scope,
CancellationToken ct = default)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(query, nameof(query));
Guard.NotNull(app);
Guard.NotNull(query);
var parsed = queryParser.Parse(query.Text);

2
backend/src/Migrations/Migrations.csproj

@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
<PackageReference Include="Meziantou.Analyzer" Version="1.0.689">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

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

@ -27,7 +27,7 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public AppClients Revoke(string id)
{
Guard.NotNullOrEmpty(id, nameof(id));
Guard.NotNullOrEmpty(id);
if (!this.TryRemove(id, out var updated))
{
@ -40,8 +40,8 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public AppClients Add(string id, string secret, string? role = null)
{
Guard.NotNullOrEmpty(id, nameof(id));
Guard.NotNullOrEmpty(secret, nameof(secret));
Guard.NotNullOrEmpty(id);
Guard.NotNullOrEmpty(secret);
var newClient = new AppClient(id, secret)
{
@ -62,7 +62,7 @@ namespace Squidex.Domain.Apps.Core.Apps
long? apiTrafficLimit = null,
bool? allowAnonymous = false)
{
Guard.NotNullOrEmpty(id, nameof(id));
Guard.NotNullOrEmpty(id);
if (!TryGetValue(id, out var client))
{

6
backend/src/Squidex.Domain.Apps.Core.Model/Apps/AppContributors.cs

@ -27,8 +27,8 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public AppContributors Assign(string contributorId, string role)
{
Guard.NotNullOrEmpty(contributorId, nameof(contributorId));
Guard.NotNullOrEmpty(role, nameof(role));
Guard.NotNullOrEmpty(contributorId);
Guard.NotNullOrEmpty(role);
if (!this.TrySet(contributorId, role, out var updated))
{
@ -41,7 +41,7 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public AppContributors Remove(string contributorId)
{
Guard.NotNullOrEmpty(contributorId, nameof(contributorId));
Guard.NotNullOrEmpty(contributorId);
if (!this.TryRemove(contributorId, out var updated))
{

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

@ -17,7 +17,7 @@ namespace Squidex.Domain.Apps.Core.Apps
public AppImage(string mimeType, string? etag = null)
{
Guard.NotNullOrEmpty(mimeType, nameof(mimeType));
Guard.NotNullOrEmpty(mimeType);
MimeType = mimeType;

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

@ -40,8 +40,8 @@ namespace Squidex.Domain.Apps.Core.Apps
public LanguagesConfig(Dictionary<string, LanguageConfig> languages, string master)
{
Guard.NotNull(languages, nameof(languages));
Guard.NotNullOrEmpty(master, nameof(master));
Guard.NotNull(languages);
Guard.NotNullOrEmpty(master);
Cleanup(languages, ref master);
@ -53,7 +53,7 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public LanguagesConfig MakeMaster(Language language)
{
Guard.NotNull(language, nameof(language));
Guard.NotNull(language);
return Build(languages, language);
}
@ -61,7 +61,7 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public LanguagesConfig Set(Language language, bool isOptional = false, params Language[]? fallbacks)
{
Guard.NotNull(language, nameof(language));
Guard.NotNull(language);
var newLanguages = new Dictionary<string, LanguageConfig>(languages)
{
@ -74,7 +74,7 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public LanguagesConfig Remove(Language language)
{
Guard.NotNull(language, nameof(language));
Guard.NotNull(language);
var newLanguages = new Dictionary<string, LanguageConfig>(languages);

6
backend/src/Squidex.Domain.Apps.Core.Model/Apps/Role.cs

@ -45,8 +45,8 @@ namespace Squidex.Domain.Apps.Core.Apps
public Role(string name, PermissionSet permissions, JsonObject properties)
: base(name)
{
Guard.NotNull(permissions, nameof(permissions));
Guard.NotNull(properties, nameof(properties));
Guard.NotNull(permissions);
Guard.NotNull(properties);
Permissions = permissions;
Properties = properties;
@ -80,7 +80,7 @@ namespace Squidex.Domain.Apps.Core.Apps
public Role ForApp(string app, bool isFrontend = false)
{
Guard.NotNullOrEmpty(app, nameof(app));
Guard.NotNullOrEmpty(app);
var result = new HashSet<Permission>();

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

@ -118,7 +118,7 @@ namespace Squidex.Domain.Apps.Core.Apps
[Pure]
public Roles Update(string name, PermissionSet? permissions = null, JsonObject? properties = null)
{
Guard.NotNullOrEmpty(name, nameof(name));
Guard.NotNullOrEmpty(name);
if (!inner.TryGetValue(name, out var role))
{
@ -157,7 +157,7 @@ namespace Squidex.Domain.Apps.Core.Apps
public bool TryGet(string app, string name, bool isFrontend, [MaybeNullWhen(false)] out Role value)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(app);
value = null!;

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

@ -28,7 +28,7 @@ namespace Squidex.Domain.Apps.Core.Contents
public ContentData AddField(string name, ContentFieldData? data)
{
Guard.NotNullOrEmpty(name, nameof(name));
Guard.NotNullOrEmpty(name);
this[name] = data;
@ -80,7 +80,7 @@ namespace Squidex.Domain.Apps.Core.Contents
private static ContentData MergeTo(ContentData target, params ContentData[] sources)
{
Guard.NotEmpty(sources, nameof(sources));
Guard.NotEmpty(sources);
if (sources.Length == 1 || sources.Skip(1).All(x => ReferenceEquals(x, sources[0])))
{

4
backend/src/Squidex.Domain.Apps.Core.Model/Contents/GeoJsonValue.cs

@ -19,8 +19,8 @@ namespace Squidex.Domain.Apps.Core.Contents
{
public static GeoJsonParseResult TryParse(IJsonValue value, IJsonSerializer serializer, out GeoJSONObject? geoJSON)
{
Guard.NotNull(serializer, nameof(serializer));
Guard.NotNull(value, nameof(value));
Guard.NotNull(serializer);
Guard.NotNull(value);
geoJSON = null;

8
backend/src/Squidex.Domain.Apps.Core.Model/Contents/Workflows.cs

@ -38,7 +38,7 @@ namespace Squidex.Domain.Apps.Core.Contents
[Pure]
public Workflows Add(DomainId workflowId, string name)
{
Guard.NotNullOrEmpty(name, nameof(name));
Guard.NotNullOrEmpty(name);
if (!this.TryAdd(workflowId, Workflow.CreateDefault(name), out var updated))
{
@ -51,7 +51,7 @@ namespace Squidex.Domain.Apps.Core.Contents
[Pure]
public Workflows Set(Workflow workflow)
{
Guard.NotNull(workflow, nameof(workflow));
Guard.NotNull(workflow);
if (!this.TrySet(default, workflow, out var updated))
{
@ -64,7 +64,7 @@ namespace Squidex.Domain.Apps.Core.Contents
[Pure]
public Workflows Set(DomainId id, Workflow workflow)
{
Guard.NotNull(workflow, nameof(workflow));
Guard.NotNull(workflow);
if (!this.TrySet(id, workflow, out var updated))
{
@ -77,7 +77,7 @@ namespace Squidex.Domain.Apps.Core.Contents
[Pure]
public Workflows Update(DomainId id, Workflow workflow)
{
Guard.NotNull(workflow, nameof(workflow));
Guard.NotNull(workflow);
if (id == DomainId.Empty)
{

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

@ -15,7 +15,7 @@ namespace Squidex.Domain.Apps.Core
protected Named(string name)
{
Guard.NotNullOrEmpty(name, nameof(name));
Guard.NotNullOrEmpty(name);
Name = name;
}

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

@ -7,6 +7,8 @@
using Squidex.Infrastructure;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core
{
public delegate IFieldPartitioning PartitionResolver(Partitioning key);
@ -20,7 +22,7 @@ namespace Squidex.Domain.Apps.Core
public Partitioning(string key)
{
Guard.NotNullOrEmpty(key, nameof(key));
Guard.NotNullOrEmpty(key);
Key = key;
}

8
backend/src/Squidex.Domain.Apps.Core.Model/Rules/Rule.cs

@ -22,8 +22,8 @@ namespace Squidex.Domain.Apps.Core.Rules
public Rule(RuleTrigger trigger, RuleAction action)
{
Guard.NotNull(trigger, nameof(trigger));
Guard.NotNull(action, nameof(action));
Guard.NotNull(trigger);
Guard.NotNull(action);
Action = action;
@ -75,7 +75,7 @@ namespace Squidex.Domain.Apps.Core.Rules
[Pure]
public Rule Update(RuleTrigger newTrigger)
{
Guard.NotNull(newTrigger, nameof(newTrigger));
Guard.NotNull(newTrigger);
if (newTrigger.GetType() != Trigger.GetType())
{
@ -96,7 +96,7 @@ namespace Squidex.Domain.Apps.Core.Rules
[Pure]
public Rule Update(RuleAction newAction)
{
Guard.NotNull(newAction, nameof(newAction));
Guard.NotNull(newAction);
if (newAction.GetType() != Action.GetType())
{

4
backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldBase.cs

@ -17,8 +17,8 @@ namespace Squidex.Domain.Apps.Core.Schemas
protected FieldBase(long id, string name)
{
Guard.NotNullOrEmpty(name, nameof(name));
Guard.GreaterThan(id, 0, nameof(id));
Guard.NotNullOrEmpty(name);
Guard.GreaterThan(id, 0);
Id = id;

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

@ -73,7 +73,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
public FieldCollection(T[] fields)
{
Guard.NotNull(fields, nameof(fields));
Guard.NotNull(fields);
fieldsOrdered = fields;
}
@ -97,7 +97,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
[Pure]
public FieldCollection<T> Reorder(List<long> ids)
{
Guard.NotNull(ids, nameof(ids));
Guard.NotNull(ids);
if (ids.Count != fieldsOrdered.Length || ids.Any(x => !ById.ContainsKey(x)))
{
@ -115,7 +115,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
[Pure]
public FieldCollection<T> Add(T field)
{
Guard.NotNull(field, nameof(field));
Guard.NotNull(field);
if (ByName.ContainsKey(field.Name))
{
@ -133,7 +133,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
[Pure]
public FieldCollection<T> Update(long fieldId, Func<T, T> updater)
{
Guard.NotNull(updater, nameof(updater));
Guard.NotNull(updater);
if (!ById.TryGetValue(fieldId, out var field))
{

4
backend/src/Squidex.Domain.Apps.Core.Model/Schemas/FieldRule.cs

@ -19,8 +19,8 @@ namespace Squidex.Domain.Apps.Core.Schemas
public FieldRule(FieldRuleAction action, string field)
{
Guard.Enum(action, nameof(action));
Guard.NotNullOrEmpty(field, nameof(field));
Guard.Enum(action);
Guard.NotNullOrEmpty(field);
Action = action;

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

@ -43,7 +43,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
private static T ValidateProperties(FieldProperties newProperties)
{
Guard.NotNull(newProperties, nameof(newProperties));
Guard.NotNull(newProperties);
if (newProperties is not T typedProperties)
{

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

@ -25,7 +25,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
protected RootField(long id, string name, Partitioning partitioning, IFieldSettings? settings = null)
: base(id, name)
{
Guard.NotNull(partitioning, nameof(partitioning));
Guard.NotNull(partitioning);
Partitioning = partitioning;

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

@ -43,7 +43,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
private static T ValidateProperties(FieldProperties newProperties)
{
Guard.NotNull(newProperties, nameof(newProperties));
Guard.NotNull(newProperties);
if (newProperties is not T typedProperties)
{

4
backend/src/Squidex.Domain.Apps.Core.Model/Schemas/Schema.cs

@ -52,7 +52,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
public Schema(string name, SchemaProperties? properties = null, SchemaType type = SchemaType.Default)
{
Guard.NotNullOrEmpty(name, nameof(name));
Guard.NotNullOrEmpty(name);
Name = name;
@ -67,7 +67,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
public Schema(string name, RootField[] fields, SchemaProperties? properties, bool isPublished = false, SchemaType type = SchemaType.Default)
: this(name, properties, type)
{
Guard.NotNull(fields, nameof(fields));
Guard.NotNull(fields);
FieldCollection = new FieldCollection<RootField>(fields);

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

@ -4,6 +4,7 @@
<RootNamespace>Squidex.Domain.Apps.Core</RootNamespace>
<LangVersion>10.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<NeutralLanguage>en</NeutralLanguage>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -11,7 +12,7 @@
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
<PackageReference Include="Meziantou.Analyzer" Version="1.0.689">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

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

@ -15,7 +15,7 @@ namespace Squidex.Domain.Apps.Core.ConvertContent
{
public static ContentData Convert(this ContentData content, Schema schema, params FieldConverter[] converters)
{
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(schema);
var result = new ContentData(content.Count);

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

@ -13,6 +13,8 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.Json;
using Squidex.Infrastructure.Json.Objects;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.ConvertContent
{
public delegate ContentFieldData? FieldConverter(ContentFieldData data, IRootField field);

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

@ -25,7 +25,7 @@ namespace Squidex.Domain.Apps.Core.ConvertContent
public static string Format(IField field, IJsonValue? value)
{
Guard.NotNull(field, nameof(field));
Guard.NotNull(field);
if (value == null || value is JsonNull)
{

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

@ -11,6 +11,8 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.Json;
using Squidex.Infrastructure.Json.Objects;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.ConvertContent
{
public delegate IJsonValue? ValueConverter(IJsonValue value, IField field, IArrayField? parent);

4
backend/src/Squidex.Domain.Apps.Core.Operations/DefaultValues/DefaultValueExtensions.cs

@ -17,8 +17,8 @@ namespace Squidex.Domain.Apps.Core.DefaultValues
{
public static void GenerateDefaultValues(this ContentData data, Schema schema, PartitionResolver partitionResolver)
{
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(partitionResolver, nameof(partitionResolver));
Guard.NotNull(schema);
Guard.NotNull(partitionResolver);
foreach (var field in schema.Fields)
{

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

@ -27,8 +27,8 @@ namespace Squidex.Domain.Apps.Core.DefaultValues
public static IJsonValue CreateDefaultValue(IField field, Instant now, string partition)
{
Guard.NotNull(field, nameof(field));
Guard.NotNull(partition, nameof(partition));
Guard.NotNull(field);
Guard.NotNull(partition);
return field.RawProperties.Accept(Instance, new Args(now, partition));
}

4
backend/src/Squidex.Domain.Apps.Core.Operations/EventSynchronization/SchemaSynchronizer.cs

@ -17,8 +17,8 @@ namespace Squidex.Domain.Apps.Core.EventSynchronization
public static IEnumerable<SchemaEvent> Synchronize(this Schema source, Schema? target, Func<long> idGenerator,
SchemaSynchronizationOptions? options = null)
{
Guard.NotNull(source, nameof(source));
Guard.NotNull(idGenerator, nameof(idGenerator));
Guard.NotNull(source);
Guard.NotNull(idGenerator);
if (target == null)
{

20
backend/src/Squidex.Domain.Apps.Core.Operations/ExtractReferenceIds/ContentReferencesExtensions.cs

@ -49,7 +49,7 @@ namespace Squidex.Domain.Apps.Core.ExtractReferenceIds
public static HashSet<DomainId> GetReferencedIds(this ContentData source, Schema schema,
ResolvedComponents components, int referencesPerField = int.MaxValue)
{
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(schema);
var ids = new HashSet<DomainId>();
@ -61,7 +61,7 @@ namespace Squidex.Domain.Apps.Core.ExtractReferenceIds
public static void AddReferencedIds(this ContentData source, Schema schema, HashSet<DomainId> result,
ResolvedComponents components, int referencesPerField = int.MaxValue)
{
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(schema);
AddReferencedIds(source, schema.Fields, result, components, referencesPerField);
}
@ -69,9 +69,9 @@ namespace Squidex.Domain.Apps.Core.ExtractReferenceIds
public static void AddReferencedIds(this ContentData source, IEnumerable<IField> fields, HashSet<DomainId> result,
ResolvedComponents components, int referencesPerField = int.MaxValue)
{
Guard.NotNull(fields, nameof(fields));
Guard.NotNull(result, nameof(result));
Guard.NotNull(components, nameof(components));
Guard.NotNull(fields);
Guard.NotNull(result);
Guard.NotNull(components);
foreach (var field in fields)
{
@ -82,7 +82,7 @@ namespace Squidex.Domain.Apps.Core.ExtractReferenceIds
private static void AddReferencedIds(IField field, ContentData source, HashSet<DomainId> result,
ResolvedComponents components, int referencesPerField = int.MaxValue)
{
Guard.NotNull(components, nameof(components));
Guard.NotNull(components);
if (source.TryGetValue(field.Name, out var fieldData) && fieldData != null)
{
@ -96,7 +96,7 @@ namespace Squidex.Domain.Apps.Core.ExtractReferenceIds
public static HashSet<DomainId> GetReferencedIds(this IField field, IJsonValue? value,
ResolvedComponents components, int referencesPerField = int.MaxValue)
{
Guard.NotNull(components, nameof(components));
Guard.NotNull(components);
var result = new HashSet<DomainId>();
@ -110,8 +110,8 @@ namespace Squidex.Domain.Apps.Core.ExtractReferenceIds
public static JsonObject FormatReferences(this ContentData data, Schema schema, IFieldPartitioning partitioning, string separator = ", ")
{
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(partitioning, nameof(partitioning));
Guard.NotNull(schema);
Guard.NotNull(partitioning);
var result = JsonValue.Object();
@ -125,7 +125,7 @@ namespace Squidex.Domain.Apps.Core.ExtractReferenceIds
private static string FormatReferenceFields(this ContentData data, Schema schema, string partitionKey, string separator)
{
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(schema);
var sb = new StringBuilder();

6
backend/src/Squidex.Domain.Apps.Core.Operations/GenerateFilters/FilterExtensions.cs

@ -13,13 +13,13 @@ using Squidex.Infrastructure.Queries;
namespace Squidex.Domain.Apps.Core.GenerateFilters
{
public static class JsonSchemaExtensions
public static class FilterExtensions
{
public static FilterSchema BuildDataSchema(this Schema schema, PartitionResolver partitionResolver,
ResolvedComponents components)
{
Guard.NotNull(partitionResolver, nameof(partitionResolver));
Guard.NotNull(components, nameof(components));
Guard.NotNull(partitionResolver);
Guard.NotNull(components);
var fields = new List<FilterField>();

14
backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonSchemaExtensions.cs

@ -10,6 +10,8 @@ using Squidex.Domain.Apps.Core.Schemas;
using Squidex.Infrastructure;
using Squidex.Text;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
{
public delegate (JsonSchema Reference, JsonSchema? Actual) JsonTypeFactory(string name);
@ -29,8 +31,8 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
bool withHidden = false,
bool withComponents = false)
{
Guard.NotNull(partitionResolver, nameof(partitionResolver));
Guard.NotNull(components, nameof(components));
Guard.NotNull(partitionResolver);
Guard.NotNull(components);
factory ??= DefaultFactory;
@ -64,8 +66,8 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
bool withHidden = false,
bool withComponents = false)
{
Guard.NotNull(partitionResolver, nameof(partitionResolver));
Guard.NotNull(components, nameof(components));
Guard.NotNull(partitionResolver);
Guard.NotNull(components);
factory ??= DefaultFactory;
@ -102,8 +104,8 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
bool withHidden = false,
bool withComponents = false)
{
Guard.NotNull(partitionResolver, nameof(partitionResolver));
Guard.NotNull(components, nameof(components));
Guard.NotNull(partitionResolver);
Guard.NotNull(components);
factory ??= DefaultFactory;

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

@ -31,7 +31,7 @@ namespace Squidex.Domain.Apps.Core.HandleRules
public JsonSchema? GetSchema(string typeName)
{
Guard.NotNull(typeName, nameof(typeName));
Guard.NotNull(typeName);
return schemas.Value.GetOrDefault(typeName);
}

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

@ -15,7 +15,7 @@ namespace Squidex.Domain.Apps.Core.HandleRules
internal RuleActionRegistration(Type actionType)
{
Guard.NotNull(actionType, nameof(actionType));
Guard.NotNull(actionType);
ActionType = actionType;
}

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

@ -5,6 +5,8 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.Scripting
{
public delegate void AddDescription(JsonType type, string name, string description);

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

@ -42,8 +42,8 @@ namespace Squidex.Domain.Apps.Core.Scripting
public async Task<IJsonValue> ExecuteAsync(ScriptVars vars, string script, ScriptOptions options = default,
CancellationToken ct = default)
{
Guard.NotNull(vars, nameof(vars));
Guard.NotNullOrEmpty(script, nameof(script));
Guard.NotNull(vars);
Guard.NotNullOrEmpty(script);
using (var cts = new CancellationTokenSource(timeoutExecution))
{
@ -80,8 +80,8 @@ namespace Squidex.Domain.Apps.Core.Scripting
public async Task<ContentData> TransformAsync(ScriptVars vars, string script, ScriptOptions options = default,
CancellationToken ct = default)
{
Guard.NotNull(vars, nameof(vars));
Guard.NotNullOrEmpty(script, nameof(script));
Guard.NotNull(vars);
Guard.NotNullOrEmpty(script);
using (var cts = new CancellationTokenSource(timeoutExecution))
{
@ -137,8 +137,8 @@ namespace Squidex.Domain.Apps.Core.Scripting
public IJsonValue Execute(ScriptVars vars, string script, ScriptOptions options = default)
{
Guard.NotNull(vars, nameof(vars));
Guard.NotNullOrEmpty(script, nameof(script));
Guard.NotNull(vars);
Guard.NotNullOrEmpty(script);
var context =
CreateEngine(options)

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

@ -24,7 +24,7 @@ namespace Squidex.Domain.Apps.Core.Scripting
public bool TryGetValue<T>(string key, [MaybeNullWhen(false)] out T value)
{
Guard.NotNull(key, nameof(key));
Guard.NotNull(key);
value = default!;

4
backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptingCompleter.cs

@ -21,14 +21,14 @@ namespace Squidex.Domain.Apps.Core.Scripting
public IReadOnlyList<ScriptingValue> ContentScript(FilterSchema dataSchema)
{
Guard.NotNull(dataSchema, nameof(dataSchema));
Guard.NotNull(dataSchema);
return new Process(descriptors).Content(dataSchema, ScriptScope.ContentScript | ScriptScope.Transform);
}
public IReadOnlyList<ScriptingValue> ContentTrigger(FilterSchema dataSchema)
{
Guard.NotNull(dataSchema, nameof(dataSchema));
Guard.NotNull(dataSchema);
return new Process(descriptors).Content(dataSchema, ScriptScope.ContentTrigger);
}

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

@ -12,7 +12,7 @@ using Squidex.Text;
namespace Squidex.Domain.Apps.Core.Scripting
{
internal class WritableContext : ObjectInstance
internal sealed class WritableContext : ObjectInstance
{
private readonly ScriptVars vars;

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

@ -4,6 +4,7 @@
<RootNamespace>Squidex.Domain.Apps.Core</RootNamespace>
<LangVersion>10.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<NeutralLanguage>en</NeutralLanguage>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -20,16 +21,16 @@
<PackageReference Include="Fluid.Core.Squidex" Version="1.0.0-beta" />
<PackageReference Include="GeoJSON.Net" Version="1.2.19" />
<PackageReference Include="Jint" Version="3.0.0-beta-2036" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
<PackageReference Include="Meziantou.Analyzer" Version="1.0.689">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="NJsonSchema" Version="10.6.6" />
<PackageReference Include="NJsonSchema" Version="10.6.7" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Version="6.0.0" />
<PackageReference Include="System.Linq.Async" Version="5.1.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="ValueTaskSupplement" Version="1.1.0" />
</ItemGroup>
<ItemGroup>

10
backend/src/Squidex.Domain.Apps.Core.Operations/Tags/TagNormalizer.cs

@ -16,9 +16,9 @@ namespace Squidex.Domain.Apps.Core.Tags
{
public static async Task NormalizeAsync(this ITagService tagService, DomainId appId, DomainId schemaId, Schema schema, ContentData newData, ContentData? oldData)
{
Guard.NotNull(tagService, nameof(tagService));
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(newData, nameof(newData));
Guard.NotNull(tagService);
Guard.NotNull(schema);
Guard.NotNull(newData);
var newValues = new HashSet<string>();
var newArrays = new List<JsonArray>();
@ -52,8 +52,8 @@ namespace Squidex.Domain.Apps.Core.Tags
public static async Task DenormalizeAsync(this ITagService tagService, DomainId appId, DomainId schemaId, Schema schema, params ContentData[] datas)
{
Guard.NotNull(tagService, nameof(tagService));
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(tagService);
Guard.NotNull(schema);
var tagsValues = new HashSet<string>();
var tagsArrays = new List<JsonArray>();

2
backend/src/Squidex.Domain.Apps.Core.Operations/Templates/FluidTemplateEngine.cs

@ -61,7 +61,7 @@ namespace Squidex.Domain.Apps.Core.Templates
public async Task<string> RenderAsync(string template, TemplateVars variables)
{
Guard.NotNull(variables, nameof(variables));
Guard.NotNull(variables);
if (SquidexTemplate.TryParse(template, out var parsed, out var errors))
{

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

@ -31,10 +31,10 @@ namespace Squidex.Domain.Apps.Core.ValidateContent
public ContentValidator(PartitionResolver partitionResolver, ValidationContext context, IEnumerable<IValidatorsFactory> factories, ISemanticLog log)
{
Guard.NotNull(context, nameof(context));
Guard.NotNull(factories, nameof(factories));
Guard.NotNull(partitionResolver, nameof(partitionResolver));
Guard.NotNull(log, nameof(log));
Guard.NotNull(context);
Guard.NotNull(factories);
Guard.NotNull(partitionResolver);
Guard.NotNull(log);
this.context = context;
this.factories = factories;
@ -52,7 +52,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent
public ValueTask ValidateInputPartialAsync(ContentData data)
{
Guard.NotNull(data, nameof(data));
Guard.NotNull(data);
var validator = CreateSchemaValidator(true);
@ -61,7 +61,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent
public ValueTask ValidateInputAsync(ContentData data)
{
Guard.NotNull(data, nameof(data));
Guard.NotNull(data);
var validator = CreateSchemaValidator(false);
@ -70,7 +70,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent
public ValueTask ValidateContentAsync(ContentData data)
{
Guard.NotNull(data, nameof(data));
Guard.NotNull(data);
var validator = new AggregateValidator(CreateContentValidators(), log);

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

@ -5,6 +5,8 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.ValidateContent
{
public delegate void AddError(IEnumerable<string> path, string message);

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

@ -7,6 +7,8 @@
using Squidex.Domain.Apps.Core.Schemas;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.ValidateContent
{
public delegate IValidator ValidatorFactory(IField field);

4
backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/JsonValueConverter.cs

@ -31,8 +31,8 @@ namespace Squidex.Domain.Apps.Core.ValidateContent
public static (object? Result, JsonError? Error) ConvertValue(IField field, IJsonValue value, IJsonSerializer jsonSerializer,
ResolvedComponents components)
{
Guard.NotNull(field, nameof(field));
Guard.NotNull(value, nameof(value));
Guard.NotNull(field);
Guard.NotNull(value);
var args = new Args(value, jsonSerializer, components);

4
backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/JsonValueValidator.cs

@ -28,8 +28,8 @@ namespace Squidex.Domain.Apps.Core.ValidateContent
public static bool IsValid(IField field, IJsonValue value, IJsonSerializer jsonSerializer)
{
Guard.NotNull(field, nameof(field));
Guard.NotNull(value, nameof(value));
Guard.NotNull(field);
Guard.NotNull(value);
var args = new Args(value, jsonSerializer);

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

@ -21,7 +21,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
public AllowedValuesValidator(IEnumerable<TValue> allowedValues)
{
Guard.NotNull(allowedValues, nameof(allowedValues));
Guard.NotNull(allowedValues);
this.allowedValues = allowedValues;
}

6
backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/AssetsValidator.cs

@ -11,6 +11,8 @@ using Squidex.Domain.Apps.Core.Schemas;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Translations;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
{
public delegate Task<IReadOnlyList<IAssetInfo>> CheckAssets(IEnumerable<DomainId> ids);
@ -24,8 +26,8 @@ namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
public AssetsValidator(bool isRequired, AssetsFieldProperties properties, CheckAssets checkAssets)
{
Guard.NotNull(properties, nameof(properties));
Guard.NotNull(checkAssets, nameof(checkAssets));
Guard.NotNull(properties);
Guard.NotNull(checkAssets);
this.properties = properties;

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

@ -17,7 +17,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
public CollectionItemValidator(IValidator itemValidator)
{
Guard.NotNull(itemValidator, nameof(itemValidator));
Guard.NotNull(itemValidator);
this.itemValidator = itemValidator;
}

4
backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/FieldValidator.cs

@ -19,8 +19,8 @@ namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
public FieldValidator(IValidator validator, IField field)
{
Guard.NotNull(field, nameof(field));
Guard.NotNull(validator, nameof(validator));
Guard.NotNull(field);
Guard.NotNull(validator);
this.field = field;
this.validator = validator;

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

@ -19,7 +19,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
public PatternValidator(string pattern, string? errorMessage = null, bool capture = false)
{
Guard.NotNullOrEmpty(pattern, nameof(pattern));
Guard.NotNullOrEmpty(pattern);
this.errorMessage = errorMessage;

6
backend/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/Validators/ReferencesValidator.cs

@ -10,6 +10,8 @@ using Squidex.Domain.Apps.Core.Schemas;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Translations;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
{
public delegate Task<IReadOnlyList<(DomainId SchemaId, DomainId Id, Status Status)>> CheckContentsByIds(HashSet<DomainId> ids);
@ -23,8 +25,8 @@ namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
public ReferencesValidator(bool isRequired, ReferencesFieldProperties properties, CheckContentsByIds checkReferences)
{
Guard.NotNull(properties, nameof(properties));
Guard.NotNull(checkReferences, nameof(checkReferences));
Guard.NotNull(properties);
Guard.NotNull(checkReferences);
this.properties = properties;

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

@ -10,6 +10,8 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.Queries;
using Squidex.Infrastructure.Translations;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Core.ValidateContent.Validators
{
public delegate Task<IReadOnlyList<(DomainId SchemaId, DomainId Id, Status Status)>> CheckUniqueness(FilterNode<ClrValue> filter);

2
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetFolderRepository_SnapshotStore.cs

@ -14,6 +14,8 @@ using Squidex.Infrastructure.MongoDb;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.States;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Entities.MongoDb.Assets
{
public sealed partial class MongoAssetFolderRepository : ISnapshotStore<AssetFolderDomainObject.State>, IDeleter

2
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository_SnapshotStore.cs

@ -14,6 +14,8 @@ using Squidex.Infrastructure.MongoDb;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.States;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Entities.MongoDb.Assets
{
public sealed partial class MongoAssetRepository : ISnapshotStore<AssetDomainObject.State>, IDeleter

2
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository_SnapshotStore.cs

@ -13,6 +13,8 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.States;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Entities.MongoDb.Contents
{
public partial class MongoContentRepository : ISnapshotStore<ContentDomainObject.State>, IDeleter

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

@ -17,7 +17,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations
public async Task<IContentEntity?> QueryAsync(ISchemaEntity schema, DomainId id,
CancellationToken ct)
{
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(schema);
var documentId = DomainId.Combine(schema.AppId, id);

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

@ -35,7 +35,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations
public async Task<IResultList<IContentEntity>> QueryAsync(DomainId appId, List<ISchemaEntity> schemas, Q q,
CancellationToken ct)
{
Guard.NotNull(q, nameof(q));
Guard.NotNull(q);
if (q.Ids == null || q.Ids.Count == 0)
{

12
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryByQuery.cs

@ -56,7 +56,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations
public async Task<IReadOnlyList<(DomainId SchemaId, DomainId Id, Status Status)>> QueryIdsAsync(DomainId appId, DomainId schemaId, FilterNode<ClrValue> filterNode,
CancellationToken ct)
{
Guard.NotNull(filterNode, nameof(filterNode));
Guard.NotNull(filterNode);
try
{
@ -86,8 +86,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations
public async Task<IResultList<IContentEntity>> QueryAsync(IAppEntity app, List<ISchemaEntity> schemas, Q q,
CancellationToken ct)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(q, nameof(q));
Guard.NotNull(app);
Guard.NotNull(q);
try
{
@ -122,9 +122,9 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations
public async Task<IResultList<IContentEntity>> QueryAsync(IAppEntity app, ISchemaEntity schema, Q q,
CancellationToken ct)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(schema, nameof(schema));
Guard.NotNull(q, nameof(q));
Guard.NotNull(app);
Guard.NotNull(schema);
Guard.NotNull(q);
try
{

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

@ -28,7 +28,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations
public async Task<IResultList<IContentEntity>> QueryAsync(DomainId appId, List<ISchemaEntity> schemas, Q q,
CancellationToken ct)
{
Guard.NotNull(q, nameof(q));
Guard.NotNull(q);
if (q.ScheduledFrom == null || q.ScheduledTo == null)
{

4
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs

@ -147,8 +147,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules
public Task UpdateAsync(RuleJob job, RuleJobUpdate update,
CancellationToken ct = default)
{
Guard.NotNull(job, nameof(job));
Guard.NotNull(update, nameof(update));
Guard.NotNull(job);
Guard.NotNull(update);
return Task.WhenAll(
UpdateStatisticsAsync(job, update, ct),

2
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Schemas/MongoSchemasHash.cs

@ -91,7 +91,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Schemas
public async Task<(Instant Create, string Hash)> GetCurrentHashAsync(IAppEntity app,
CancellationToken ct = default)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(app);
var entity = await Collection.Find(x => x.AppId == app.Id).FirstOrDefaultAsync(ct);

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

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00015" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
<PackageReference Include="Meziantou.Analyzer" Version="1.0.689">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

4
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Text/AtlasTextIndex.cs

@ -67,8 +67,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Text
public override async Task<List<DomainId>?> SearchAsync(IAppEntity app, TextQuery query, SearchScope scope,
CancellationToken ct = default)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(query, nameof(query));
Guard.NotNull(app);
Guard.NotNull(query);
var (search, take) = query;

8
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Text/MongoTextIndexBase.cs

@ -103,8 +103,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Text
public virtual async Task<List<DomainId>?> SearchAsync(IAppEntity app, GeoQuery query, SearchScope scope,
CancellationToken ct = default)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(query, nameof(query));
Guard.NotNull(app);
Guard.NotNull(query);
var findFilter =
Filter.And(
@ -123,8 +123,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Text
public virtual async Task<List<DomainId>?> SearchAsync(IAppEntity app, TextQuery query, SearchScope scope,
CancellationToken ct = default)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(query, nameof(query));
Guard.NotNull(app);
Guard.NotNull(query);
var (search, take) = query;

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

@ -74,7 +74,7 @@ namespace Squidex.Domain.Apps.Entities.Apps
private JsonObject? GetContainer(string path, bool add, out string key)
{
Guard.NotNullOrEmpty(path, nameof(path));
Guard.NotNullOrEmpty(path);
var segments = path.Split('.');

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

@ -83,7 +83,7 @@ namespace Squidex.Domain.Apps.Entities.Apps
public async Task ReadLogAsync(DomainId appId, DateTime fromDate, DateTime toDate, Stream stream,
CancellationToken ct = default)
{
Guard.NotNull(appId, nameof(appId));
Guard.NotNull(appId);
var writer = new StreamWriter(stream, Encoding.UTF8, 4096, true);
try

14
backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardApp.cs

@ -18,7 +18,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
{
public static void CanCreate(CreateApp command)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{
@ -31,7 +31,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanUploadImage(UploadAppImage command)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{
@ -44,22 +44,22 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanUpdate(UpdateApp command)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
}
public static void CanRemoveImage(RemoveAppImage command)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
}
public static void CanUpdateAssetScripts(ConfigureAssetScripts command)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
}
public static void CanUpdateSettings(UpdateAppSettings command)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{
@ -125,7 +125,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanChangePlan(ChangePlan command, IAppEntity app, IAppPlansProvider appPlans)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{

6
backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppClients.cs

@ -17,7 +17,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
{
public static void CanAttach(AttachClient command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{
@ -36,7 +36,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanRevoke(RevokeClient command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
GetClientOrThrow(app.Clients, command.Id);
@ -51,7 +51,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanUpdate(UpdateClient command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
GetClientOrThrow(app.Clients, command.Id);

4
backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppContributors.cs

@ -19,7 +19,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
{
public static Task CanAssign(AssignContributor command, IAppEntity app, IUserResolver users, IAppLimitsPlan plan)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
var contributors = app.Contributors;
@ -64,7 +64,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanRemove(RemoveContributor command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
var contributors = app.Contributors;

6
backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppLanguages.cs

@ -17,7 +17,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
{
public static void CanAdd(AddLanguage command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{
@ -37,7 +37,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanRemove(RemoveLanguage command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{
@ -62,7 +62,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanUpdate(UpdateLanguage command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{

6
backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppRoles.cs

@ -17,7 +17,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
{
public static void CanAdd(AddRole command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
var roles = app.Roles;
@ -36,7 +36,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanDelete(DeleteRole command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
var roles = app.Roles;
@ -67,7 +67,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanUpdate(UpdateRole command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
var roles = app.Roles;

6
backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/Guards/GuardAppWorkflows.cs

@ -17,7 +17,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
{
public static void CanAdd(AddWorkflow command)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
Validate.It(e =>
{
@ -30,7 +30,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanUpdate(UpdateWorkflow command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
var workflows = app.Workflows;
@ -94,7 +94,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject.Guards
public static void CanDelete(DeleteWorkflow command, IAppEntity app)
{
Guard.NotNull(command, nameof(command));
Guard.NotNull(command);
var workflows = app.Workflows;

4
backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/ConfigAppPlansProvider.cs

@ -63,7 +63,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans
public IAppLimitsPlan? GetPlanUpgradeForApp(IAppEntity app)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(app);
return GetPlanUpgrade(app.Plan?.PlanId);
}
@ -84,7 +84,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans
public (IAppLimitsPlan Plan, string PlanId) GetPlanForApp(IAppEntity app)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(app);
var planId = app.Plan?.PlanId;
var plan = GetPlanCore(planId);

2
backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/RedirectToCheckoutResult.cs

@ -15,7 +15,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans
public RedirectToCheckoutResult(Uri url)
{
Guard.NotNull(url, nameof(url));
Guard.NotNull(url);
Url = url;
}

2
backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageGate.cs

@ -32,7 +32,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans
public virtual async Task<bool> IsBlockedAsync(IAppEntity app, string? clientId, DateTime today)
{
Guard.NotNull(app, nameof(app));
Guard.NotNull(app);
var appId = app.Id;

2
backend/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs

@ -9,6 +9,8 @@ using Squidex.Domain.Apps.Entities.Apps.Commands;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Commands;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Entities.Apps.Templates
{
public delegate Task PublishTemplate(IAppCommand command);

2
backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs

@ -10,6 +10,8 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.UsageTracking;
#pragma warning disable MA0048 // File name must match type name
namespace Squidex.Domain.Apps.Entities.Assets
{
public partial class AssetUsageTracker : IEventConsumer

4
backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsJintExtension.cs

@ -81,7 +81,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
private async Task GetTextAsync(ScriptExecutionContext context, JsValue input, Action<JsValue> callback, JsValue encoding)
{
Guard.NotNull(callback, nameof(callback));
Guard.NotNull(callback);
if (input is not ObjectWrapper objectWrapper)
{
@ -137,7 +137,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
private async Task GetReferencesAsync(ScriptExecutionContext context, DomainId appId, ClaimsPrincipal user, JsValue references, Action<JsValue> callback)
{
Guard.NotNull(callback, nameof(callback));
Guard.NotNull(callback);
var ids = new List<DomainId>();

4
backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetCommandMiddleware.cs

@ -75,7 +75,7 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject
{
await assetFileStore.DeleteAsync(tempFile);
createAsset.File.Dispose();
await createAsset.File.DisposeAsync();
}
break;
@ -123,7 +123,7 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject
{
await assetFileStore.DeleteAsync(tempFile);
upload.File.Dispose();
await upload.File.DisposeAsync();
}
}

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

Loading…
Cancel
Save