Browse Source

1. Formatting fixes

2. Webhook events UI
pull/95/head
Sebastian Stehle 9 years ago
parent
commit
c1a45ca0f0
  1. 4
      Squidex.sln.DotSettings
  2. 2
      src/Squidex.Domain.Apps.Core/ContentValidator.cs
  3. 2
      src/Squidex.Domain.Apps.Core/LanguageConfig.cs
  4. 2
      src/Squidex.Domain.Apps.Core/LanguagesConfig.cs
  5. 18
      src/Squidex.Domain.Apps.Core/Schemas/FieldRegistry.cs
  6. 2
      src/Squidex.Domain.Apps.Core/Schemas/Field_Generic.cs
  7. 2
      src/Squidex.Domain.Apps.Core/Schemas/GeolocationField.cs
  8. 2
      src/Squidex.Domain.Apps.Core/Schemas/Json/SchemaJsonSerializer.cs
  9. 6
      src/Squidex.Domain.Apps.Core/Schemas/ValidationContext.cs
  10. 2
      src/Squidex.Domain.Apps.Core/Schemas/Validators/ReferencesValidator.cs
  11. 2
      src/Squidex.Domain.Apps.Read.MongoDb/Apps/MongoAppEntity.cs
  12. 2
      src/Squidex.Domain.Apps.Read.MongoDb/Apps/MongoAppRepository.cs
  13. 2
      src/Squidex.Domain.Apps.Read.MongoDb/Assets/MongoAssetRepository.cs
  14. 6
      src/Squidex.Domain.Apps.Read.MongoDb/Assets/MongoAssetStatsRepository.cs
  15. 4
      src/Squidex.Domain.Apps.Read.MongoDb/Assets/MongoAssetStatsRepository_EventHandling.cs
  16. 2
      src/Squidex.Domain.Apps.Read.MongoDb/Contents/MongoContentEntity.cs
  17. 4
      src/Squidex.Domain.Apps.Read.MongoDb/Contents/MongoContentRepository.cs
  18. 2
      src/Squidex.Domain.Apps.Read.MongoDb/Contents/Visitors/FilterVisitor.cs
  19. 2
      src/Squidex.Domain.Apps.Read.MongoDb/History/MongoHistoryEventRepository.cs
  20. 6
      src/Squidex.Domain.Apps.Read.MongoDb/Schemas/MongoSchemaRepository.cs
  21. 2
      src/Squidex.Domain.Apps.Read.MongoDb/Schemas/MongoSchemaWebhookRepository.cs
  22. 9
      src/Squidex.Domain.Apps.Read.MongoDb/Schemas/MongoWebhookEventRepository.cs
  23. 2
      src/Squidex.Domain.Apps.Read/Apps/IAppContributorEntity.cs
  24. 2
      src/Squidex.Domain.Apps.Read/Contents/Edm/EdmModelBuilder.cs
  25. 4
      src/Squidex.Domain.Apps.Read/Contents/GraphQL/GraphQLModel.cs
  26. 2
      src/Squidex.Domain.Apps.Read/Contents/GraphQL/Types/ContentQueryGraphType.cs
  27. 4
      src/Squidex.Domain.Apps.Read/Contents/JsonSchema/ContentSchemaBuilder.cs
  28. 2
      src/Squidex.Domain.Apps.Read/Schemas/ISchemaEntity.cs
  29. 2
      src/Squidex.Domain.Apps.Read/Schemas/IWebhookEventEntity.cs
  30. 2
      src/Squidex.Domain.Apps.Read/Schemas/Repositories/IWebhookEventRepository.cs
  31. 10
      src/Squidex.Domain.Apps.Read/Schemas/WebhookDequeuer.cs
  32. 2
      src/Squidex.Domain.Apps.Read/Schemas/WebhookEnqueuer.cs
  33. 2
      src/Squidex.Domain.Apps.Write/Apps/AppClient.cs
  34. 2
      src/Squidex.Domain.Apps.Write/Apps/AppDomainObject.cs
  35. 6
      src/Squidex.Domain.Apps.Write/Assets/AssetCommandHandler.cs
  36. 2
      src/Squidex.Domain.Apps.Write/Assets/AssetDomainObject.cs
  37. 10
      src/Squidex.Domain.Apps.Write/Contents/ContentCommandHandler.cs
  38. 2
      src/Squidex.Domain.Apps.Write/Contents/ContentDomainObject.cs
  39. 4
      src/Squidex.Domain.Apps.Write/Schemas/SchemaCommandHandler.cs
  40. 8
      src/Squidex.Domain.Apps.Write/Schemas/SchemaDomainObject.cs
  41. 4
      src/Squidex.Domain.Users.MongoDb/Infrastructure/MongoPersistedGrantStore.cs
  42. 18
      src/Squidex.Domain.Users.MongoDb/MongoUserStore.cs
  43. 2
      src/Squidex.Infrastructure.Azure/Assets/AzureBlobAssetStore.cs
  44. 4
      src/Squidex.Infrastructure.GetEventStore/CQRS/Events/Formatter.cs
  45. 2
      src/Squidex.Infrastructure.MongoDb/CQRS/Events/MongoEventConsumerInfoRepository.cs
  46. 4
      src/Squidex.Infrastructure.MongoDb/MongoDb/IMongoEntity.cs
  47. 6
      src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageStore.cs
  48. 4
      src/Squidex.Infrastructure/Assets/AssetNotFoundException.cs
  49. 2
      src/Squidex.Infrastructure/Assets/FolderAssetStore.cs
  50. 2
      src/Squidex.Infrastructure/CQRS/Commands/AggregateHandler.cs
  51. 2
      src/Squidex.Infrastructure/CQRS/Commands/CommandContext.cs
  52. 2
      src/Squidex.Infrastructure/CQRS/Commands/CommandingExtensions.cs
  53. 2
      src/Squidex.Infrastructure/CQRS/Commands/DefaultDomainObjectRepository.cs
  54. 2
      src/Squidex.Infrastructure/CQRS/Commands/InMemoryCommandBus.cs
  55. 4
      src/Squidex.Infrastructure/CQRS/Events/EventData.cs
  56. 2
      src/Squidex.Infrastructure/CQRS/Events/EventReceiver.cs
  57. 2
      src/Squidex.Infrastructure/CQRS/Events/IEventStore.cs
  58. 4
      src/Squidex.Infrastructure/ConfigurationException.cs
  59. 8
      src/Squidex.Infrastructure/DisposableObjectBase.cs
  60. 4
      src/Squidex.Infrastructure/DomainException.cs
  61. 2
      src/Squidex.Infrastructure/GravatarHelper.cs
  62. 4
      src/Squidex.Infrastructure/Log/SemanticLog.cs
  63. 4
      src/Squidex.Infrastructure/PropertiesBag.cs
  64. 24
      src/Squidex.Infrastructure/PropertyValue.cs
  65. 2
      src/Squidex.Infrastructure/Reflection/IPropertyAccessor.cs
  66. 2
      src/Squidex.Infrastructure/Reflection/PropertiesTypeAccessor.cs
  67. 4
      src/Squidex.Infrastructure/Reflection/PropertyAccessor.cs
  68. 2
      src/Squidex.Infrastructure/Timers/CompletionTimer.cs
  69. 2
      src/Squidex.Infrastructure/ValidationException.cs
  70. 2
      src/Squidex/Config/Domain/StoreMongoDbModule.cs
  71. 4
      src/Squidex/Config/Identity/IdentityServices.cs
  72. 2
      src/Squidex/Config/MyUrlsOptions.cs
  73. 2
      src/Squidex/Controllers/Api/Apps/AppClientsController.cs
  74. 2
      src/Squidex/Controllers/Api/Apps/AppContributorsController.cs
  75. 6
      src/Squidex/Controllers/Api/Apps/AppLanguagesController.cs
  76. 2
      src/Squidex/Controllers/Api/Apps/AppsController.cs
  77. 2
      src/Squidex/Controllers/Api/Apps/Models/AppDto.cs
  78. 4
      src/Squidex/Controllers/Api/Apps/Models/ClientDto.cs
  79. 4
      src/Squidex/Controllers/Api/Assets/AssetsController.cs
  80. 2
      src/Squidex/Controllers/Api/Assets/Models/AssetDto.cs
  81. 2
      src/Squidex/Controllers/Api/History/HistoryController.cs
  82. 6
      src/Squidex/Controllers/Api/Plans/AppPlansController.cs
  83. 2
      src/Squidex/Controllers/Api/Schemas/Models/Converters/JsonInheritanceConverter.cs
  84. 69
      src/Squidex/Controllers/Api/Schemas/Models/Converters/SchemaConverter.cs
  85. 2
      src/Squidex/Controllers/Api/Schemas/Models/SchemaDetailsDto.cs
  86. 2
      src/Squidex/Controllers/Api/Schemas/Models/SchemaDto.cs
  87. 7
      src/Squidex/Controllers/Api/Schemas/SchemaFieldsController.cs
  88. 4
      src/Squidex/Controllers/Api/Schemas/SchemasController.cs
  89. 4
      src/Squidex/Controllers/Api/Statistics/UsagesController.cs
  90. 2
      src/Squidex/Controllers/Api/Users/Models/UpdateUserDto.cs
  91. 15
      src/Squidex/Controllers/Api/Webhooks/Models/WebhookEventDto.cs
  92. 47
      src/Squidex/Controllers/Api/Webhooks/WebhooksController.cs
  93. 4
      src/Squidex/Controllers/ContentApi/ContentSwaggerController.cs
  94. 6
      src/Squidex/Controllers/ContentApi/ContentsController.cs
  95. 6
      src/Squidex/Controllers/ContentApi/Generator/SchemaSwaggerGenerator.cs
  96. 10
      src/Squidex/Controllers/ContentApi/Generator/SchemasSwaggerGenerator.cs
  97. 3
      src/Squidex/Controllers/ContentApi/Models/ContentDto.cs
  98. 8
      src/Squidex/Controllers/UI/Account/AccountController.cs
  99. 2
      src/Squidex/Controllers/UI/Profile/ChangePasswordModel.cs
  100. 2
      src/Squidex/Controllers/UI/Profile/PortalController.cs

4
Squidex.sln.DotSettings

@ -24,10 +24,12 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBePrivate_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBePrivate_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=Mvc_002EViewNotResolved/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=Mvc_002EViewNotResolved/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReturnTypeCanBeEnumerable_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReturnTypeCanBeEnumerable_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnnecessaryWhitespace/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedAutoPropertyAccessor_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedAutoPropertyAccessor_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMethodReturnValue_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMethodReturnValue_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedParameter_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedParameter_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNullPropagationWhenPossible/@EntryIndexedValue">WARNING</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=61F6BBCE_002DA080_002D4400_002DB194_002D70E2F5D2096E_002Fd_003A_005Ftest_002Doutput/@EntryIndexRemoved">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=61F6BBCE_002DA080_002D4400_002DB194_002D70E2F5D2096E_002Fd_003A_005Ftest_002Doutput/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=61F6BBCE_002DA080_002D4400_002DB194_002D70E2F5D2096E_002Fd_003A_005Ftest_002Doutput/@EntryIndexedValue"></s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=61F6BBCE_002DA080_002D4400_002DB194_002D70E2F5D2096E_002Fd_003A_005Ftest_002Doutput/@EntryIndexedValue"></s:String>
@ -79,6 +81,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FMETHOD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FMETHOD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FPARAMETER/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FPARAMETER/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FHTML_005FCONTROL/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FHTML_005FCONTROL/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
@ -87,6 +90,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/CustomLocation/@EntryValue">C:\Users\mail2\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v08_85ffde88\SolutionCaches</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>

2
src/Squidex.Domain.Apps.Core/ContentValidator.cs

@ -34,7 +34,7 @@ namespace Squidex.Domain.Apps.Core
{ {
Guard.NotNull(schema, nameof(schema)); Guard.NotNull(schema, nameof(schema));
Guard.NotNull(partitionResolver, nameof(partitionResolver)); Guard.NotNull(partitionResolver, nameof(partitionResolver));
this.schema = schema; this.schema = schema;
this.context = context; this.context = context;
this.partitionResolver = partitionResolver; this.partitionResolver = partitionResolver;

2
src/Squidex.Domain.Apps.Core/LanguageConfig.cs

@ -51,7 +51,7 @@ namespace Squidex.Domain.Apps.Core
Guard.NotNull(language, nameof(language)); Guard.NotNull(language, nameof(language));
Language = language; Language = language;
IsOptional = isOptional; IsOptional = isOptional;
Fallback = fallback ?? ImmutableList<Language>.Empty; Fallback = fallback ?? ImmutableList<Language>.Empty;

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

@ -116,7 +116,7 @@ namespace Squidex.Domain.Apps.Core
{ {
if (languageConfig.Fallback.Contains(language)) if (languageConfig.Fallback.Contains(language))
{ {
newLanguages = newLanguages =
newLanguages.SetItem(languageConfig.Language, newLanguages.SetItem(languageConfig.Language,
new LanguageConfig( new LanguageConfig(
languageConfig.Language, languageConfig.Language,

18
src/Squidex.Domain.Apps.Core/Schemas/FieldRegistry.cs

@ -48,27 +48,27 @@ namespace Squidex.Domain.Apps.Core.Schemas
this.typeNameRegistry = typeNameRegistry; this.typeNameRegistry = typeNameRegistry;
Add<BooleanFieldProperties>( Add<BooleanFieldProperties>(
(id, name, partitioning, properties) => (id, name, partitioning, properties) =>
new BooleanField(id, name, partitioning, (BooleanFieldProperties)properties)); new BooleanField(id, name, partitioning, (BooleanFieldProperties)properties));
Add<NumberFieldProperties>( Add<NumberFieldProperties>(
(id, name, partitioning, properties) => (id, name, partitioning, properties) =>
new NumberField(id, name, partitioning, (NumberFieldProperties)properties)); new NumberField(id, name, partitioning, (NumberFieldProperties)properties));
Add<StringFieldProperties>( Add<StringFieldProperties>(
(id, name, partitioning, properties) => (id, name, partitioning, properties) =>
new StringField(id, name, partitioning, (StringFieldProperties)properties)); new StringField(id, name, partitioning, (StringFieldProperties)properties));
Add<DateTimeFieldProperties>( Add<DateTimeFieldProperties>(
(id, name, partitioning, properties) => (id, name, partitioning, properties) =>
new DateTimeField(id, name, partitioning, (DateTimeFieldProperties)properties)); new DateTimeField(id, name, partitioning, (DateTimeFieldProperties)properties));
Add<JsonFieldProperties>( Add<JsonFieldProperties>(
(id, name, partitioning, properties) => (id, name, partitioning, properties) =>
new JsonField(id, name, partitioning, (JsonFieldProperties)properties)); new JsonField(id, name, partitioning, (JsonFieldProperties)properties));
Add<AssetsFieldProperties>( Add<AssetsFieldProperties>(
(id, name, partitioning, properties) => (id, name, partitioning, properties) =>
new AssetsField(id, name, partitioning, (AssetsFieldProperties)properties)); new AssetsField(id, name, partitioning, (AssetsFieldProperties)properties));
Add<ReferencesFieldProperties>( Add<ReferencesFieldProperties>(
@ -76,7 +76,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
new ReferencesField(id, name, partitioning, (ReferencesFieldProperties)properties)); new ReferencesField(id, name, partitioning, (ReferencesFieldProperties)properties));
Add<GeolocationFieldProperties>( Add<GeolocationFieldProperties>(
(id, name, partitioning, properties) => (id, name, partitioning, properties) =>
new GeolocationField(id, name, partitioning, (GeolocationFieldProperties)properties)); new GeolocationField(id, name, partitioning, (GeolocationFieldProperties)properties));
} }
@ -85,9 +85,9 @@ namespace Squidex.Domain.Apps.Core.Schemas
Guard.NotNull(fieldFactory, nameof(fieldFactory)); Guard.NotNull(fieldFactory, nameof(fieldFactory));
typeNameRegistry.Map(typeof(TFieldProperties)); typeNameRegistry.Map(typeof(TFieldProperties));
var registered = new Registered(fieldFactory, typeof(TFieldProperties)); var registered = new Registered(fieldFactory, typeof(TFieldProperties));
fieldsByPropertyType[registered.PropertiesType] = registered; fieldsByPropertyType[registered.PropertiesType] = registered;
} }

2
src/Squidex.Domain.Apps.Core/Schemas/Field_Generic.cs

@ -25,7 +25,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
get { return properties; } get { return properties; }
} }
protected Field(long id, string name, Partitioning partitioning, T properties) protected Field(long id, string name, Partitioning partitioning, T properties)
: base(id, name, partitioning) : base(id, name, partitioning)
{ {
Guard.NotNull(properties, nameof(properties)); Guard.NotNull(properties, nameof(properties));

2
src/Squidex.Domain.Apps.Core/Schemas/GeolocationField.cs

@ -82,7 +82,7 @@ namespace Squidex.Domain.Apps.Core.Schemas
geolocationSchema.AllowAdditionalProperties = false; geolocationSchema.AllowAdditionalProperties = false;
var schemaReference = schemaResolver("GeolocationDto", geolocationSchema); var schemaReference = schemaResolver("GeolocationDto", geolocationSchema);
jsonProperty.SchemaReference = schemaReference; jsonProperty.SchemaReference = schemaReference;
} }

2
src/Squidex.Domain.Apps.Core/Schemas/Json/SchemaJsonSerializer.cs

@ -35,7 +35,7 @@ namespace Squidex.Domain.Apps.Core.Schemas.Json
{ {
var model = new JsonSchemaModel { Name = schema.Name, IsPublished = schema.IsPublished, Properties = schema.Properties }; var model = new JsonSchemaModel { Name = schema.Name, IsPublished = schema.IsPublished, Properties = schema.Properties };
model.Fields = model.Fields =
schema.Fields.Select(x => schema.Fields.Select(x =>
new JsonFieldModel new JsonFieldModel
{ {

6
src/Squidex.Domain.Apps.Core/Schemas/ValidationContext.cs

@ -25,12 +25,12 @@ namespace Squidex.Domain.Apps.Core.Schemas
Func<IEnumerable<Guid>, Task<IReadOnlyList<Guid>>> checkAsset) Func<IEnumerable<Guid>, Task<IReadOnlyList<Guid>>> checkAsset)
: this(checkContent, checkAsset, false) : this(checkContent, checkAsset, false)
{ {
} }
private ValidationContext( private ValidationContext(
Func<IEnumerable<Guid>, Guid, Task<IReadOnlyList<Guid>>> checkContent, Func<IEnumerable<Guid>, Guid, Task<IReadOnlyList<Guid>>> checkContent,
Func<IEnumerable<Guid>, Task<IReadOnlyList<Guid>>> checkAsset, Func<IEnumerable<Guid>, Task<IReadOnlyList<Guid>>> checkAsset,
bool isOptional) bool isOptional)
{ {
Guard.NotNull(checkAsset, nameof(checkAsset)); Guard.NotNull(checkAsset, nameof(checkAsset));

2
src/Squidex.Domain.Apps.Core/Schemas/Validators/ReferencesValidator.cs

@ -51,7 +51,7 @@ namespace Squidex.Domain.Apps.Core.Schemas.Validators
} }
var invalidIds = await context.GetInvalidContentIdsAsync(references.ContentIds, schemaId); var invalidIds = await context.GetInvalidContentIdsAsync(references.ContentIds, schemaId);
foreach (var invalidId in invalidIds) foreach (var invalidId in invalidIds)
{ {
addError($"<FIELD> contains invalid reference '{invalidId}'"); addError($"<FIELD> contains invalid reference '{invalidId}'");

2
src/Squidex.Domain.Apps.Read.MongoDb/Apps/MongoAppEntity.cs

@ -46,7 +46,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Apps
[BsonRequired] [BsonRequired]
[BsonElement] [BsonElement]
public List<MongoAppEntityLanguage> Languages { get; set; } = new List<MongoAppEntityLanguage>(); public List<MongoAppEntityLanguage> Languages { get; set; } = new List<MongoAppEntityLanguage>();
[BsonRequired] [BsonRequired]
[BsonElement] [BsonElement]

2
src/Squidex.Domain.Apps.Read.MongoDb/Apps/MongoAppRepository.cs

@ -19,7 +19,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Apps
{ {
public partial class MongoAppRepository : MongoRepositoryBase<MongoAppEntity>, IAppRepository, IEventConsumer public partial class MongoAppRepository : MongoRepositoryBase<MongoAppEntity>, IAppRepository, IEventConsumer
{ {
public MongoAppRepository(IMongoDatabase database) public MongoAppRepository(IMongoDatabase database)
: base(database) : base(database)
{ {
} }

2
src/Squidex.Domain.Apps.Read.MongoDb/Assets/MongoAssetRepository.cs

@ -23,7 +23,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Assets
{ {
public partial class MongoAssetRepository : MongoRepositoryBase<MongoAssetEntity>, IAssetRepository, IEventConsumer public partial class MongoAssetRepository : MongoRepositoryBase<MongoAssetEntity>, IAssetRepository, IEventConsumer
{ {
public MongoAssetRepository(IMongoDatabase database) public MongoAssetRepository(IMongoDatabase database)
: base(database) : base(database)
{ {
} }

6
src/Squidex.Domain.Apps.Read.MongoDb/Assets/MongoAssetStatsRepository.cs

@ -40,7 +40,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Assets
public async Task<IReadOnlyList<IAssetStatsEntity>> QueryAsync(Guid appId, DateTime fromDate, DateTime toDate) public async Task<IReadOnlyList<IAssetStatsEntity>> QueryAsync(Guid appId, DateTime fromDate, DateTime toDate)
{ {
var originalSizesEntities = var originalSizesEntities =
await Collection.Find(x => x.AppId == appId && x.Date >= fromDate && x.Date <= toDate).SortBy(x => x.Date) await Collection.Find(x => x.AppId == appId && x.Date >= fromDate && x.Date <= toDate).SortBy(x => x.Date)
.ToListAsync(); .ToListAsync();
@ -64,7 +64,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Assets
{ {
if (previousSize < 0) if (previousSize < 0)
{ {
var firstBeforeRangeEntity = var firstBeforeRangeEntity =
await Collection.Find(x => x.AppId == appId && x.Date < fromDate).SortByDescending(x => x.Date) await Collection.Find(x => x.AppId == appId && x.Date < fromDate).SortByDescending(x => x.Date)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
@ -88,7 +88,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Assets
public async Task<long> GetTotalSizeAsync(Guid appId) public async Task<long> GetTotalSizeAsync(Guid appId)
{ {
var totalSizeEntity = var totalSizeEntity =
await Collection.Find(x => x.AppId == appId).SortByDescending(x => x.Date) await Collection.Find(x => x.AppId == appId).SortByDescending(x => x.Date)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();

4
src/Squidex.Domain.Apps.Read.MongoDb/Assets/MongoAssetStatsRepository_EventHandling.cs

@ -53,13 +53,13 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Assets
{ {
var id = $"{appId}_{date:yyyy-MM-dd}"; var id = $"{appId}_{date:yyyy-MM-dd}";
var assetStatsEntity = var assetStatsEntity =
await Collection.Find(x => x.Id == id) await Collection.Find(x => x.Id == id)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
if (assetStatsEntity == null) if (assetStatsEntity == null)
{ {
var lastEntity = var lastEntity =
await Collection.Find(x => x.AppId == appId).SortByDescending(x => x.Date) await Collection.Find(x => x.AppId == appId).SortByDescending(x => x.Date)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();

2
src/Squidex.Domain.Apps.Read.MongoDb/Contents/MongoContentEntity.cs

@ -102,7 +102,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Contents
{ {
var jsonString = DataObject.ToJson(Settings); var jsonString = DataObject.ToJson(Settings);
contentData = contentData =
JsonConvert.DeserializeObject<IdContentData>(jsonString) JsonConvert.DeserializeObject<IdContentData>(jsonString)
.ToCleanedReferences(schema, new HashSet<Guid>(ReferencedIdsDeleted)) .ToCleanedReferences(schema, new HashSet<Guid>(ReferencedIdsDeleted))
.ToNameModel(schema, true); .ToNameModel(schema, true);

4
src/Squidex.Domain.Apps.Read.MongoDb/Contents/MongoContentRepository.cs

@ -88,7 +88,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Contents
var parser = model.ParseQuery(odataQuery); var parser = model.ParseQuery(odataQuery);
cursor = cursor =
collection collection
.Find(parser, ids, schemaEntity.Id, schemaEntity.Schema, nonPublished) .Find(parser, ids, schemaEntity.Id, schemaEntity.Schema, nonPublished)
.Take(parser) .Take(parser)
@ -175,7 +175,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Contents
await ForSchemaAsync(app.Id, schemaId, async (collection, schemaEntity) => await ForSchemaAsync(app.Id, schemaId, async (collection, schemaEntity) =>
{ {
contentEntity = contentEntity =
await collection.Find(x => x.Id == id) await collection.Find(x => x.Id == id)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();

2
src/Squidex.Domain.Apps.Read.MongoDb/Contents/Visitors/FilterVisitor.cs

@ -92,7 +92,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Contents.Visitors
if (nodeIn.Left is SingleValueFunctionCallNode functionNode) if (nodeIn.Left is SingleValueFunctionCallNode functionNode)
{ {
var regexFilter = Visit(functionNode); var regexFilter = Visit(functionNode);
var value = BuildValue(nodeIn.Right); var value = BuildValue(nodeIn.Right);
if (value is bool booleanRight) if (value is bool booleanRight)

2
src/Squidex.Domain.Apps.Read.MongoDb/History/MongoHistoryEventRepository.cs

@ -37,7 +37,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.History
get { return ".*"; } get { return ".*"; }
} }
public MongoHistoryEventRepository(IMongoDatabase database, IEnumerable<IHistoryEventsCreator> creators) public MongoHistoryEventRepository(IMongoDatabase database, IEnumerable<IHistoryEventsCreator> creators)
: base(database) : base(database)
{ {
this.creators = creators.ToList(); this.creators = creators.ToList();

6
src/Squidex.Domain.Apps.Read.MongoDb/Schemas/MongoSchemaRepository.cs

@ -49,7 +49,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Schemas
public async Task<IReadOnlyList<ISchemaEntity>> QueryAllAsync(Guid appId) public async Task<IReadOnlyList<ISchemaEntity>> QueryAllAsync(Guid appId)
{ {
var schemaEntities = var schemaEntities =
await Collection.Find(s => s.AppId == appId && !s.IsDeleted) await Collection.Find(s => s.AppId == appId && !s.IsDeleted)
.ToListAsync(); .ToListAsync();
@ -60,7 +60,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Schemas
public async Task<ISchemaEntity> FindSchemaAsync(Guid appId, string name) public async Task<ISchemaEntity> FindSchemaAsync(Guid appId, string name)
{ {
var schemaEntity = var schemaEntity =
await Collection.Find(s => s.Name == name && s.AppId == appId && !s.IsDeleted) await Collection.Find(s => s.Name == name && s.AppId == appId && !s.IsDeleted)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
@ -71,7 +71,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Schemas
public async Task<ISchemaEntity> FindSchemaAsync(Guid schemaId) public async Task<ISchemaEntity> FindSchemaAsync(Guid schemaId)
{ {
var schemaEntity = var schemaEntity =
await Collection.Find(s => s.Id == schemaId) await Collection.Find(s => s.Id == schemaId)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();

2
src/Squidex.Domain.Apps.Read.MongoDb/Schemas/MongoSchemaWebhookRepository.cs

@ -68,7 +68,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Schemas
public async Task TraceSentAsync(Guid webhookId, WebhookResult result, TimeSpan elapsed) public async Task TraceSentAsync(Guid webhookId, WebhookResult result, TimeSpan elapsed)
{ {
var webhookEntity = var webhookEntity =
await Collection.Find(x => x.Id == webhookId) await Collection.Find(x => x.Id == webhookId)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();

9
src/Squidex.Domain.Apps.Read.MongoDb/Schemas/MongoWebhookEventRepository.cs

@ -70,6 +70,11 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Schemas
return (int)await Collection.CountAsync(x => x.AppId == appId); return (int)await Collection.CountAsync(x => x.AppId == appId);
} }
public Task EnqueueAsync(Guid id, Instant nextAttempt)
{
return Collection.UpdateOneAsync(x => x.Id == id, Update.Set(x => x.NextAttempt, nextAttempt));
}
public Task TraceSendingAsync(Guid jobId) public Task TraceSendingAsync(Guid jobId)
{ {
return Collection.UpdateOneAsync(x => x.Id == jobId, Update.Set(x => x.IsSending, true)); return Collection.UpdateOneAsync(x => x.Id == jobId, Update.Set(x => x.IsSending, true));
@ -77,7 +82,7 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Schemas
public Task EnqueueAsync(WebhookJob job, Instant nextAttempt) public Task EnqueueAsync(WebhookJob job, Instant nextAttempt)
{ {
var entity = SimpleMapper.Map(job, new MongoWebhookEventEntity { NextAttempt = nextAttempt }); var entity = SimpleMapper.Map(job, new MongoWebhookEventEntity { Created = clock.GetCurrentInstant(), NextAttempt = nextAttempt });
return Collection.InsertOneIfNotExistsAsync(entity); return Collection.InsertOneIfNotExistsAsync(entity);
} }
@ -103,6 +108,8 @@ namespace Squidex.Domain.Apps.Read.MongoDb.Schemas
Update.Set(x => x.Result, result) Update.Set(x => x.Result, result)
.Set(x => x.LastDump, dump) .Set(x => x.LastDump, dump)
.Set(x => x.JobResult, jobResult) .Set(x => x.JobResult, jobResult)
.Set(x => x.IsSending, false)
.Set(x => x.NextAttempt, nextAttempt)
.Inc(x => x.NumCalls, 1)); .Inc(x => x.NumCalls, 1));
} }
} }

2
src/Squidex.Domain.Apps.Read/Apps/IAppContributorEntity.cs

@ -13,7 +13,7 @@ namespace Squidex.Domain.Apps.Read.Apps
public interface IAppContributorEntity public interface IAppContributorEntity
{ {
string ContributorId { get; } string ContributorId { get; }
PermissionLevel Permission { get; } PermissionLevel Permission { get; }
} }
} }

2
src/Squidex.Domain.Apps.Read/Contents/Edm/EdmModelBuilder.cs

@ -20,7 +20,7 @@ namespace Squidex.Domain.Apps.Read.Contents.Edm
{ {
public sealed class EdmModelBuilder : CachingProviderBase public sealed class EdmModelBuilder : CachingProviderBase
{ {
public EdmModelBuilder(IMemoryCache cache) public EdmModelBuilder(IMemoryCache cache)
: base(cache) : base(cache)
{ {
} }

4
src/Squidex.Domain.Apps.Read/Contents/GraphQL/GraphQLModel.cs

@ -46,7 +46,7 @@ namespace Squidex.Domain.Apps.Read.Contents.GraphQL
this.appEntity = appEntity; this.appEntity = appEntity;
partitionResolver = appEntity.PartitionResolver; partitionResolver = appEntity.PartitionResolver;
assetType = new AssetGraphType(this); assetType = new AssetGraphType(this);
assetListType = new ListGraphType(new NonNullGraphType(assetType)); assetListType = new ListGraphType(new NonNullGraphType(assetType));
@ -87,7 +87,7 @@ namespace Squidex.Domain.Apps.Read.Contents.GraphQL
}; };
this.schemas = schemas.ToDictionary(x => x.Id); this.schemas = schemas.ToDictionary(x => x.Id);
graphQLSchema = new GraphQLSchema { Query = new ContentQueryGraphType(this, this.schemas.Values) }; graphQLSchema = new GraphQLSchema { Query = new ContentQueryGraphType(this, this.schemas.Values) };
foreach (var schemaType in schemaTypes.Values) foreach (var schemaType in schemaTypes.Values)

2
src/Squidex.Domain.Apps.Read/Contents/GraphQL/Types/ContentQueryGraphType.cs

@ -180,7 +180,7 @@ namespace Squidex.Domain.Apps.Read.Contents.GraphQL.Types
private static string BuildODataQuery(ResolveFieldContext c) private static string BuildODataQuery(ResolveFieldContext c)
{ {
var odataQuery = "?" + var odataQuery = "?" +
string.Join("&", string.Join("&",
c.Arguments c.Arguments
.Select(x => new { x.Key, Value = x.Value.ToString() }).Where(x => !string.IsNullOrWhiteSpace(x.Value)) .Select(x => new { x.Key, Value = x.Value.ToString() }).Where(x => !string.IsNullOrWhiteSpace(x.Value))

4
src/Squidex.Domain.Apps.Read/Contents/JsonSchema/ContentSchemaBuilder.cs

@ -18,9 +18,9 @@ namespace Squidex.Domain.Apps.Read.Contents.JsonSchema
{ {
Guard.NotNull(schema, nameof(schema)); Guard.NotNull(schema, nameof(schema));
Guard.NotNull(dataSchema, nameof(dataSchema)); Guard.NotNull(dataSchema, nameof(dataSchema));
var schemaName = schema.Properties.Label.WithFallback(schema.Name); var schemaName = schema.Properties.Label.WithFallback(schema.Name);
var contentSchema = new JsonSchema4 var contentSchema = new JsonSchema4
{ {
Properties = Properties =

2
src/Squidex.Domain.Apps.Read/Schemas/ISchemaEntity.cs

@ -15,7 +15,7 @@ namespace Squidex.Domain.Apps.Read.Schemas
string Name { get; } string Name { get; }
bool IsPublished { get; } bool IsPublished { get; }
bool IsDeleted { get; } bool IsDeleted { get; }
Schema Schema { get; } Schema Schema { get; }

2
src/Squidex.Domain.Apps.Read/Schemas/IWebhookEventEntity.cs

@ -10,7 +10,7 @@ using NodaTime;
namespace Squidex.Domain.Apps.Read.Schemas namespace Squidex.Domain.Apps.Read.Schemas
{ {
public interface IWebhookEventEntity public interface IWebhookEventEntity : IEntity
{ {
WebhookJob Job { get; } WebhookJob Job { get; }

2
src/Squidex.Domain.Apps.Read/Schemas/Repositories/IWebhookEventRepository.cs

@ -18,6 +18,8 @@ namespace Squidex.Domain.Apps.Read.Schemas.Repositories
{ {
Task EnqueueAsync(WebhookJob job, Instant nextAttempt); Task EnqueueAsync(WebhookJob job, Instant nextAttempt);
Task EnqueueAsync(Guid id, Instant nextAttempt);
Task TraceSendingAsync(Guid jobId); Task TraceSendingAsync(Guid jobId);
Task TraceSentAsync(Guid jobId, string dump, WebhookResult result, TimeSpan elapsed, Instant? nextCall); Task TraceSentAsync(Guid jobId, string dump, WebhookResult result, TimeSpan elapsed, Instant? nextCall);

10
src/Squidex.Domain.Apps.Read/Schemas/WebhookDequeuer.cs

@ -33,10 +33,10 @@ namespace Squidex.Domain.Apps.Read.Schemas
private readonly ISemanticLog log; private readonly ISemanticLog log;
private readonly IClock clock; private readonly IClock clock;
public WebhookDequeuer(WebhookSender webhookSender, public WebhookDequeuer(WebhookSender webhookSender,
IWebhookEventRepository webhookEventRepository, IWebhookEventRepository webhookEventRepository,
ISchemaWebhookRepository webhookRepository, ISchemaWebhookRepository webhookRepository,
IClock clock, IClock clock,
ISemanticLog log) ISemanticLog log)
{ {
Guard.NotNull(webhookEventRepository, nameof(webhookEventRepository)); Guard.NotNull(webhookEventRepository, nameof(webhookEventRepository));
@ -57,7 +57,7 @@ namespace Squidex.Domain.Apps.Read.Schemas
new ActionBlock<IWebhookEventEntity>(MakeRequestAsync, new ActionBlock<IWebhookEventEntity>(MakeRequestAsync,
new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 32, BoundedCapacity = 32 }); new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 32, BoundedCapacity = 32 });
blockBlock = blockBlock =
new TransformBlock<IWebhookEventEntity, IWebhookEventEntity>(x => BlockAsync(x), new TransformBlock<IWebhookEventEntity, IWebhookEventEntity>(x => BlockAsync(x),
new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 1, BoundedCapacity = 1 }); new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 1, BoundedCapacity = 1 });

2
src/Squidex.Domain.Apps.Read/Schemas/WebhookEnqueuer.cs

@ -41,7 +41,7 @@ namespace Squidex.Domain.Apps.Read.Schemas
} }
public WebhookEnqueuer(TypeNameRegistry typeNameRegistry, public WebhookEnqueuer(TypeNameRegistry typeNameRegistry,
IWebhookEventRepository webhookEventRepository, IWebhookEventRepository webhookEventRepository,
ISchemaWebhookRepository webhookRepository, ISchemaWebhookRepository webhookRepository,
IClock clock, IClock clock,
JsonSerializer webhookSerializer) JsonSerializer webhookSerializer)

2
src/Squidex.Domain.Apps.Write/Apps/AppClient.cs

@ -23,7 +23,7 @@ namespace Squidex.Domain.Apps.Write.Apps
{ {
Guard.NotNullOrEmpty(name, nameof(name)); Guard.NotNullOrEmpty(name, nameof(name));
Guard.NotNullOrEmpty(secret, nameof(secret)); Guard.NotNullOrEmpty(secret, nameof(secret));
this.name = name; this.name = name;
this.secret = secret; this.secret = secret;
this.isReader = isReader; this.isReader = isReader;

2
src/Squidex.Domain.Apps.Write/Apps/AppDomainObject.cs

@ -47,7 +47,7 @@ namespace Squidex.Domain.Apps.Write.Apps
get { return contributors.Count; } get { return contributors.Count; }
} }
public AppDomainObject(Guid id, int version) public AppDomainObject(Guid id, int version)
: base(id, version) : base(id, version)
{ {
} }

6
src/Squidex.Domain.Apps.Write/Assets/AssetCommandHandler.cs

@ -23,8 +23,8 @@ namespace Squidex.Domain.Apps.Write.Assets
private readonly IAssetThumbnailGenerator assetThumbnailGenerator; private readonly IAssetThumbnailGenerator assetThumbnailGenerator;
public AssetCommandHandler( public AssetCommandHandler(
IAggregateHandler handler, IAggregateHandler handler,
IAssetStore assetStore, IAssetStore assetStore,
IAssetThumbnailGenerator assetThumbnailGenerator) IAssetThumbnailGenerator assetThumbnailGenerator)
{ {
Guard.NotNull(handler, nameof(handler)); Guard.NotNull(handler, nameof(handler));
@ -61,7 +61,7 @@ namespace Squidex.Domain.Apps.Write.Assets
protected async Task On(UpdateAsset command, CommandContext context) protected async Task On(UpdateAsset command, CommandContext context)
{ {
command.ImageInfo = await assetThumbnailGenerator.GetImageInfoAsync(command.File.OpenRead()); command.ImageInfo = await assetThumbnailGenerator.GetImageInfoAsync(command.File.OpenRead());
try try
{ {
var asset = await handler.UpdateAsync<AssetDomainObject>(context, async a => var asset = await handler.UpdateAsync<AssetDomainObject>(context, async a =>

2
src/Squidex.Domain.Apps.Write/Assets/AssetDomainObject.cs

@ -36,7 +36,7 @@ namespace Squidex.Domain.Apps.Write.Assets
get { return fileVersion; } get { return fileVersion; }
} }
public AssetDomainObject(Guid id, int version) public AssetDomainObject(Guid id, int version)
: base(id, version) : base(id, version)
{ {
} }

10
src/Squidex.Domain.Apps.Write/Contents/ContentCommandHandler.cs

@ -36,9 +36,9 @@ namespace Squidex.Domain.Apps.Write.Contents
public ContentCommandHandler( public ContentCommandHandler(
IAggregateHandler handler, IAggregateHandler handler,
IAppProvider appProvider, IAppProvider appProvider,
IAssetRepository assetRepository, IAssetRepository assetRepository,
ISchemaProvider schemas, ISchemaProvider schemas,
IContentRepository contentRepository) IContentRepository contentRepository)
{ {
Guard.NotNull(handler, nameof(handler)); Guard.NotNull(handler, nameof(handler));
@ -109,13 +109,13 @@ namespace Squidex.Domain.Apps.Write.Contents
var taskForSchema = schemas.FindSchemaByIdAsync(command.SchemaId.Id); var taskForSchema = schemas.FindSchemaByIdAsync(command.SchemaId.Id);
await Task.WhenAll(taskForApp, taskForSchema); await Task.WhenAll(taskForApp, taskForSchema);
var schemaObject = taskForSchema.Result.Schema; var schemaObject = taskForSchema.Result.Schema;
var schemaErrors = new List<ValidationError>(); var schemaErrors = new List<ValidationError>();
var appId = command.AppId.Id; var appId = command.AppId.Id;
var validationContext = var validationContext =
new ValidationContext( new ValidationContext(
(contentIds, schemaId) => (contentIds, schemaId) =>
{ {

2
src/Squidex.Domain.Apps.Write/Contents/ContentDomainObject.cs

@ -35,7 +35,7 @@ namespace Squidex.Domain.Apps.Write.Contents
get { return isPublished; } get { return isPublished; }
} }
public ContentDomainObject(Guid id, int version) public ContentDomainObject(Guid id, int version)
: base(id, version) : base(id, version)
{ {
} }

4
src/Squidex.Domain.Apps.Write/Schemas/SchemaCommandHandler.cs

@ -35,8 +35,8 @@ namespace Squidex.Domain.Apps.Write.Schemas
{ {
if (await schemas.FindSchemaByNameAsync(command.AppId.Id, command.Name) != null) if (await schemas.FindSchemaByNameAsync(command.AppId.Id, command.Name) != null)
{ {
var error = var error =
new ValidationError($"A schema with name '{command.Name}' already exists", "Name", new ValidationError($"A schema with name '{command.Name}' already exists", "Name",
nameof(CreateSchema.Name)); nameof(CreateSchema.Name));
throw new ValidationException("Cannot create a new schema", error); throw new ValidationException("Cannot create a new schema", error);

8
src/Squidex.Domain.Apps.Write/Schemas/SchemaDomainObject.cs

@ -222,7 +222,7 @@ namespace Squidex.Domain.Apps.Write.Schemas
Guard.NotNull(command, nameof(command)); Guard.NotNull(command, nameof(command));
VerifyCreatedAndNotDeleted(); VerifyCreatedAndNotDeleted();
RaiseEvent(command, new FieldHidden()); RaiseEvent(command, new FieldHidden());
return this; return this;
@ -233,7 +233,7 @@ namespace Squidex.Domain.Apps.Write.Schemas
Guard.NotNull(command, nameof(command)); Guard.NotNull(command, nameof(command));
VerifyCreatedAndNotDeleted(); VerifyCreatedAndNotDeleted();
RaiseEvent(command, new FieldShown()); RaiseEvent(command, new FieldShown());
return this; return this;
@ -255,7 +255,7 @@ namespace Squidex.Domain.Apps.Write.Schemas
Guard.NotNull(command, nameof(command)); Guard.NotNull(command, nameof(command));
VerifyCreatedAndNotDeleted(); VerifyCreatedAndNotDeleted();
RaiseEvent(command, new FieldEnabled()); RaiseEvent(command, new FieldEnabled());
return this; return this;
@ -266,7 +266,7 @@ namespace Squidex.Domain.Apps.Write.Schemas
Guard.NotNull(command, nameof(command)); Guard.NotNull(command, nameof(command));
VerifyCreatedAndNotDeleted(); VerifyCreatedAndNotDeleted();
RaiseEvent(command, new FieldDeleted()); RaiseEvent(command, new FieldDeleted());
return this; return this;

4
src/Squidex.Domain.Users.MongoDb/Infrastructure/MongoPersistedGrantStore.cs

@ -27,11 +27,11 @@ namespace Squidex.Domain.Users.MongoDb.Infrastructure
}); });
} }
public MongoPersistedGrantStore(IMongoDatabase database) public MongoPersistedGrantStore(IMongoDatabase database)
: base(database) : base(database)
{ {
} }
protected override string CollectionName() protected override string CollectionName()
{ {
return "Identity_PersistedGrants"; return "Identity_PersistedGrants";

18
src/Squidex.Domain.Users.MongoDb/MongoUserStore.cs

@ -20,15 +20,15 @@ using Squidex.Shared.Users;
namespace Squidex.Domain.Users.MongoDb namespace Squidex.Domain.Users.MongoDb
{ {
public sealed class MongoUserStore : public sealed class MongoUserStore :
IUserPasswordStore<IUser>, IUserPasswordStore<IUser>,
IUserRoleStore<IUser>, IUserRoleStore<IUser>,
IUserLoginStore<IUser>, IUserLoginStore<IUser>,
IUserSecurityStampStore<IUser>, IUserSecurityStampStore<IUser>,
IUserEmailStore<IUser>, IUserEmailStore<IUser>,
IUserClaimStore<IUser>, IUserClaimStore<IUser>,
IUserPhoneNumberStore<IUser>, IUserPhoneNumberStore<IUser>,
IUserTwoFactorStore<IUser>, IUserTwoFactorStore<IUser>,
IUserLockoutStore<IUser>, IUserLockoutStore<IUser>,
IUserAuthenticationTokenStore<IUser>, IUserAuthenticationTokenStore<IUser>,
IUserFactory, IUserFactory,
IUserResolver, IUserResolver,

2
src/Squidex.Infrastructure.Azure/Assets/AzureBlobAssetStore.cs

@ -100,7 +100,7 @@ namespace Squidex.Infrastructure.Assets
blobRef.Metadata[AssetVersion] = version.ToString(); blobRef.Metadata[AssetVersion] = version.ToString();
blobRef.Metadata[AssetId] = id; blobRef.Metadata[AssetId] = id;
await blobRef.UploadFromStreamAsync(stream); await blobRef.UploadFromStreamAsync(stream);
await blobRef.SetMetadataAsync(); await blobRef.SetMetadataAsync();
} }

4
src/Squidex.Infrastructure.GetEventStore/CQRS/Events/Formatter.cs

@ -24,8 +24,8 @@ namespace Squidex.Infrastructure.CQRS.Events
var eventData = new EventData { Type = @event.EventType, EventId = @event.EventId, Payload = body, Metadata = meta }; var eventData = new EventData { Type = @event.EventType, EventId = @event.EventId, Payload = body, Metadata = meta };
return new StoredEvent( return new StoredEvent(
resolvedEvent.OriginalEventNumber.ToString(), resolvedEvent.OriginalEventNumber.ToString(),
resolvedEvent.Event.EventNumber, resolvedEvent.Event.EventNumber,
eventData); eventData);
} }

2
src/Squidex.Infrastructure.MongoDb/CQRS/Events/MongoEventConsumerInfoRepository.cs

@ -26,7 +26,7 @@ namespace Squidex.Infrastructure.CQRS.Events
private static readonly FieldDefinition<MongoEventConsumerInfo, bool> IsStoppedField = Fields.Build(x => x.IsStopped); private static readonly FieldDefinition<MongoEventConsumerInfo, bool> IsStoppedField = Fields.Build(x => x.IsStopped);
private static readonly FieldDefinition<MongoEventConsumerInfo, bool> IsResettingField = Fields.Build(x => x.IsResetting); private static readonly FieldDefinition<MongoEventConsumerInfo, bool> IsResettingField = Fields.Build(x => x.IsResetting);
public MongoEventConsumerInfoRepository(IMongoDatabase database) public MongoEventConsumerInfoRepository(IMongoDatabase database)
: base(database) : base(database)
{ {
} }

4
src/Squidex.Infrastructure.MongoDb/MongoDb/IMongoEntity.cs

@ -14,9 +14,9 @@ namespace Squidex.Infrastructure.MongoDb
public interface IMongoEntity public interface IMongoEntity
{ {
Guid Id { get; set; } Guid Id { get; set; }
Instant Created { get; set; } Instant Created { get; set; }
Instant LastModified { get; set; } Instant LastModified { get; set; }
} }
} }

6
src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageStore.cs

@ -19,11 +19,11 @@ namespace Squidex.Infrastructure.UsageTracking
{ {
private static readonly UpdateOptions Upsert = new UpdateOptions { IsUpsert = true }; private static readonly UpdateOptions Upsert = new UpdateOptions { IsUpsert = true };
public MongoUsageStore(IMongoDatabase database) public MongoUsageStore(IMongoDatabase database)
: base(database) : base(database)
{ {
} }
protected override string CollectionName() protected override string CollectionName()
{ {
return "Usages"; return "Usages";
@ -38,7 +38,7 @@ namespace Squidex.Infrastructure.UsageTracking
{ {
var id = $"{key}_{date:yyyy-MM-dd}"; var id = $"{key}_{date:yyyy-MM-dd}";
return Collection.UpdateOneAsync(x => x.Id == id, return Collection.UpdateOneAsync(x => x.Id == id,
Update Update
.Inc(x => x.TotalCount, count) .Inc(x => x.TotalCount, count)
.Inc(x => x.TotalElapsedMs, elapsedMs) .Inc(x => x.TotalElapsedMs, elapsedMs)

4
src/Squidex.Infrastructure/Assets/AssetNotFoundException.cs

@ -16,12 +16,12 @@ namespace Squidex.Infrastructure.Assets
{ {
} }
public AssetNotFoundException(string message) public AssetNotFoundException(string message)
: base(message) : base(message)
{ {
} }
public AssetNotFoundException(string message, Exception inner) public AssetNotFoundException(string message, Exception inner)
: base(message, inner) : base(message, inner)
{ {
} }

2
src/Squidex.Infrastructure/Assets/FolderAssetStore.cs

@ -123,7 +123,7 @@ namespace Squidex.Infrastructure.Assets
private FileInfo GetFile(string id, long version, string suffix) private FileInfo GetFile(string id, long version, string suffix)
{ {
Guard.NotNullOrEmpty(id, nameof(id)); Guard.NotNullOrEmpty(id, nameof(id));
return GetFile(GetPath(id, version, suffix)); return GetFile(GetPath(id, version, suffix));
} }

2
src/Squidex.Infrastructure/CQRS/Commands/AggregateHandler.cs

@ -28,7 +28,7 @@ namespace Squidex.Infrastructure.CQRS.Commands
} }
public AggregateHandler( public AggregateHandler(
IDomainObjectFactory domainObjectFactory, IDomainObjectFactory domainObjectFactory,
IDomainObjectRepository domainObjectRepository) IDomainObjectRepository domainObjectRepository)
{ {
Guard.NotNull(domainObjectFactory, nameof(domainObjectFactory)); Guard.NotNull(domainObjectFactory, nameof(domainObjectFactory));

2
src/Squidex.Infrastructure/CQRS/Commands/CommandContext.cs

@ -16,7 +16,7 @@ namespace Squidex.Infrastructure.CQRS.Commands
private readonly Guid contextId = Guid.NewGuid(); private readonly Guid contextId = Guid.NewGuid();
private Exception exception; private Exception exception;
private Tuple<object> result; private Tuple<object> result;
public ICommand Command public ICommand Command
{ {
get { return command; } get { return command; }

2
src/Squidex.Infrastructure/CQRS/Commands/CommandingExtensions.cs

@ -29,7 +29,7 @@ namespace Squidex.Infrastructure.CQRS.Commands
return handler.UpdateAsync<T>(context, x => return handler.UpdateAsync<T>(context, x =>
{ {
updater(x); updater(x);
return TaskHelper.Done; return TaskHelper.Done;
}); });
} }

2
src/Squidex.Infrastructure/CQRS/Commands/DefaultDomainObjectRepository.cs

@ -22,7 +22,7 @@ namespace Squidex.Infrastructure.CQRS.Commands
private readonly EventDataFormatter formatter; private readonly EventDataFormatter formatter;
public DefaultDomainObjectRepository( public DefaultDomainObjectRepository(
IDomainObjectFactory factory, IDomainObjectFactory factory,
IEventStore eventStore, IEventStore eventStore,
IStreamNameResolver nameResolver, IStreamNameResolver nameResolver,
EventDataFormatter formatter) EventDataFormatter formatter)

2
src/Squidex.Infrastructure/CQRS/Commands/InMemoryCommandBus.cs

@ -19,7 +19,7 @@ namespace Squidex.Infrastructure.CQRS.Commands
public InMemoryCommandBus(IEnumerable<ICommandHandler> handlers) public InMemoryCommandBus(IEnumerable<ICommandHandler> handlers)
{ {
Guard.NotNull(handlers, nameof(handlers)); Guard.NotNull(handlers, nameof(handlers));
this.handlers = handlers; this.handlers = handlers;
} }

4
src/Squidex.Infrastructure/CQRS/Events/EventData.cs

@ -15,9 +15,9 @@ namespace Squidex.Infrastructure.CQRS.Events
public Guid EventId { get; set; } public Guid EventId { get; set; }
public string Payload { get; set; } public string Payload { get; set; }
public string Metadata { get; set; } public string Metadata { get; set; }
public string Type { get; set; } public string Type { get; set; }
} }
} }

2
src/Squidex.Infrastructure/CQRS/Events/EventReceiver.cs

@ -121,7 +121,7 @@ namespace Squidex.Infrastructure.CQRS.Events
return; return;
} }
if (currentSubscription == null) if (currentSubscription == null)
{ {
await SubscribeAsync(eventConsumer, position); await SubscribeAsync(eventConsumer, position);

2
src/Squidex.Infrastructure/CQRS/Events/IEventStore.cs

@ -15,7 +15,7 @@ namespace Squidex.Infrastructure.CQRS.Events
public interface IEventStore public interface IEventStore
{ {
Task<IReadOnlyList<StoredEvent>> GetEventsAsync(string streamName); Task<IReadOnlyList<StoredEvent>> GetEventsAsync(string streamName);
Task AppendEventsAsync(Guid commitId, string streamName, int expectedVersion, ICollection<EventData> events); Task AppendEventsAsync(Guid commitId, string streamName, int expectedVersion, ICollection<EventData> events);
IEventSubscription CreateSubscription(string streamFilter = null, string position = null); IEventSubscription CreateSubscription(string streamFilter = null, string position = null);

4
src/Squidex.Infrastructure/ConfigurationException.cs

@ -16,12 +16,12 @@ namespace Squidex.Infrastructure
{ {
} }
public ConfigurationException(string message) public ConfigurationException(string message)
: base(message) : base(message)
{ {
} }
public ConfigurationException(string message, Exception inner) public ConfigurationException(string message, Exception inner)
: base(message, inner) : base(message, inner)
{ {
} }

8
src/Squidex.Infrastructure/DisposableObjectBase.cs

@ -22,14 +22,14 @@ namespace Squidex.Infrastructure
return isDisposed; return isDisposed;
} }
} }
public void Dispose() public void Dispose()
{ {
Dispose(true); Dispose(true);
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
protected void Dispose(bool disposing) protected void Dispose(bool disposing)
{ {
if (isDisposed) if (isDisposed)
@ -47,9 +47,9 @@ namespace Squidex.Infrastructure
isDisposed = true; isDisposed = true;
} }
protected abstract void DisposeObject(bool disposing); protected abstract void DisposeObject(bool disposing);
protected void ThrowIfDisposed() protected void ThrowIfDisposed()
{ {
if (isDisposed) if (isDisposed)

4
src/Squidex.Infrastructure/DomainException.cs

@ -12,12 +12,12 @@ namespace Squidex.Infrastructure
{ {
public class DomainException : Exception public class DomainException : Exception
{ {
public DomainException(string message) public DomainException(string message)
: base(message) : base(message)
{ {
} }
public DomainException(string message, Exception inner) public DomainException(string message, Exception inner)
: base(message, inner) : base(message, inner)
{ {
} }

2
src/Squidex.Infrastructure/GravatarHelper.cs

@ -37,7 +37,7 @@ namespace Squidex.Infrastructure
var hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(normalizedEmail)); var hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(normalizedEmail));
var hashBuilder = new StringBuilder(); var hashBuilder = new StringBuilder();
for (var i = 0; i < hashBytes.Length; i++) for (var i = 0; i < hashBytes.Length; i++)
{ {
hashBuilder.Append(hashBytes[i].ToString("x2")); hashBuilder.Append(hashBytes[i].ToString("x2"));

4
src/Squidex.Infrastructure/Log/SemanticLog.cs

@ -19,8 +19,8 @@ namespace Squidex.Infrastructure.Log
private readonly Func<IObjectWriter> writerFactory; private readonly Func<IObjectWriter> writerFactory;
public SemanticLog( public SemanticLog(
IEnumerable<ILogChannel> channels, IEnumerable<ILogChannel> channels,
IEnumerable<ILogAppender> appenders, IEnumerable<ILogAppender> appenders,
Func<IObjectWriter> writerFactory) Func<IObjectWriter> writerFactory)
{ {
Guard.NotNull(channels, nameof(channels)); Guard.NotNull(channels, nameof(channels));

4
src/Squidex.Infrastructure/PropertiesBag.cs

@ -16,7 +16,7 @@ namespace Squidex.Infrastructure
{ {
private static readonly PropertyValue FallbackValue = new PropertyValue(null); private static readonly PropertyValue FallbackValue = new PropertyValue(null);
private readonly Dictionary<string, PropertyValue> internalDictionary = new Dictionary<string, PropertyValue>(StringComparer.OrdinalIgnoreCase); private readonly Dictionary<string, PropertyValue> internalDictionary = new Dictionary<string, PropertyValue>(StringComparer.OrdinalIgnoreCase);
public int Count public int Count
{ {
get { return internalDictionary.Count; } get { return internalDictionary.Count; }
@ -46,7 +46,7 @@ namespace Squidex.Infrastructure
{ {
return internalDictionary.Keys; return internalDictionary.Keys;
} }
public override bool TryGetMember(GetMemberBinder binder, out object result) public override bool TryGetMember(GetMemberBinder binder, out object result)
{ {
result = this[binder.Name]; result = this[binder.Name];

24
src/Squidex.Infrastructure/PropertyValue.cs

@ -67,32 +67,32 @@ namespace Squidex.Infrastructure
return true; return true;
} }
public override string ToString() public override string ToString()
{ {
return rawValue?.ToString(); return rawValue?.ToString();
} }
public bool ToBoolean(CultureInfo culture) public bool ToBoolean(CultureInfo culture)
{ {
return ToOrParseValue(culture, ParseBoolean); return ToOrParseValue(culture, ParseBoolean);
} }
public bool? ToNullableBoolean(CultureInfo culture) public bool? ToNullableBoolean(CultureInfo culture)
{ {
return ToNullableOrParseValue(culture, ParseBoolean); return ToNullableOrParseValue(culture, ParseBoolean);
} }
public float ToSingle(CultureInfo culture) public float ToSingle(CultureInfo culture)
{ {
return ToOrParseValue(culture, x => float.Parse(x, culture)); return ToOrParseValue(culture, x => float.Parse(x, culture));
} }
public float? ToNullableSingle(CultureInfo culture) public float? ToNullableSingle(CultureInfo culture)
{ {
return ToNullableOrParseValue(culture, x => float.Parse(x, culture)); return ToNullableOrParseValue(culture, x => float.Parse(x, culture));
} }
public double ToDouble(CultureInfo culture) public double ToDouble(CultureInfo culture)
{ {
return ToOrParseValue(culture, x => double.Parse(x, culture)); return ToOrParseValue(culture, x => double.Parse(x, culture));
@ -102,32 +102,32 @@ namespace Squidex.Infrastructure
{ {
return ToNullableOrParseValue(culture, x => double.Parse(x, culture)); return ToNullableOrParseValue(culture, x => double.Parse(x, culture));
} }
public int ToInt32(CultureInfo culture) public int ToInt32(CultureInfo culture)
{ {
return ToOrParseValue(culture, x => int.Parse(x, culture)); return ToOrParseValue(culture, x => int.Parse(x, culture));
} }
public int? ToNullableInt32(CultureInfo culture) public int? ToNullableInt32(CultureInfo culture)
{ {
return ToNullableOrParseValue(culture, x => int.Parse(x, culture)); return ToNullableOrParseValue(culture, x => int.Parse(x, culture));
} }
public long ToInt64(CultureInfo culture) public long ToInt64(CultureInfo culture)
{ {
return ToOrParseValue(culture, x => long.Parse(x, culture)); return ToOrParseValue(culture, x => long.Parse(x, culture));
} }
public long? ToNullableInt64(CultureInfo culture) public long? ToNullableInt64(CultureInfo culture)
{ {
return ToNullableOrParseValue(culture, x => long.Parse(x, culture)); return ToNullableOrParseValue(culture, x => long.Parse(x, culture));
} }
public Instant ToInstant(CultureInfo culture) public Instant ToInstant(CultureInfo culture)
{ {
return ToOrParseValue(culture, x => InstantPattern.General.Parse(x).Value); return ToOrParseValue(culture, x => InstantPattern.General.Parse(x).Value);
} }
public Instant? ToNullableInstant(CultureInfo culture) public Instant? ToNullableInstant(CultureInfo culture)
{ {
return ToNullableOrParseValue(culture, x => InstantPattern.General.Parse(x).Value); return ToNullableOrParseValue(culture, x => InstantPattern.General.Parse(x).Value);

2
src/Squidex.Infrastructure/Reflection/IPropertyAccessor.cs

@ -11,7 +11,7 @@ namespace Squidex.Infrastructure.Reflection
public interface IPropertyAccessor public interface IPropertyAccessor
{ {
object Get(object target); object Get(object target);
void Set(object target, object value); void Set(object target, object value);
} }
} }

2
src/Squidex.Infrastructure/Reflection/PropertiesTypeAccessor.cs

@ -18,7 +18,7 @@ namespace Squidex.Infrastructure.Reflection
private static readonly ConcurrentDictionary<Type, PropertiesTypeAccessor> AccessorCache = new ConcurrentDictionary<Type, PropertiesTypeAccessor>(); private static readonly ConcurrentDictionary<Type, PropertiesTypeAccessor> AccessorCache = new ConcurrentDictionary<Type, PropertiesTypeAccessor>();
private readonly Dictionary<string, IPropertyAccessor> accessors = new Dictionary<string, IPropertyAccessor>(); private readonly Dictionary<string, IPropertyAccessor> accessors = new Dictionary<string, IPropertyAccessor>();
private readonly List<PropertyInfo> properties = new List<PropertyInfo>(); private readonly List<PropertyInfo> properties = new List<PropertyInfo>();
public IEnumerable<PropertyInfo> Properties public IEnumerable<PropertyInfo> Properties
{ {
get get

4
src/Squidex.Infrastructure/Reflection/PropertyAccessor.cs

@ -51,7 +51,7 @@ namespace Squidex.Infrastructure.Reflection
} }
private readonly IPropertyAccessor internalAccessor; private readonly IPropertyAccessor internalAccessor;
public PropertyAccessor(Type targetType, PropertyInfo propertyInfo) public PropertyAccessor(Type targetType, PropertyInfo propertyInfo)
{ {
Guard.NotNull(targetType, nameof(targetType)); Guard.NotNull(targetType, nameof(targetType));
@ -59,7 +59,7 @@ namespace Squidex.Infrastructure.Reflection
internalAccessor = (IPropertyAccessor)Activator.CreateInstance(typeof(PropertyWrapper<,>).MakeGenericType(propertyInfo.DeclaringType, propertyInfo.PropertyType), propertyInfo); internalAccessor = (IPropertyAccessor)Activator.CreateInstance(typeof(PropertyWrapper<,>).MakeGenericType(propertyInfo.DeclaringType, propertyInfo.PropertyType), propertyInfo);
} }
public object Get(object target) public object Get(object target)
{ {
Guard.NotNull(target, nameof(target)); Guard.NotNull(target, nameof(target));

2
src/Squidex.Infrastructure/Timers/CompletionTimer.cs

@ -24,7 +24,7 @@ namespace Squidex.Infrastructure.Timers
private readonly Task runTask; private readonly Task runTask;
private int oneCallState; private int oneCallState;
private CancellationTokenSource wakeupToken; private CancellationTokenSource wakeupToken;
public CompletionTimer(int delayInMs, Func<CancellationToken, Task> callback, int initialDelay = 0) public CompletionTimer(int delayInMs, Func<CancellationToken, Task> callback, int initialDelay = 0)
{ {
Guard.NotNull(callback, nameof(callback)); Guard.NotNull(callback, nameof(callback));

2
src/Squidex.Infrastructure/ValidationException.cs

@ -34,7 +34,7 @@ namespace Squidex.Infrastructure
this.errors = errors ?? FallbackErrors; this.errors = errors ?? FallbackErrors;
} }
public ValidationException(string message, Exception inner, params ValidationError[] errors) public ValidationException(string message, Exception inner, params ValidationError[] errors)
: base(message, inner) : base(message, inner)
{ {
this.errors = errors != null ? errors.ToList() : FallbackErrors; this.errors = errors != null ? errors.ToList() : FallbackErrors;

2
src/Squidex/Config/Domain/StoreMongoDbModule.cs

@ -182,7 +182,7 @@ namespace Squidex.Config.Domain
builder.Register(c => builder.Register(c =>
new CompoundEventConsumer( new CompoundEventConsumer(
c.Resolve<MongoSchemaRepository>(), c.Resolve<MongoSchemaRepository>(),
c.Resolve<CachingGraphQLService>(), c.Resolve<CachingGraphQLService>(),
c.Resolve<CachingSchemaProvider>())) c.Resolve<CachingSchemaProvider>()))
.As<IEventConsumer>() .As<IEventConsumer>()

4
src/Squidex/Config/Identity/IdentityServices.cs

@ -46,7 +46,7 @@ namespace Squidex.Config.Identity
{ {
throw new ConfigurationException("Configure KeyStore Redis configuration with 'identity:keysStore:redis:configuration'."); throw new ConfigurationException("Configure KeyStore Redis configuration with 'identity:keysStore:redis:configuration'.");
} }
var connectionMultiplexer = Singletons<ConnectionMultiplexer>.GetOrAdd(redisConfiguration, s => ConnectionMultiplexer.Connect(s)); var connectionMultiplexer = Singletons<ConnectionMultiplexer>.GetOrAdd(redisConfiguration, s => ConnectionMultiplexer.Connect(s));
dataProtection.PersistKeysToRedis(connectionMultiplexer); dataProtection.PersistKeysToRedis(connectionMultiplexer);
@ -81,7 +81,7 @@ namespace Squidex.Config.Identity
var certData = new byte[certStream.Length]; var certData = new byte[certStream.Length];
certStream.Read(certData, 0, certData.Length); certStream.Read(certData, 0, certData.Length);
certificate = new X509Certificate2(certData, "password", certificate = new X509Certificate2(certData, "password",
X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.MachineKeySet |
X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.PersistKeySet |
X509KeyStorageFlags.Exportable); X509KeyStorageFlags.Exportable);

2
src/Squidex/Config/MyUrlsOptions.cs

@ -22,7 +22,7 @@ namespace Squidex.Config
{ {
throw new ConfigurationException("Configure BaseUrl with 'urls:baseUrl'."); throw new ConfigurationException("Configure BaseUrl with 'urls:baseUrl'.");
} }
return BaseUrl.BuildFullUrl(path, trailingSlash); return BaseUrl.BuildFullUrl(path, trailingSlash);
} }
} }

2
src/Squidex/Controllers/Api/Apps/AppClientsController.cs

@ -79,7 +79,7 @@ namespace Squidex.Controllers.Api.Apps
var command = SimpleMapper.Map(request, new AttachClient()); var command = SimpleMapper.Map(request, new AttachClient());
await CommandBus.PublishAsync(command); await CommandBus.PublishAsync(command);
var response = SimpleMapper.Map(command, new ClientDto { Name = command .Id }); var response = SimpleMapper.Map(command, new ClientDto { Name = command .Id });
return CreatedAtAction(nameof(GetClients), new { app }, response); return CreatedAtAction(nameof(GetClients), new { app }, response);

2
src/Squidex/Controllers/Api/Apps/AppContributorsController.cs

@ -31,7 +31,7 @@ namespace Squidex.Controllers.Api.Apps
{ {
private readonly IAppPlansProvider appPlansProvider; private readonly IAppPlansProvider appPlansProvider;
public AppContributorsController(ICommandBus commandBus, IAppPlansProvider appPlansProvider) public AppContributorsController(ICommandBus commandBus, IAppPlansProvider appPlansProvider)
: base(commandBus) : base(commandBus)
{ {
this.appPlansProvider = appPlansProvider; this.appPlansProvider = appPlansProvider;

6
src/Squidex/Controllers/Api/Apps/AppLanguagesController.cs

@ -50,8 +50,8 @@ namespace Squidex.Controllers.Api.Apps
[ProducesResponseType(typeof(LanguageDto[]), 200)] [ProducesResponseType(typeof(LanguageDto[]), 200)]
public IActionResult GetLanguages(string app) public IActionResult GetLanguages(string app)
{ {
var response = App.LanguagesConfig.OfType<LanguageConfig>().Select(x => var response = App.LanguagesConfig.OfType<LanguageConfig>().Select(x =>
SimpleMapper.Map(x.Language, SimpleMapper.Map(x.Language,
new AppLanguageDto new AppLanguageDto
{ {
IsMaster = x == App.LanguagesConfig.Master, IsMaster = x == App.LanguagesConfig.Master,
@ -107,7 +107,7 @@ namespace Squidex.Controllers.Api.Apps
public async Task<IActionResult> Update(string app, string language, [FromBody] UpdateAppLanguageDto request) public async Task<IActionResult> Update(string app, string language, [FromBody] UpdateAppLanguageDto request)
{ {
await CommandBus.PublishAsync(SimpleMapper.Map(request, new UpdateLanguage { Language = language })); await CommandBus.PublishAsync(SimpleMapper.Map(request, new UpdateLanguage { Language = language }));
return NoContent(); return NoContent();
} }

2
src/Squidex/Controllers/Api/Apps/AppsController.cs

@ -32,7 +32,7 @@ namespace Squidex.Controllers.Api.Apps
{ {
private readonly IAppRepository appRepository; private readonly IAppRepository appRepository;
public AppsController(ICommandBus commandBus, IAppRepository appRepository) public AppsController(ICommandBus commandBus, IAppRepository appRepository)
: base(commandBus) : base(commandBus)
{ {
this.appRepository = appRepository; this.appRepository = appRepository;

2
src/Squidex/Controllers/Api/Apps/Models/AppDto.cs

@ -33,7 +33,7 @@ namespace Squidex.Controllers.Api.Apps.Models
/// The id of the app. /// The id of the app.
/// </summary> /// </summary>
public Guid Id { get; set; } public Guid Id { get; set; }
/// <summary> /// <summary>
/// The timestamp when the app has been created. /// The timestamp when the app has been created.
/// </summary> /// </summary>

4
src/Squidex/Controllers/Api/Apps/Models/ClientDto.cs

@ -13,13 +13,13 @@ namespace Squidex.Controllers.Api.Apps.Models
public class ClientDto public class ClientDto
{ {
/// <summary> /// <summary>
/// The client id. /// The client id.
/// </summary> /// </summary>
[Required] [Required]
public string Id { get; set; } public string Id { get; set; }
/// <summary> /// <summary>
/// The client secret. /// The client secret.
/// </summary> /// </summary>
[Required] [Required]
public string Secret { get; set; } public string Secret { get; set; }

4
src/Squidex/Controllers/Api/Assets/AssetsController.cs

@ -43,11 +43,11 @@ namespace Squidex.Controllers.Api.Assets
private readonly AssetConfig assetsConfig; private readonly AssetConfig assetsConfig;
public AssetsController( public AssetsController(
ICommandBus commandBus, ICommandBus commandBus,
IAssetRepository assetRepository, IAssetRepository assetRepository,
IAssetStatsRepository assetStatsRepository, IAssetStatsRepository assetStatsRepository,
IAppPlansProvider appPlanProvider, IAppPlansProvider appPlanProvider,
IOptions<AssetConfig> assetsConfig) IOptions<AssetConfig> assetsConfig)
: base(commandBus) : base(commandBus)
{ {
this.assetsConfig = assetsConfig.Value; this.assetsConfig = assetsConfig.Value;

2
src/Squidex/Controllers/Api/Assets/Models/AssetDto.cs

@ -31,7 +31,7 @@ namespace Squidex.Controllers.Api.Assets.Models
/// </summary> /// </summary>
[Required] [Required]
public string MimeType { get; set; } public string MimeType { get; set; }
/// <summary> /// <summary>
/// The file type. /// The file type.
/// </summary> /// </summary>

2
src/Squidex/Controllers/Api/History/HistoryController.cs

@ -29,7 +29,7 @@ namespace Squidex.Controllers.Api.History
{ {
private readonly IHistoryEventRepository historyEventRepository; private readonly IHistoryEventRepository historyEventRepository;
public HistoryController(ICommandBus commandBus, IHistoryEventRepository historyEventRepository) public HistoryController(ICommandBus commandBus, IHistoryEventRepository historyEventRepository)
: base(commandBus) : base(commandBus)
{ {
this.historyEventRepository = historyEventRepository; this.historyEventRepository = historyEventRepository;

6
src/Squidex/Controllers/Api/Plans/AppPlansController.cs

@ -33,8 +33,8 @@ namespace Squidex.Controllers.Api.Plans
private readonly IAppPlansProvider appPlansProvider; private readonly IAppPlansProvider appPlansProvider;
private readonly IAppPlanBillingManager appPlansBillingManager; private readonly IAppPlanBillingManager appPlansBillingManager;
public AppPlansController(ICommandBus commandBus, public AppPlansController(ICommandBus commandBus,
IAppPlansProvider appPlansProvider, IAppPlansProvider appPlansProvider,
IAppPlanBillingManager appPlansBillingManager) IAppPlanBillingManager appPlansBillingManager)
: base(commandBus) : base(commandBus)
{ {
@ -58,7 +58,7 @@ namespace Squidex.Controllers.Api.Plans
public IActionResult GetPlans(string app) public IActionResult GetPlans(string app)
{ {
var planId = appPlansProvider.GetPlanForApp(App).Id; var planId = appPlansProvider.GetPlanForApp(App).Id;
var response = new AppPlansDto var response = new AppPlansDto
{ {
CurrentPlanId = planId, CurrentPlanId = planId,

2
src/Squidex/Controllers/Api/Schemas/Models/Converters/JsonInheritanceConverter.cs

@ -40,7 +40,7 @@ namespace Squidex.Controllers.Api.Schemas.Models.Converters
return IsWriting = false; return IsWriting = false;
} }
} }
public override bool CanRead public override bool CanRead
{ {
get get

69
src/Squidex/Controllers/Api/Schemas/Models/Converters/SchemaConverter.cs

@ -20,41 +20,42 @@ namespace Squidex.Controllers.Api.Schemas.Models.Converters
{ {
public static class SchemaConverter public static class SchemaConverter
{ {
private static readonly Dictionary<Type, Func<FieldProperties, FieldPropertiesDto>> Factories = new Dictionary<Type, Func<FieldProperties, FieldPropertiesDto>> private static readonly Dictionary<Type, Func<FieldProperties, FieldPropertiesDto>> Factories =
{ new Dictionary<Type, Func<FieldProperties, FieldPropertiesDto>>
{
typeof(NumberFieldProperties),
p => Convert((NumberFieldProperties)p)
},
{
typeof(DateTimeFieldProperties),
p => Convert((DateTimeFieldProperties)p)
},
{
typeof(JsonFieldProperties),
p => Convert((JsonFieldProperties)p)
},
{
typeof(StringFieldProperties),
p => Convert((StringFieldProperties)p)
},
{ {
typeof(BooleanFieldProperties), {
p => Convert((BooleanFieldProperties)p) typeof(NumberFieldProperties),
}, p => Convert((NumberFieldProperties)p)
{ },
typeof(GeolocationFieldProperties), {
p => Convert((GeolocationFieldProperties)p) typeof(DateTimeFieldProperties),
}, p => Convert((DateTimeFieldProperties)p)
{ },
typeof(AssetsFieldProperties), {
p => Convert((AssetsFieldProperties)p) typeof(JsonFieldProperties),
}, p => Convert((JsonFieldProperties)p)
{ },
typeof(ReferencesFieldProperties), {
p => Convert((ReferencesFieldProperties)p) typeof(StringFieldProperties),
} p => Convert((StringFieldProperties)p)
}; },
{
typeof(BooleanFieldProperties),
p => Convert((BooleanFieldProperties)p)
},
{
typeof(GeolocationFieldProperties),
p => Convert((GeolocationFieldProperties)p)
},
{
typeof(AssetsFieldProperties),
p => Convert((AssetsFieldProperties)p)
},
{
typeof(ReferencesFieldProperties),
p => Convert((ReferencesFieldProperties)p)
}
};
public static SchemaDto ToModel(this ISchemaEntity entity) public static SchemaDto ToModel(this ISchemaEntity entity)
{ {

2
src/Squidex/Controllers/Api/Schemas/Models/SchemaDetailsDto.cs

@ -15,7 +15,7 @@ using Squidex.Infrastructure;
namespace Squidex.Controllers.Api.Schemas.Models namespace Squidex.Controllers.Api.Schemas.Models
{ {
public sealed class SchemaDetailsDto public sealed class SchemaDetailsDto
{ {
/// <summary> /// <summary>
/// The id of the schema. /// The id of the schema.
/// </summary> /// </summary>

2
src/Squidex/Controllers/Api/Schemas/Models/SchemaDto.cs

@ -19,7 +19,7 @@ namespace Squidex.Controllers.Api.Schemas.Models
/// The id of the schema. /// The id of the schema.
/// </summary> /// </summary>
public Guid Id { get; set; } public Guid Id { get; set; }
/// <summary> /// <summary>
/// The name of the schema. Unique within the app. /// The name of the schema. Unique within the app.
/// </summary> /// </summary>

7
src/Squidex/Controllers/Api/Schemas/SchemaFieldsController.cs

@ -50,7 +50,12 @@ namespace Squidex.Controllers.Api.Schemas
[ApiCosts(1)] [ApiCosts(1)]
public async Task<IActionResult> PostField(string app, string name, [FromBody] AddFieldDto request) public async Task<IActionResult> PostField(string app, string name, [FromBody] AddFieldDto request)
{ {
var command = new AddField { Name = request.Name, Partitioning = request.Partitioning, Properties = request.Properties.ToProperties() }; var command = new AddField
{
Name = request.Name,
Partitioning = request.Partitioning,
Properties = request.Properties.ToProperties()
};
var context = await CommandBus.PublishAsync(command); var context = await CommandBus.PublishAsync(command);

4
src/Squidex/Controllers/Api/Schemas/SchemasController.cs

@ -33,7 +33,7 @@ namespace Squidex.Controllers.Api.Schemas
public class SchemasController : ControllerBase public class SchemasController : ControllerBase
{ {
private readonly ISchemaRepository schemaRepository; private readonly ISchemaRepository schemaRepository;
public SchemasController(ICommandBus commandBus, ISchemaRepository schemaRepository) public SchemasController(ICommandBus commandBus, ISchemaRepository schemaRepository)
: base(commandBus) : base(commandBus)
{ {
@ -107,7 +107,7 @@ namespace Squidex.Controllers.Api.Schemas
/// <param name="app">The name of the app.</param> /// <param name="app">The name of the app.</param>
/// <param name="request">The schema object that needs to be added to the app.</param> /// <param name="request">The schema object that needs to be added to the app.</param>
/// <returns> /// <returns>
/// 201 => Schema created. /// 201 => Schema created.
/// 400 => Schema name or properties are not valid. /// 400 => Schema name or properties are not valid.
/// 409 => Schema name already in use. /// 409 => Schema name already in use.
/// </returns> /// </returns>

4
src/Squidex/Controllers/Api/Statistics/UsagesController.cs

@ -34,9 +34,9 @@ namespace Squidex.Controllers.Api.Statistics
private readonly IAssetStatsRepository assetStatsRepository; private readonly IAssetStatsRepository assetStatsRepository;
public UsagesController( public UsagesController(
ICommandBus commandBus, ICommandBus commandBus,
IUsageTracker usageTracker, IUsageTracker usageTracker,
IAppPlansProvider appPlanProvider, IAppPlansProvider appPlanProvider,
IAssetStatsRepository assetStatsRepository) IAssetStatsRepository assetStatsRepository)
: base(commandBus) : base(commandBus)
{ {

2
src/Squidex/Controllers/Api/Users/Models/UpdateUserDto.cs

@ -18,7 +18,7 @@ namespace Squidex.Controllers.Api.Users.Models
[Required] [Required]
public string DisplayName { get; set; } public string DisplayName { get; set; }
public string Password { get; set; } public string Password { get; set; }
} }
} }

15
src/Squidex/Controllers/Api/Webhooks/Models/WebhookEventDto.cs

@ -15,6 +15,16 @@ namespace Squidex.Controllers.Api.Webhooks.Models
{ {
public class WebhookEventDto public class WebhookEventDto
{ {
/// <summary>
/// The id of the event.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// The time when the event has been created.
/// </summary>
public Instant Created { get; set; }
/// <summary> /// <summary>
/// The request url. /// The request url.
/// </summary> /// </summary>
@ -27,11 +37,6 @@ namespace Squidex.Controllers.Api.Webhooks.Models
[Required] [Required]
public string EventName { get; set; } public string EventName { get; set; }
/// <summary>
/// The webhook event id.
/// </summary>
public Guid Id { get; set; }
/// <summary> /// <summary>
/// The last dump. /// The last dump.
/// </summary> /// </summary>

47
src/Squidex/Controllers/Api/Webhooks/WebhooksController.cs

@ -11,6 +11,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
using NodaTime;
using NSwag.Annotations; using NSwag.Annotations;
using Squidex.Controllers.Api.Webhooks.Models; using Squidex.Controllers.Api.Webhooks.Models;
using Squidex.Domain.Apps.Read.Schemas.Repositories; using Squidex.Domain.Apps.Read.Schemas.Repositories;
@ -20,7 +21,7 @@ using Squidex.Infrastructure.Reflection;
using Squidex.Pipeline; using Squidex.Pipeline;
namespace Squidex.Controllers.Api.Webhooks namespace Squidex.Controllers.Api.Webhooks
{ {
/// <summary> /// <summary>
/// Manages and retrieves information about schemas. /// Manages and retrieves information about schemas.
/// </summary> /// </summary>
@ -33,9 +34,9 @@ namespace Squidex.Controllers.Api.Webhooks
private readonly ISchemaWebhookRepository webhooksRepository; private readonly ISchemaWebhookRepository webhooksRepository;
private readonly IWebhookEventRepository webhookEventsRepository; private readonly IWebhookEventRepository webhookEventsRepository;
public WebhooksController(ICommandBus commandBus, public WebhooksController(ICommandBus commandBus,
ISchemaWebhookRepository webhooksRepository, ISchemaWebhookRepository webhooksRepository,
IWebhookEventRepository webhookEventsRepository) IWebhookEventRepository webhookEventsRepository)
: base(commandBus) : base(commandBus)
{ {
this.webhooksRepository = webhooksRepository; this.webhooksRepository = webhooksRepository;
@ -78,7 +79,7 @@ namespace Squidex.Controllers.Api.Webhooks
/// <param name="name">The name of the schema.</param> /// <param name="name">The name of the schema.</param>
/// <param name="request">The webhook object that needs to be added to the app.</param> /// <param name="request">The webhook object that needs to be added to the app.</param>
/// <returns> /// <returns>
/// 201 => Webhook created. /// 201 => Webhook created.
/// 400 => Webhook name or properties are not valid. /// 400 => Webhook name or properties are not valid.
/// 409 => Webhook name already in use. /// 409 => Webhook name already in use.
/// 404 => App or schema not found. /// 404 => App or schema not found.
@ -98,7 +99,9 @@ namespace Squidex.Controllers.Api.Webhooks
await CommandBus.PublishAsync(command); await CommandBus.PublishAsync(command);
return CreatedAtAction(nameof(GetWebhooks), new { app }, SimpleMapper.Map(command, new WebhookCreatedDto { SchemaId = command.SchemaId.Id.ToString() })); var response = SimpleMapper.Map(command, new WebhookCreatedDto { SchemaId = command.SchemaId.Id.ToString() };
return CreatedAtAction(nameof(GetWebhooks), new { app }, response));
} }
/// <summary> /// <summary>
@ -125,6 +128,8 @@ namespace Squidex.Controllers.Api.Webhooks
/// Get webhook events. /// Get webhook events.
/// </summary> /// </summary>
/// <param name="app">The name of the app.</param> /// <param name="app">The name of the app.</param>
/// <param name="skip">The number of events to skip.</param>
/// <param name="take">The number of events to take.</param>
/// <returns> /// <returns>
/// 200 => Webhook events returned. /// 200 => Webhook events returned.
/// 404 => App not found. /// 404 => App not found.
@ -133,9 +138,9 @@ namespace Squidex.Controllers.Api.Webhooks
[Route("apps/{app}/webhooks/events")] [Route("apps/{app}/webhooks/events")]
[ProducesResponseType(typeof(WebhookEventsDto), 200)] [ProducesResponseType(typeof(WebhookEventsDto), 200)]
[ApiCosts(0)] [ApiCosts(0)]
public async Task<IActionResult> GetEvents(string app) public async Task<IActionResult> GetEvents(string app, [FromQuery] int skip = 0, [FromQuery] int take = 20)
{ {
var taskForItems = webhookEventsRepository.QueryByAppAsync(App.Id); var taskForItems = webhookEventsRepository.QueryByAppAsync(App.Id, skip, take);
var taskForCount = webhookEventsRepository.CountByAppAsync(App.Id); var taskForCount = webhookEventsRepository.CountByAppAsync(App.Id);
await Task.WhenAll(taskForItems, taskForCount); await Task.WhenAll(taskForItems, taskForCount);
@ -156,5 +161,31 @@ namespace Squidex.Controllers.Api.Webhooks
return Ok(response); return Ok(response);
} }
/// <summary>
/// Enqueue the event to be send.
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="id">The event to enqueue.</param>
/// <returns>
/// 200 => Webhook enqueued.
/// 404 => App or webhook event not found.
/// </returns>
[HttpPut]
[Route("apps/{app}/webhooks/events/{id}")]
[ApiCosts(0)]
public async Task<IActionResult> PutEvent(string app, Guid id)
{
var entity = await webhookEventsRepository.FindAsync(id);
if (entity == null)
{
return NotFound();
}
await webhookEventsRepository.EnqueueAsync(id, SystemClock.Instance.GetCurrentInstant());
return Ok();
}
} }
} }

4
src/Squidex/Controllers/ContentApi/ContentSwaggerController.cs

@ -56,9 +56,9 @@ namespace Squidex.Controllers.ContentApi
{ {
return NotFound(); return NotFound();
} }
var schemas = await schemaRepository.QueryAllAsync(appEntity.Id); var schemas = await schemaRepository.QueryAllAsync(appEntity.Id);
var swaggerDocument = await schemasSwaggerGenerator.Generate(appEntity, schemas); var swaggerDocument = await schemasSwaggerGenerator.Generate(appEntity, schemas);
return Content(swaggerDocument.ToJson(), "application/json"); return Content(swaggerDocument.ToJson(), "application/json");

6
src/Squidex/Controllers/ContentApi/ContentsController.cs

@ -39,10 +39,10 @@ namespace Squidex.Controllers.ContentApi
private readonly IGraphQLService graphQL; private readonly IGraphQLService graphQL;
public ContentsController( public ContentsController(
ICommandBus commandBus, ICommandBus commandBus,
ISchemaProvider schemas, ISchemaProvider schemas,
IContentRepository contentRepository, IContentRepository contentRepository,
IGraphQLService graphQL) IGraphQLService graphQL)
: base(commandBus) : base(commandBus)
{ {
this.graphQL = graphQL; this.graphQL = graphQL;
@ -117,7 +117,7 @@ namespace Squidex.Controllers.ContentApi
return Ok(response); return Ok(response);
} }
[MustBeAppReader] [MustBeAppReader]
[HttpGet] [HttpGet]
[Route("content/{app}/{name}/{id}")] [Route("content/{app}/{name}/{id}")]

6
src/Squidex/Controllers/ContentApi/Generator/SchemaSwaggerGenerator.cs

@ -40,13 +40,13 @@ namespace Squidex.Controllers.ContentApi.Generator
schemaQueryDescription = SwaggerHelper.LoadDocs("schemaquery"); schemaQueryDescription = SwaggerHelper.LoadDocs("schemaquery");
} }
public SchemaSwaggerGenerator(SwaggerDocument document, string path, Schema schema, public SchemaSwaggerGenerator(SwaggerDocument document, string path, Schema schema,
Func<string, JsonSchema4, JsonSchema4> schemaResolver, PartitionResolver partitionResolver) Func<string, JsonSchema4, JsonSchema4> schemaResolver, PartitionResolver partitionResolver)
{ {
this.document = document; this.document = document;
appPath = path; appPath = path;
schemaPath = schema.Name; schemaPath = schema.Name;
schemaName = schema.Properties.Label.WithFallback(schema.Name); schemaName = schema.Properties.Label.WithFallback(schema.Name);
schemaKey = schema.Name.ToPascalCase(); schemaKey = schema.Name.ToPascalCase();
@ -96,7 +96,7 @@ namespace Squidex.Controllers.ContentApi.Generator
operation.AddQueryParameter("$filter", JsonObjectType.String, "Optional OData filter."); operation.AddQueryParameter("$filter", JsonObjectType.String, "Optional OData filter.");
operation.AddQueryParameter("$search", JsonObjectType.String, "Optional OData full text search."); operation.AddQueryParameter("$search", JsonObjectType.String, "Optional OData full text search.");
operation.AddQueryParameter("orderby", JsonObjectType.String, "Optional OData order definition."); operation.AddQueryParameter("orderby", JsonObjectType.String, "Optional OData order definition.");
operation.AddResponse("200", $"{schemaName} content retrieved.", CreateContentsSchema(schemaName, contentSchema)); operation.AddResponse("200", $"{schemaName} content retrieved.", CreateContentsSchema(schemaName, contentSchema));
}); });
} }

10
src/Squidex/Controllers/ContentApi/Generator/SchemasSwaggerGenerator.cs

@ -68,7 +68,15 @@ namespace Squidex.Controllers.ContentApi.Generator
{ {
new SwaggerSecurityRequirement new SwaggerSecurityRequirement
{ {
{ Constants.SecurityDefinition, new List<string> { SquidexRoles.AppOwner, SquidexRoles.AppDeveloper, SquidexRoles.AppEditor } } {
Constants.SecurityDefinition,
new List<string>
{
SquidexRoles.AppOwner,
SquidexRoles.AppDeveloper,
SquidexRoles.AppEditor
}
}
} }
}; };

3
src/Squidex/Controllers/ContentApi/Models/ContentDto.cs

@ -73,7 +73,8 @@ namespace Squidex.Controllers.ContentApi.Models
Created = now, Created = now,
CreatedBy = command.Actor, CreatedBy = command.Actor,
LastModified = now, LastModified = now,
LastModifiedBy = command.Actor LastModifiedBy = command.Actor,
IsPublished = command.Publish
}; };
return response; return response;

8
src/Squidex/Controllers/UI/Account/AccountController.cs

@ -46,7 +46,7 @@ namespace Squidex.Controllers.UI.Account
public AccountController( public AccountController(
SignInManager<IUser> signInManager, SignInManager<IUser> signInManager,
UserManager<IUser> userManager, UserManager<IUser> userManager,
IUserFactory userFactory, IUserFactory userFactory,
IOptions<MyIdentityOptions> identityOptions, IOptions<MyIdentityOptions> identityOptions,
IOptions<MyUrlsOptions> urlOptions, IOptions<MyUrlsOptions> urlOptions,
@ -82,7 +82,7 @@ namespace Squidex.Controllers.UI.Account
{ {
throw new SecurityException("User is not allowed to login."); throw new SecurityException("User is not allowed to login.");
} }
[HttpGet] [HttpGet]
[Route("account/accessdenied")] [Route("account/accessdenied")]
public IActionResult AccessDenied() public IActionResult AccessDenied()
@ -102,7 +102,7 @@ namespace Squidex.Controllers.UI.Account
public async Task<IActionResult> Logout(string logoutId) public async Task<IActionResult> Logout(string logoutId)
{ {
var context = await interactions.GetLogoutContextAsync(logoutId); var context = await interactions.GetLogoutContextAsync(logoutId);
await signInManager.SignOutAsync(); await signInManager.SignOutAsync();
var logoutUrl = context.PostLogoutRedirectUri; var logoutUrl = context.PostLogoutRedirectUri;
@ -188,7 +188,7 @@ namespace Squidex.Controllers.UI.Account
[Route("account/external/")] [Route("account/external/")]
public IActionResult External(string provider, string returnUrl = null) public IActionResult External(string provider, string returnUrl = null)
{ {
var properties = var properties =
signInManager.ConfigureExternalAuthenticationProperties(provider, signInManager.ConfigureExternalAuthenticationProperties(provider,
Url.Action(nameof(ExternalCallback), new { ReturnUrl = returnUrl })); Url.Action(nameof(ExternalCallback), new { ReturnUrl = returnUrl }));

2
src/Squidex/Controllers/UI/Profile/ChangePasswordModel.cs

@ -17,7 +17,7 @@ namespace Squidex.Controllers.UI.Profile
[Required(ErrorMessage = "Password is required.")] [Required(ErrorMessage = "Password is required.")]
public string Password { get; set; } public string Password { get; set; }
[Compare(nameof(Password), ErrorMessage = "Passwords must be identitical.")] [Compare(nameof(Password), ErrorMessage = "Passwords must be identitical.")]
public string PasswordConfirm { get; set; } public string PasswordConfirm { get; set; }
} }

2
src/Squidex/Controllers/UI/Profile/PortalController.cs

@ -13,7 +13,7 @@ using NSwag.Annotations;
using Squidex.Domain.Apps.Read.Apps.Services; using Squidex.Domain.Apps.Read.Apps.Services;
using Squidex.Infrastructure.Security; using Squidex.Infrastructure.Security;
namespace Squidex.Controllers.UI.Profile namespace Squidex.Controllers.UI.Profile
{ {
[Authorize] [Authorize]
[SwaggerIgnore] [SwaggerIgnore]

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

Loading…
Cancel
Save