Browse Source

Update client library2 (#980)

* Update client library.

* Fix tests.

* Another fix.

* Update packages.

* Fix tests

* Fix?

* Fix URLs

* Revert test

* Another identity test.

* Simplify configs.
pull/981/head
Sebastian Stehle 3 years ago
committed by GitHub
parent
commit
d30dc86552
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      backend/extensions/Squidex.Extensions/Squidex.Extensions.csproj
  2. 3
      backend/i18n/frontend_en.json
  3. 1
      backend/i18n/frontend_it.json
  4. 1
      backend/i18n/frontend_nl.json
  5. 1
      backend/i18n/frontend_pt.json
  6. 1
      backend/i18n/frontend_zh.json
  7. 3
      backend/i18n/source/frontend_en.json
  8. 2
      backend/src/Migrations/Migrations.csproj
  9. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Squidex.Domain.Apps.Core.Model.csproj
  10. 4
      backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj
  11. 4
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Squidex.Domain.Apps.Entities.MongoDb.csproj
  12. 6
      backend/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs
  13. 12
      backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj
  14. 2
      backend/src/Squidex.Domain.Apps.Events/Squidex.Domain.Apps.Events.csproj
  15. 4
      backend/src/Squidex.Domain.Users.MongoDb/Squidex.Domain.Users.MongoDb.csproj
  16. 4
      backend/src/Squidex.Domain.Users/InMemory/InMemoryApplicationStore.cs
  17. 4
      backend/src/Squidex.Domain.Users/InMemory/InMemoryScopeStore.cs
  18. 6
      backend/src/Squidex.Domain.Users/Squidex.Domain.Users.csproj
  19. 10
      backend/src/Squidex.Infrastructure.GetEventStore/Squidex.Infrastructure.GetEventStore.csproj
  20. 11
      backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoBase.cs
  21. 40
      backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoClientFactory.cs
  22. 6
      backend/src/Squidex.Infrastructure.MongoDb/Squidex.Infrastructure.MongoDb.csproj
  23. 12
      backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj
  24. 2
      backend/src/Squidex.Shared/Squidex.Shared.csproj
  25. 8
      backend/src/Squidex.Web/Squidex.Web.csproj
  26. 10
      backend/src/Squidex/Areas/Api/Controllers/News/Service/FeaturesService.cs
  27. 2
      backend/src/Squidex/Areas/IdentityServer/Config/AlwaysAddTokenHandler.cs
  28. 47
      backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs
  29. 17
      backend/src/Squidex/Areas/IdentityServer/Controllers/Connect/AuthorizationController.cs
  30. 14
      backend/src/Squidex/Config/Domain/StoreServices.cs
  31. 4
      backend/src/Squidex/Config/Domain/TelemetryServices.cs
  32. 2
      backend/src/Squidex/Config/MyIdentityOptions.cs
  33. 28
      backend/src/Squidex/Squidex.csproj
  34. 3
      backend/src/Squidex/appsettings.json
  35. 8
      backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj
  36. 5
      backend/tests/Squidex.Domain.Apps.Core.Tests/TestHelpers/TestUtils.cs
  37. 2
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/MongoDb/AssetsQueryFixture.cs
  38. 2
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/MongoDb/ContentsQueryFixture.cs
  39. 3
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/AtlasTextIndexFixture.cs
  40. 3
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/MongoTextIndexFixture.cs
  41. 3
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/MongoDb/SchemasHashFixture.cs
  42. 12
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj
  43. 6
      backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj
  44. 3
      backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Consume/EventConsumerProcessorIntegrationTests.cs
  45. 2
      backend/tests/Squidex.Infrastructure.Tests/EventSourcing/GetEventStoreFixture.cs
  46. 3
      backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs
  47. 6
      backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj
  48. 4
      backend/tests/Squidex.Infrastructure.Tests/TestHelpers/TestUtils.cs
  49. 6
      backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj
  50. 15
      frontend/src/app/features/settings/pages/clients/client-connect-form.component.html
  51. 6
      tools/TestSuite/TestSuite.ApiTests/AdminUsersTests.cs
  52. 4
      tools/TestSuite/TestSuite.ApiTests/AnonymousTests.cs
  53. 2
      tools/TestSuite/TestSuite.ApiTests/AppClientsTests.cs
  54. 31
      tools/TestSuite/TestSuite.ApiTests/AppCreationTests.cs
  55. 10
      tools/TestSuite/TestSuite.ApiTests/AppLanguagesTests.cs
  56. 16
      tools/TestSuite/TestSuite.ApiTests/AppRolesTests.cs
  57. 4
      tools/TestSuite/TestSuite.ApiTests/AppTests.cs
  58. 93
      tools/TestSuite/TestSuite.ApiTests/AssetTests.cs
  59. 22
      tools/TestSuite/TestSuite.ApiTests/BackupTests.cs
  60. 2
      tools/TestSuite/TestSuite.ApiTests/CommentsTests.cs
  61. 2
      tools/TestSuite/TestSuite.ApiTests/ContentCleanupTests.cs
  62. 6
      tools/TestSuite/TestSuite.ApiTests/ContentLanguageTests.cs
  63. 14
      tools/TestSuite/TestSuite.ApiTests/ContentReferencesTests.cs
  64. 6
      tools/TestSuite/TestSuite.ApiTests/ContentScriptingTests.cs
  65. 4
      tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs
  66. 6
      tools/TestSuite/TestSuite.ApiTests/GraphQLFixture.cs
  67. 56
      tools/TestSuite/TestSuite.ApiTests/RuleRunnerTests.cs
  68. 10
      tools/TestSuite/TestSuite.ApiTests/RuleTests.cs
  69. 30
      tools/TestSuite/TestSuite.ApiTests/SchemaTests.cs
  70. 6
      tools/TestSuite/TestSuite.ApiTests/SearchTests.cs
  71. 2
      tools/TestSuite/TestSuite.ApiTests/Settings/VerifySettings.cs
  72. 2
      tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj
  73. 48
      tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_read_access.verified.txt
  74. 48
      tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_write_access.verified.txt
  75. 12
      tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_create_client.verified.txt
  76. 18
      tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_delete_client.verified.txt
  77. 34
      tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_update_client.verified.txt
  78. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_invite_contributor.verified.txt
  79. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_remove_contributor.verified.txt
  80. 1
      tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_update_contributor.verified.txt
  81. 48
      tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app.verified.txt
  82. 380
      tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app_from_templates.verified.txt
  83. 38
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_custom_language.verified.txt
  84. 38
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_language.verified.txt
  85. 26
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_delete_language.verified.txt
  86. 40
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_language.verified.txt
  87. 38
      tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_master_language.verified.txt
  88. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role.verified.txt
  89. 6
      tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role_with_buggy_name.verified.txt
  90. 8
      tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_update_role.verified.txt
  91. 20
      tools/TestSuite/TestSuite.ApiTests/Verify/AppTests.Should_update_settings.verified.txt
  92. 36
      tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_create_workflow.verified.txt
  93. 4
      tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_delete_workflow.verified.txt
  94. 28
      tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_update_workflow.verified.txt
  95. 40
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_fix_orientation.verified.txt
  96. 40
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_audio_mp3.verified.txt
  97. 40
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_encode_to_webp.verified.txt
  98. 40
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_resize.verified.txt
  99. 40
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_and_resize.verified.txt
  100. 34
      tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_without_extension.verified.txt

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

@ -13,27 +13,27 @@
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.0.0-beta.3" /> <PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.0.0-beta.3" />
<PackageReference Include="Azure.Search.Documents" Version="11.4.0" /> <PackageReference Include="Azure.Search.Documents" Version="11.4.0" />
<PackageReference Include="Confluent.Apache.Avro" Version="1.7.7.7" /> <PackageReference Include="Confluent.Apache.Avro" Version="1.7.7.7" />
<PackageReference Include="Confluent.Kafka" Version="1.9.3" /> <PackageReference Include="Confluent.Kafka" Version="2.0.2" />
<PackageReference Include="Confluent.SchemaRegistry.Serdes" Version="1.3.0" /> <PackageReference Include="Confluent.SchemaRegistry.Serdes" Version="1.3.0" />
<PackageReference Include="CoreTweet" Version="1.0.0.483" /> <PackageReference Include="CoreTweet" Version="1.0.0.483" />
<PackageReference Include="Elasticsearch.Net" Version="7.17.5" /> <PackageReference Include="Elasticsearch.Net" Version="7.17.5" />
<PackageReference Include="Google.Cloud.Diagnostics.Common" Version="4.4.0" /> <PackageReference Include="Google.Cloud.Diagnostics.Common" Version="4.4.0" />
<PackageReference Include="Google.Cloud.Logging.V2" Version="3.6.0" /> <PackageReference Include="Google.Cloud.Logging.V2" Version="3.6.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Azure.CognitiveServices.Vision.ComputerVision" Version="7.0.1" /> <PackageReference Include="Microsoft.Azure.CognitiveServices.Vision.ComputerVision" Version="7.0.1" />
<PackageReference Include="Microsoft.Azure.SignalR.Management" Version="1.19.1" /> <PackageReference Include="Microsoft.Azure.SignalR.Management" Version="1.21.2" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.OData.Core" Version="7.12.5" /> <PackageReference Include="Microsoft.OData.Core" Version="7.15.0" />
<PackageReference Include="NodaTime" Version="3.1.6" /> <PackageReference Include="NodaTime" Version="3.1.6" />
<PackageReference Include="OpenSearch.Net" Version="1.2.0" /> <PackageReference Include="OpenSearch.Net" Version="1.3.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.3.1" /> <PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.4.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.3.1" /> <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.4.0" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.3.1" /> <PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.4.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc8" /> <PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.4.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" /> <PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="Squidex.OpenTelemetry.Exporter.Stackdriver" Version="0.0.0-alpha.0.395" /> <PackageReference Include="Squidex.OpenTelemetry.Exporter.Stackdriver" Version="0.0.0-alpha.0.395" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />

3
backend/i18n/frontend_en.json

@ -197,7 +197,8 @@
"clients.connectWizard.sdkHint": "Download an SDK and establish a connection to this app.", "clients.connectWizard.sdkHint": "Download an SDK and establish a connection to this app.",
"clients.connectWizard.sdkStep1": "Install the .NET SDK", "clients.connectWizard.sdkStep1": "Install the .NET SDK",
"clients.connectWizard.sdkStep1Download": "The SDK is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", "clients.connectWizard.sdkStep1Download": "The SDK is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)",
"clients.connectWizard.sdkStep2": "Create a client manager", "clients.connectWizard.sdkStep2": "Version 14 and before: Create a client manager",
"clients.connectWizard.sdkStep2_15": "Version 15 and later: Create a client",
"clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK", "clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK",
"clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", "clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)",
"clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients",

1
backend/i18n/frontend_it.json

@ -198,6 +198,7 @@
"clients.connectWizard.sdkStep1": "Installa .NET SDK", "clients.connectWizard.sdkStep1": "Installa .NET SDK",
"clients.connectWizard.sdkStep1Download": "L'SDK è disponibile su [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", "clients.connectWizard.sdkStep1Download": "L'SDK è disponibile su [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)",
"clients.connectWizard.sdkStep2": "Crea un client manager", "clients.connectWizard.sdkStep2": "Crea un client manager",
"clients.connectWizard.sdkStep2_15": "Version 15 and later: Create a client",
"clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK", "clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK",
"clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", "clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)",
"clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients",

1
backend/i18n/frontend_nl.json

@ -198,6 +198,7 @@
"clients.connectWizard.sdkStep1": "Installeer de .NET SDK", "clients.connectWizard.sdkStep1": "Installeer de .NET SDK",
"clients.connectWizard.sdkStep1Download": "De SDK is beschikbaar op [nuget] (https://www.nuget.org/packages/Squidex.ClientLibrary/)", "clients.connectWizard.sdkStep1Download": "De SDK is beschikbaar op [nuget] (https://www.nuget.org/packages/Squidex.ClientLibrary/)",
"clients.connectWizard.sdkStep2": "Maak een klantenbeheerder", "clients.connectWizard.sdkStep2": "Maak een klantenbeheerder",
"clients.connectWizard.sdkStep2_15": "Version 15 and later: Create a client",
"clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK", "clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK",
"clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", "clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)",
"clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients",

1
backend/i18n/frontend_pt.json

@ -198,6 +198,7 @@
"clients.connectWizard.sdkStep1": "Instale o .NET SDK", "clients.connectWizard.sdkStep1": "Instale o .NET SDK",
"clients.connectWizard.sdkStep1Download": "O SDK está disponível em [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", "clients.connectWizard.sdkStep1Download": "O SDK está disponível em [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)",
"clients.connectWizard.sdkStep2": "Criar um gestor de clientes", "clients.connectWizard.sdkStep2": "Criar um gestor de clientes",
"clients.connectWizard.sdkStep2_15": "Version 15 and later: Create a client",
"clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK", "clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK",
"clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", "clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)",
"clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients",

1
backend/i18n/frontend_zh.json

@ -198,6 +198,7 @@
"clients.connectWizard.sdkStep1": "安装.NET SDK", "clients.connectWizard.sdkStep1": "安装.NET SDK",
"clients.connectWizard.sdkStep1Download": "SDK 可在 [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", "clients.connectWizard.sdkStep1Download": "SDK 可在 [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)",
"clients.connectWizard.sdkStep2": "创建客户端管理器", "clients.connectWizard.sdkStep2": "创建客户端管理器",
"clients.connectWizard.sdkStep2_15": "Version 15 and later: Create a client",
"clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK", "clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK",
"clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", "clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)",
"clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients",

3
backend/i18n/source/frontend_en.json

@ -197,7 +197,8 @@
"clients.connectWizard.sdkHint": "Download an SDK and establish a connection to this app.", "clients.connectWizard.sdkHint": "Download an SDK and establish a connection to this app.",
"clients.connectWizard.sdkStep1": "Install the .NET SDK", "clients.connectWizard.sdkStep1": "Install the .NET SDK",
"clients.connectWizard.sdkStep1Download": "The SDK is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", "clients.connectWizard.sdkStep1Download": "The SDK is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)",
"clients.connectWizard.sdkStep2": "Create a client manager", "clients.connectWizard.sdkStep2": "Version 14 and before: Create a client manager",
"clients.connectWizard.sdkStep2_15": "Version 15 and later: Create a client",
"clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK", "clients.connectWizard.sdkStep3": "Optionally: Install the Service Extensions for the SDK",
"clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", "clients.connectWizard.sdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)",
"clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.sdkStep4": "Optionally: Register the client manager and all clients",

2
backend/src/Migrations/Migrations.csproj

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

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

@ -12,7 +12,7 @@
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

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

@ -18,10 +18,10 @@
<ProjectReference Include="..\Squidex.Shared\Squidex.Shared.csproj" /> <ProjectReference Include="..\Squidex.Shared\Squidex.Shared.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Fluid.Core" Version="2.3.0" /> <PackageReference Include="Fluid.Core" Version="2.4.0" />
<PackageReference Include="GeoJSON.Net" Version="1.2.19" /> <PackageReference Include="GeoJSON.Net" Version="1.2.19" />
<PackageReference Include="Jint" Version="3.0.0-beta-2046" /> <PackageReference Include="Jint" Version="3.0.0-beta-2046" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

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

@ -19,11 +19,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00015" /> <PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00015" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="MongoDB.Driver" Version="2.18.0" /> <PackageReference Include="MongoDB.Driver" Version="2.19.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" /> <PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" /> <PackageReference Include="System.ValueTuple" Version="4.5.0" />

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

@ -18,7 +18,6 @@ using Squidex.CLI.Commands.Implementation.Sync.Schemas;
using Squidex.CLI.Commands.Implementation.Sync.Workflows; using Squidex.CLI.Commands.Implementation.Sync.Workflows;
using Squidex.CLI.Configuration; using Squidex.CLI.Configuration;
using Squidex.ClientLibrary; using Squidex.ClientLibrary;
using Squidex.ClientLibrary.Configuration;
using Squidex.Domain.Apps.Core; using Squidex.Domain.Apps.Core;
using Squidex.Domain.Apps.Entities.Apps.Commands; using Squidex.Domain.Apps.Entities.Apps.Commands;
using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Commands;
@ -122,11 +121,10 @@ public sealed class TemplateCommandMiddleware : ICommandMiddleware
} }
return new Session( return new Session(
app.Name,
new DirectoryInfo(Path.GetTempPath()), new DirectoryInfo(Path.GetTempPath()),
new SquidexClientManager(new SquidexOptions new SquidexClient(new SquidexOptions
{ {
Configurator = AcceptAllCertificatesConfigurator.Instance, IgnoreSelfSignedCertificates = true,
AppName = app.Name, AppName = app.Name,
ClientId = $"{app.Name}:{client.Key}", ClientId = $"{app.Name}:{client.Key}",
ClientSecret = client.Value.Secret, ClientSecret = client.Value.Secret,

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

@ -20,21 +20,21 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" /> <PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="GraphQL" Version="7.2.1" /> <PackageReference Include="GraphQL" Version="7.3.0" />
<PackageReference Include="GraphQL.DataLoader" Version="7.2.1" /> <PackageReference Include="GraphQL.DataLoader" Version="7.3.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Notifo.SDK" Version="1.5.1" /> <PackageReference Include="Notifo.SDK" Version="1.7.4" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" /> <PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="Squidex.CLI.Core" Version="9.6.0" /> <PackageReference Include="Squidex.CLI.Core" Version="10.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Version="7.0.0" /> <PackageReference Include="System.Collections.Immutable" Version="7.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" /> <PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="taglib-sharp-netstandard2.0" Version="2.1.0" /> <PackageReference Include="taglib-sharp-netstandard2.0" Version="2.1.0" />
<PackageReference Include="tusdotnet" Version="2.7.0" /> <PackageReference Include="tusdotnet" Version="2.7.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" /> <AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />

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

@ -14,7 +14,7 @@
<ProjectReference Include="..\Squidex.Infrastructure\Squidex.Infrastructure.csproj" /> <ProjectReference Include="..\Squidex.Infrastructure\Squidex.Infrastructure.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

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

@ -19,12 +19,12 @@
<ProjectReference Include="..\Squidex.Shared\Squidex.Shared.csproj" /> <ProjectReference Include="..\Squidex.Shared\Squidex.Shared.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" /> <PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="MongoDB.Driver" Version="2.18.0" /> <PackageReference Include="MongoDB.Driver" Version="2.19.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" /> <PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" /> <PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />

4
backend/src/Squidex.Domain.Users/InMemory/InMemoryApplicationStore.cs

@ -39,10 +39,10 @@ public class InMemoryApplicationStore : IOpenIddictApplicationStore<ImmutableApp
return query(applications.AsQueryable()).LongCount().AsValueTask(); return query(applications.AsQueryable()).LongCount().AsValueTask();
} }
public virtual ValueTask<TResult> GetAsync<TState, TResult>(Func<IQueryable<ImmutableApplication>, TState, IQueryable<TResult>> query, TState state, public virtual ValueTask<TResult?> GetAsync<TState, TResult>(Func<IQueryable<ImmutableApplication>, TState, IQueryable<TResult>> query, TState state,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
var result = query(applications.AsQueryable(), state).First(); var result = query(applications.AsQueryable(), state).FirstOrDefault();
return result.AsValueTask(); return result.AsValueTask();
} }

4
backend/src/Squidex.Domain.Users/InMemory/InMemoryScopeStore.cs

@ -39,10 +39,10 @@ public class InMemoryScopeStore : IOpenIddictScopeStore<ImmutableScope>
return query(scopes.AsQueryable()).LongCount().AsValueTask(); return query(scopes.AsQueryable()).LongCount().AsValueTask();
} }
public virtual ValueTask<TResult> GetAsync<TState, TResult>(Func<IQueryable<ImmutableScope>, TState, IQueryable<TResult>> query, TState state, public virtual ValueTask<TResult?> GetAsync<TState, TResult>(Func<IQueryable<ImmutableScope>, TState, IQueryable<TResult>> query, TState state,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
var result = query(scopes.AsQueryable(), state).First(); var result = query(scopes.AsQueryable(), state).FirstOrDefault();
return result.AsValueTask(); return result.AsValueTask();
} }

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

@ -18,13 +18,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="IdentityModel" Version="6.0.0" /> <PackageReference Include="IdentityModel" Version="6.0.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.4" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" /> <PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="OpenIddict.AspNetCore" Version="3.1.1" /> <PackageReference Include="OpenIddict.AspNetCore" Version="4.1.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" /> <PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="SharpPwned.NET" Version="2.0.1" /> <PackageReference Include="SharpPwned.NET" Version="2.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />

10
backend/src/Squidex.Infrastructure.GetEventStore/Squidex.Infrastructure.GetEventStore.csproj

@ -11,11 +11,11 @@
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="EventStore.Client.Grpc.PersistentSubscriptions" Version="22.0.0" /> <PackageReference Include="EventStore.Client.Grpc.PersistentSubscriptions" Version="23.0.0" />
<PackageReference Include="EventStore.Client.Grpc.ProjectionManagement" Version="22.0.0" /> <PackageReference Include="EventStore.Client.Grpc.ProjectionManagement" Version="23.0.0" />
<PackageReference Include="EventStore.Client.Grpc.Streams" Version="22.0.0" /> <PackageReference Include="EventStore.Client.Grpc.Streams" Version="23.0.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.50.0" /> <PackageReference Include="Grpc.Net.Client" Version="2.52.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

11
backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoBase.cs

@ -44,15 +44,4 @@ public abstract class MongoBase<TEntity>
protected static readonly BsonDocument FindAll = protected static readonly BsonDocument FindAll =
new BsonDocument(); new BsonDocument();
static MongoBase()
{
BsonDefaultConventions.Register();
BsonDomainIdSerializer.Register();
BsonEscapedDictionarySerializer<JsonValue, JsonObject>.Register();
BsonInstantSerializer.Register();
BsonJsonConvention.Register();
BsonJsonValueSerializer.Register();
BsonStringSerializer<RefToken>.Register();
}
} }

40
backend/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoClientFactory.cs

@ -0,0 +1,40 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using MongoDB.Bson.Serialization.Serializers;
using MongoDB.Bson.Serialization;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using Squidex.Infrastructure.Json.Objects;
namespace Squidex.Infrastructure.MongoDb;
public static class MongoClientFactory
{
public static MongoClient Create(string? connectionString, Action<MongoClientSettings>? configure = null)
{
// Allow all types, independent from the actual assembly.
BsonSerializer.TryRegisterSerializer(new ObjectSerializer(type => true));
BsonDefaultConventions.Register();
BsonDomainIdSerializer.Register();
BsonEscapedDictionarySerializer<JsonValue, JsonObject>.Register();
BsonInstantSerializer.Register();
BsonJsonValueSerializer.Register();
BsonStringSerializer<RefToken>.Register();
var clientSettings = MongoClientSettings.FromConnectionString(connectionString);
// The current version of the linq provider has some issues with base classes.
clientSettings.LinqProvider = LinqProvider.V2;
// If we really need custom config.
configure?.Invoke(clientSettings);
return new MongoClient(clientSettings);
}
}

6
backend/src/Squidex.Infrastructure.MongoDb/Squidex.Infrastructure.MongoDb.csproj

@ -14,12 +14,12 @@
<ProjectReference Include="..\Squidex.Infrastructure\Squidex.Infrastructure.csproj" /> <ProjectReference Include="..\Squidex.Infrastructure\Squidex.Infrastructure.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="MongoDB.Driver" Version="2.18.0" /> <PackageReference Include="MongoDB.Driver" Version="2.19.0" />
<PackageReference Include="MongoDB.Driver.GridFS" Version="2.18.0" /> <PackageReference Include="MongoDB.Driver.GridFS" Version="2.19.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" /> <PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="7.0.0" /> <PackageReference Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />

12
backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj

@ -11,18 +11,18 @@
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MailKit" Version="3.4.3" /> <PackageReference Include="MailKit" Version="3.6.0" />
<PackageReference Include="McMaster.NETCore.Plugins" Version="1.4.0" /> <PackageReference Include="McMaster.NETCore.Plugins" Version="1.4.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="7.0.4" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.2.1" /> <PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.3.2" />
<PackageReference Include="Microsoft.OData.Core" Version="7.12.5" /> <PackageReference Include="Microsoft.OData.Core" Version="7.15.0" />
<PackageReference Include="NodaTime" Version="3.1.6" /> <PackageReference Include="NodaTime" Version="3.1.6" />
<PackageReference Include="OpenTelemetry.Api" Version="1.3.1" /> <PackageReference Include="OpenTelemetry.Api" Version="1.4.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" /> <PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="Squidex.Assets" Version="5.4.0" /> <PackageReference Include="Squidex.Assets" Version="5.4.0" />
<PackageReference Include="Squidex.Caching" Version="5.4.0" /> <PackageReference Include="Squidex.Caching" Version="5.4.0" />

2
backend/src/Squidex.Shared/Squidex.Shared.csproj

@ -9,7 +9,7 @@
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

8
backend/src/Squidex.Web/Squidex.Web.csproj

@ -13,10 +13,10 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="GraphQL" Version="7.2.1" /> <PackageReference Include="GraphQL" Version="7.3.0" />
<PackageReference Include="GraphQL.SystemTextJson" Version="7.2.1" /> <PackageReference Include="GraphQL.SystemTextJson" Version="7.3.0" />
<PackageReference Include="GraphQL.Server.Transports.AspNetCore" Version="7.2.0" /> <PackageReference Include="GraphQL.Server.Transports.AspNetCore" Version="7.3.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

10
backend/src/Squidex/Areas/Api/Controllers/News/Service/FeaturesService.cs

@ -17,7 +17,7 @@ public sealed class FeaturesService
{ {
private const int FeatureVersion = 21; private const int FeatureVersion = 21;
private readonly QueryContext flatten = QueryContext.Default.Flatten(); private readonly QueryContext flatten = QueryContext.Default.Flatten();
private readonly IContentsClient<NewsEntity, FeatureDto> client; private readonly IContentsClient<NewsEntity, FeatureDto> contents;
public sealed class NewsEntity : Content<FeatureDto> public sealed class NewsEntity : Content<FeatureDto>
{ {
@ -35,9 +35,9 @@ public sealed class FeaturesService
Url = "https://cloud.squidex.io" Url = "https://cloud.squidex.io"
}; };
var clientManager = new SquidexClientManager(squidexOptions); var client = new SquidexClient(squidexOptions);
client = clientManager.CreateContentsClient<NewsEntity, FeatureDto>("feature-news"); contents = client.Contents<NewsEntity, FeatureDto>("feature-news");
} }
} }
@ -49,7 +49,7 @@ public sealed class FeaturesService
Version = version Version = version
}; };
if (client != null && version < FeatureVersion) if (contents != null && version < FeatureVersion)
{ {
try try
{ {
@ -64,7 +64,7 @@ public sealed class FeaturesService
query.Filter = $"data/version/iv le {FeatureVersion} and data/version/iv gt {version}"; query.Filter = $"data/version/iv le {FeatureVersion} and data/version/iv gt {version}";
} }
var features = await client.GetAsync(query, flatten, ct); var features = await contents.GetAsync(query, flatten, ct);
result.Features.AddRange(features.Items.Select(x => x.Data).ToList()); result.Features.AddRange(features.Items.Select(x => x.Data).ToList());

2
backend/src/Squidex/Areas/IdentityServer/Config/AlwaysAddTokenHandler.cs

@ -12,7 +12,7 @@ using static OpenIddict.Server.OpenIddictServerEvents;
namespace Squidex.Areas.IdentityServer.Config; namespace Squidex.Areas.IdentityServer.Config;
public sealed class AlwaysAddTokenHandler : IOpenIddictServerHandler<ProcessSignInContext> public sealed class AlwaysAddScopeHandler : IOpenIddictServerHandler<ProcessSignInContext>
{ {
public ValueTask HandleAsync(ProcessSignInContext context) public ValueTask HandleAsync(ProcessSignInContext context)
{ {

47
backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs

@ -83,12 +83,10 @@ public static class IdentityServerServices
{ {
builder.AddEventHandler<ProcessSignInContext>(builder => builder.AddEventHandler<ProcessSignInContext>(builder =>
{ {
builder.UseSingletonHandler<AlwaysAddTokenHandler>() builder.UseSingletonHandler<AlwaysAddScopeHandler>()
.SetOrder(AttachTokenParameters.Descriptor.Order + 1); .SetOrder(AttachSignInParameters.Descriptor.Order + 1);
}); });
builder.SetAccessTokenLifetime(TimeSpan.FromDays(30));
builder.DisableAccessTokenEncryption(); builder.DisableAccessTokenEncryption();
builder.RegisterScopes( builder.RegisterScopes(
@ -109,11 +107,18 @@ public static class IdentityServerServices
.EnableStatusCodePagesIntegration() .EnableStatusCodePagesIntegration()
.EnableTokenEndpointPassthrough() .EnableTokenEndpointPassthrough()
.EnableUserinfoEndpointPassthrough(); .EnableUserinfoEndpointPassthrough();
builder.SetAccessTokenLifetime(TimeSpan.FromDays(30));
}) })
.AddValidation(options => .AddValidation(builder =>
{ {
options.UseLocalServer(); builder.UseLocalServer();
options.UseAspNetCore(); builder.UseAspNetCore();
builder.Configure(options =>
{
options.Issuer = options.Configuration?.Issuer;
});
}); });
services.Configure<AntiforgeryOptions>((c, options) => services.Configure<AntiforgeryOptions>((c, options) =>
@ -130,41 +135,33 @@ public static class IdentityServerServices
var identityPrefix = Constants.PrefixIdentityServer; var identityPrefix = Constants.PrefixIdentityServer;
var identityOptions = c.GetRequiredService<IOptions<MyIdentityOptions>>().Value; var identityOptions = c.GetRequiredService<IOptions<MyIdentityOptions>>().Value;
Func<string, Uri> buildUrl; Uri BuildUrl(string path)
if (identityOptions.MultipleDomains)
{ {
buildUrl = url => new Uri($"{identityPrefix}{url}", UriKind.Relative); return new Uri($"{identityPrefix.TrimStart('/')}/{path}", UriKind.Relative);
options.Issuer = new Uri(urlGenerator.BuildUrl());
} }
else
{
buildUrl = url => new Uri(urlGenerator.BuildUrl($"{identityPrefix}{url}", false));
options.Issuer = new Uri(urlGenerator.BuildUrl(identityPrefix, false)); options.Issuer = new Uri(urlGenerator.BuildUrl());
}
options.AuthorizationEndpointUris.SetEndpoint( options.AuthorizationEndpointUris.SetEndpoint(
buildUrl("/connect/authorize")); BuildUrl("connect/authorize"));
options.IntrospectionEndpointUris.SetEndpoint( options.IntrospectionEndpointUris.SetEndpoint(
buildUrl("/connect/introspect")); BuildUrl("connect/introspect"));
options.LogoutEndpointUris.SetEndpoint( options.LogoutEndpointUris.SetEndpoint(
buildUrl("/connect/logout")); BuildUrl("connect/logout"));
options.TokenEndpointUris.SetEndpoint( options.TokenEndpointUris.SetEndpoint(
buildUrl("/connect/token")); BuildUrl("connect/token"));
options.UserinfoEndpointUris.SetEndpoint( options.UserinfoEndpointUris.SetEndpoint(
buildUrl("/connect/userinfo")); BuildUrl("connect/userinfo"));
options.CryptographyEndpointUris.SetEndpoint( options.CryptographyEndpointUris.SetEndpoint(
buildUrl("/.well-known/jwks")); BuildUrl(".well-known/jwks"));
options.ConfigurationEndpointUris.SetEndpoint( options.ConfigurationEndpointUris.SetEndpoint(
buildUrl("/.well-known/openid-configuration")); BuildUrl(".well-known/openid-configuration"));
}); });
} }

17
backend/src/Squidex/Areas/IdentityServer/Controllers/Connect/AuthorizationController.cs

@ -191,9 +191,7 @@ public class AuthorizationController : IdentityServerController
if (request.ClientId != null) if (request.ClientId != null)
{ {
identity.AddClaim(Claims.Subject, request.ClientId, identity.AddClaim(Claims.Subject, request.ClientId);
Destinations.AccessToken,
Destinations.IdentityToken);
} }
var properties = await applicationManager.GetPropertiesAsync(application, HttpContext.RequestAborted); var properties = await applicationManager.GetPropertiesAsync(application, HttpContext.RequestAborted);
@ -244,6 +242,11 @@ public class AuthorizationController : IdentityServerController
yield return Destinations.IdentityToken; yield return Destinations.IdentityToken;
yield break; yield break;
case Claims.Subject:
yield return Destinations.AccessToken;
yield return Destinations.IdentityToken;
yield break;
case Claims.Name: case Claims.Name:
yield return Destinations.AccessToken; yield return Destinations.AccessToken;
@ -273,6 +276,14 @@ public class AuthorizationController : IdentityServerController
} }
yield break; yield break;
// Never include the security stamp in the access and identity tokens, as it's a secret value.
case "AspNet.Identity.SecurityStamp":
yield break;
default:
yield return Destinations.AccessToken;
yield break;
} }
} }
} }

14
backend/src/Squidex/Config/Domain/StoreServices.cs

@ -13,6 +13,7 @@ using Migrations.Migrations.MongoDb;
using MongoDB.Bson; using MongoDB.Bson;
using MongoDB.Driver; using MongoDB.Driver;
using MongoDB.Driver.Core.Extensions.DiagnosticSources; using MongoDB.Driver.Core.Extensions.DiagnosticSources;
using MongoDB.Driver.Linq;
using Squidex.Assets; using Squidex.Assets;
using Squidex.Domain.Apps.Entities; using Squidex.Domain.Apps.Entities;
using Squidex.Domain.Apps.Entities.Apps.DomainObject; using Squidex.Domain.Apps.Entities.Apps.DomainObject;
@ -221,14 +222,13 @@ public static class StoreServices
{ {
return Singletons<IMongoClient>.GetOrAdd(configuration, connectionString => return Singletons<IMongoClient>.GetOrAdd(configuration, connectionString =>
{ {
var clientSettings = MongoClientSettings.FromConnectionString(connectionString); return MongoClientFactory.Create(connectionString, settings =>
clientSettings.ClusterConfigurator = builder =>
{ {
builder.Subscribe(new DiagnosticsActivityEventSubscriber()); settings.ClusterConfigurator = builder =>
}; {
builder.Subscribe(new DiagnosticsActivityEventSubscriber());
return new MongoClient(clientSettings); };
});
}); });
} }

4
backend/src/Squidex/Config/Domain/TelemetryServices.cs

@ -16,7 +16,7 @@ public static class TelemetryServices
{ {
public static void AddSquidexTelemetry(this IServiceCollection services, IConfiguration config) public static void AddSquidexTelemetry(this IServiceCollection services, IConfiguration config)
{ {
services.AddOpenTelemetryTracing(); services.AddOpenTelemetry();
services.AddSingleton(serviceProvider => services.AddSingleton(serviceProvider =>
{ {
@ -49,7 +49,7 @@ public static class TelemetryServices
configurator.Configure(builder); configurator.Configure(builder);
} }
return builder.Build(); return builder.Build()!;
}); });
} }
} }

2
backend/src/Squidex/Config/MyIdentityOptions.cs

@ -67,8 +67,6 @@ public sealed class MyIdentityOptions
public bool LockAutomatically { get; set; } public bool LockAutomatically { get; set; }
public bool MultipleDomains { get; set; }
public bool NoConsent { get; set; } public bool NoConsent { get; set; }
public bool RequiresHttps { get; set; } public bool RequiresHttps { get; set; }

28
backend/src/Squidex/Squidex.csproj

@ -35,25 +35,25 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="7.0.0" /> <PackageReference Include="AspNet.Security.OAuth.GitHub" Version="7.0.0" />
<PackageReference Include="GraphQL" Version="7.2.1" /> <PackageReference Include="GraphQL" Version="7.3.0" />
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.2.1" /> <PackageReference Include="GraphQL.MicrosoftDI" Version="7.3.0" />
<PackageReference Include="GraphQL.SystemTextJson" Version="7.2.1" /> <PackageReference Include="GraphQL.SystemTextJson" Version="7.3.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="7.0.4" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" /> <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.RulesetToEditorconfigConverter" Version="3.3.3" /> <PackageReference Include="Microsoft.CodeAnalysis.RulesetToEditorconfigConverter" Version="3.3.3" />
<PackageReference Include="Microsoft.Data.Edm" Version="5.8.5" /> <PackageReference Include="Microsoft.Data.Edm" Version="5.8.5" />
<PackageReference Include="Microsoft.OData.Core" Version="7.12.5" /> <PackageReference Include="Microsoft.OData.Core" Version="7.15.0" />
<PackageReference Include="MongoDB.Driver" Version="2.18.0" /> <PackageReference Include="MongoDB.Driver" Version="2.19.0" />
<PackageReference Include="MongoDB.Driver.Core.Extensions.OpenTelemetry" Version="1.0.0" /> <PackageReference Include="MongoDB.Driver.Core.Extensions.OpenTelemetry" Version="1.0.0" />
<PackageReference Include="NetTopologySuite.IO.GeoJSON4STJ" Version="2.1.1" /> <PackageReference Include="NetTopologySuite.IO.GeoJSON4STJ" Version="3.0.0" />
<PackageReference Include="NJsonSchema" Version="10.8.0" /> <PackageReference Include="NJsonSchema" Version="10.8.0" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" /> <PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" />
<PackageReference Include="NSwag.AspNetCore" Version="13.18.2" /> <PackageReference Include="NSwag.AspNetCore" Version="13.18.2" />
@ -61,7 +61,7 @@
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc7" /> <PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc7" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc7" /> <PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc7" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" /> <PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="ReportGenerator" Version="5.1.12" PrivateAssets="all" /> <PackageReference Include="ReportGenerator" Version="5.1.19" PrivateAssets="all" />
<PackageReference Include="Squidex.Assets.Azure" Version="5.4.0" /> <PackageReference Include="Squidex.Assets.Azure" Version="5.4.0" />
<PackageReference Include="Squidex.Assets.GoogleCloud" Version="5.4.0" /> <PackageReference Include="Squidex.Assets.GoogleCloud" Version="5.4.0" />
<PackageReference Include="Squidex.Assets.FTP" Version="5.4.0" /> <PackageReference Include="Squidex.Assets.FTP" Version="5.4.0" />
@ -70,7 +70,7 @@
<PackageReference Include="Squidex.Assets.Mongo" Version="5.4.0" /> <PackageReference Include="Squidex.Assets.Mongo" Version="5.4.0" />
<PackageReference Include="Squidex.Assets.S3" Version="5.4.0" /> <PackageReference Include="Squidex.Assets.S3" Version="5.4.0" />
<PackageReference Include="Squidex.Assets.TusAdapter" Version="5.4.0" /> <PackageReference Include="Squidex.Assets.TusAdapter" Version="5.4.0" />
<PackageReference Include="Squidex.ClientLibrary" Version="14.2.0" /> <PackageReference Include="Squidex.ClientLibrary" Version="15.0.0" />
<PackageReference Include="Squidex.Hosting" Version="5.4.0" /> <PackageReference Include="Squidex.Hosting" Version="5.4.0" />
<PackageReference Include="Squidex.Messaging.All" Version="5.4.0" /> <PackageReference Include="Squidex.Messaging.All" Version="5.4.0" />
<PackageReference Include="Squidex.Messaging.Subscriptions" Version="5.4.0" /> <PackageReference Include="Squidex.Messaging.Subscriptions" Version="5.4.0" />

3
backend/src/Squidex/appsettings.json

@ -578,9 +578,6 @@
"microsoftSecret": "idWbANxNYEF4cB368WXJhjN", "microsoftSecret": "idWbANxNYEF4cB368WXJhjN",
"microsoftTenant": null, "microsoftTenant": null,
// Set this to true if you use multiple domains.
"multipleDomains": false,
// Settings for your custom oidc server. // Settings for your custom oidc server.
"oidcName": "OIDC", "oidcName": "OIDC",
"oidcAuthority": "", "oidcAuthority": "",

8
backend/tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj

@ -15,15 +15,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.3.1" /> <PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="FluentAssertions" Version="6.8.0" /> <PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NetTopologySuite.IO.GeoJSON4STJ" Version="2.1.1" /> <PackageReference Include="NetTopologySuite.IO.GeoJSON4STJ" Version="3.0.0" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" /> <PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" /> <PackageReference Include="System.ValueTuple" Version="4.5.0" />

5
backend/tests/Squidex.Domain.Apps.Core.Tests/TestHelpers/TestUtils.cs

@ -13,6 +13,7 @@ using System.Text.Json.Serialization;
using MongoDB.Bson.IO; using MongoDB.Bson.IO;
using MongoDB.Bson.Serialization; using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Serializers;
using NetTopologySuite.IO.Converters; using NetTopologySuite.IO.Converters;
using NodaTime; using NodaTime;
using NodaTime.Serialization.SystemTextJson; using NodaTime.Serialization.SystemTextJson;
@ -62,11 +63,13 @@ public static class TestUtils
public static void SetupBson() public static void SetupBson()
{ {
// Allow all types, independent from the actual assembly.
BsonSerializer.TryRegisterSerializer(new ObjectSerializer(type => true));
BsonDomainIdSerializer.Register(); BsonDomainIdSerializer.Register();
BsonEscapedDictionarySerializer<ContentFieldData, ContentData>.Register(); BsonEscapedDictionarySerializer<ContentFieldData, ContentData>.Register();
BsonEscapedDictionarySerializer<JsonValue, ContentFieldData>.Register(); BsonEscapedDictionarySerializer<JsonValue, ContentFieldData>.Register();
BsonEscapedDictionarySerializer<JsonValue, JsonObject>.Register(); BsonEscapedDictionarySerializer<JsonValue, JsonObject>.Register();
BsonEscapedDictionarySerializer<JsonValue, JsonObject>.Register();
BsonInstantSerializer.Register(); BsonInstantSerializer.Register();
BsonJsonConvention.Register(DefaultOptions()); BsonJsonConvention.Register(DefaultOptions());
BsonJsonValueSerializer.Register(); BsonJsonValueSerializer.Register();

2
backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/MongoDb/AssetsQueryFixture.cs

@ -40,7 +40,7 @@ public sealed class AssetsQueryFixture : IAsyncLifetime
{ {
BsonJsonConvention.Register(TestUtils.DefaultOptions()); BsonJsonConvention.Register(TestUtils.DefaultOptions());
mongoClient = new MongoClient(TestConfig.Configuration["mongodb:configuration"]); mongoClient = MongoClientFactory.Create(TestConfig.Configuration["mongodb:configuration"]);
mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]); mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]);
var services = var services =

2
backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/MongoDb/ContentsQueryFixture.cs

@ -73,7 +73,7 @@ public abstract class ContentsQueryFixtureBase : IAsyncLifetime
{ {
BsonJsonConvention.Register(TestUtils.DefaultOptions()); BsonJsonConvention.Register(TestUtils.DefaultOptions());
mongoClient = new MongoClient(TestConfig.Configuration["mongodb:configuration"]); mongoClient = MongoClientFactory.Create(TestConfig.Configuration["mongodb:configuration"]);
mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]); mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]);
var services = var services =

3
backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/AtlasTextIndexFixture.cs

@ -13,6 +13,7 @@ using MongoDB.Driver;
using Squidex.Domain.Apps.Core.TestHelpers; using Squidex.Domain.Apps.Core.TestHelpers;
using Squidex.Domain.Apps.Entities.MongoDb.Text; using Squidex.Domain.Apps.Entities.MongoDb.Text;
using Squidex.Domain.Apps.Entities.TestHelpers; using Squidex.Domain.Apps.Entities.TestHelpers;
using Squidex.Infrastructure.MongoDb;
namespace Squidex.Domain.Apps.Entities.Contents.Text; namespace Squidex.Domain.Apps.Entities.Contents.Text;
@ -24,7 +25,7 @@ public sealed class AtlasTextIndexFixture : IAsyncLifetime
{ {
TestUtils.SetupBson(); TestUtils.SetupBson();
var mongoClient = new MongoClient(TestConfig.Configuration["atlas:configuration"]); var mongoClient = MongoClientFactory.Create(TestConfig.Configuration["atlas:configuration"]);
var mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["atlas:database"]); var mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["atlas:database"]);
var options = TestConfig.Configuration.GetSection("atlas").Get<AtlasOptions>()!; var options = TestConfig.Configuration.GetSection("atlas").Get<AtlasOptions>()!;

3
backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/MongoTextIndexFixture.cs

@ -9,6 +9,7 @@ using MongoDB.Driver;
using Squidex.Domain.Apps.Core.TestHelpers; using Squidex.Domain.Apps.Core.TestHelpers;
using Squidex.Domain.Apps.Entities.MongoDb.Text; using Squidex.Domain.Apps.Entities.MongoDb.Text;
using Squidex.Domain.Apps.Entities.TestHelpers; using Squidex.Domain.Apps.Entities.TestHelpers;
using Squidex.Infrastructure.MongoDb;
namespace Squidex.Domain.Apps.Entities.Contents.Text; namespace Squidex.Domain.Apps.Entities.Contents.Text;
@ -20,7 +21,7 @@ public sealed class MongoTextIndexFixture : IAsyncLifetime
{ {
TestUtils.SetupBson(); TestUtils.SetupBson();
var mongoClient = new MongoClient(TestConfig.Configuration["mongodb:configuration"]); var mongoClient = MongoClientFactory.Create(TestConfig.Configuration["mongodb:configuration"]);
var mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]); var mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]);
Index = new MongoTextIndex(mongoDatabase); Index = new MongoTextIndex(mongoDatabase);

3
backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/MongoDb/SchemasHashFixture.cs

@ -9,6 +9,7 @@ using MongoDB.Driver;
using Squidex.Domain.Apps.Core.TestHelpers; using Squidex.Domain.Apps.Core.TestHelpers;
using Squidex.Domain.Apps.Entities.MongoDb.Schemas; using Squidex.Domain.Apps.Entities.MongoDb.Schemas;
using Squidex.Domain.Apps.Entities.TestHelpers; using Squidex.Domain.Apps.Entities.TestHelpers;
using Squidex.Infrastructure.MongoDb;
namespace Squidex.Domain.Apps.Entities.Schemas.MongoDb; namespace Squidex.Domain.Apps.Entities.Schemas.MongoDb;
@ -20,7 +21,7 @@ public sealed class SchemasHashFixture
{ {
TestUtils.SetupBson(); TestUtils.SetupBson();
var mongoClient = new MongoClient(TestConfig.Configuration["mongodb:configuration"]); var mongoClient = MongoClientFactory.Create(TestConfig.Configuration["mongodb:configuration"]);
var mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]); var mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]);
var schemasHash = new MongoSchemasHash(mongoDatabase); var schemasHash = new MongoSchemasHash(mongoDatabase);

12
backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj

@ -22,17 +22,17 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.3.1" /> <PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="FluentAssertions" Version="6.8.0" /> <PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="GraphQL" Version="7.2.1" /> <PackageReference Include="GraphQL" Version="7.3.0" />
<PackageReference Include="GraphQL.SystemTextJson" Version="7.2.1" /> <PackageReference Include="GraphQL.SystemTextJson" Version="7.3.0" />
<PackageReference Include="Lorem.Universal.Net" Version="4.0.80" /> <PackageReference Include="Lorem.Universal.Net" Version="4.0.80" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.1" /> <PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Reactive.Linq" Version="5.0.0" /> <PackageReference Include="System.Reactive.Linq" Version="5.0.0" />

6
backend/tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj

@ -15,12 +15,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.3.1" /> <PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="FluentAssertions" Version="6.8.0" /> <PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" /> <PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit" Version="2.4.2" />

3
backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Consume/EventConsumerProcessorIntegrationTests.cs

@ -8,6 +8,7 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using MongoDB.Driver; using MongoDB.Driver;
using Squidex.Caching; using Squidex.Caching;
using Squidex.Infrastructure.MongoDb;
using Squidex.Infrastructure.Reflection; using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.States; using Squidex.Infrastructure.States;
using Squidex.Infrastructure.TestHelpers; using Squidex.Infrastructure.TestHelpers;
@ -61,7 +62,7 @@ public abstract class EventConsumerProcessorIntegrationTests
var eventConsumer = new EventConsumer(); var eventConsumer = new EventConsumer();
var mongoClient = new MongoClient(TestConfig.Configuration["mongodb:configuration"]); var mongoClient = MongoClientFactory.Create(TestConfig.Configuration["mongodb:configuration"]);
var mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]); var mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]);
var typeRegistry = new TypeRegistry().Add<IEvent, MyEvent>("MyEvent"); var typeRegistry = new TypeRegistry().Add<IEvent, MyEvent>("MyEvent");

2
backend/tests/Squidex.Infrastructure.Tests/EventSourcing/GetEventStoreFixture.cs

@ -20,7 +20,7 @@ public sealed class GetEventStoreFixture : IAsyncLifetime
{ {
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
settings = EventStoreClientSettings.Create(TestConfig.Configuration["eventStore:configuration"]); settings = EventStoreClientSettings.Create(TestConfig.Configuration["eventStore:configuration"]!);
EventStore = new GetEventStore(settings, TestUtils.DefaultSerializer); EventStore = new GetEventStore(settings, TestUtils.DefaultSerializer);
} }

3
backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs

@ -6,6 +6,7 @@
// ========================================================================== // ==========================================================================
using MongoDB.Driver; using MongoDB.Driver;
using MongoDB.Driver.Linq;
using Squidex.Infrastructure.MongoDb; using Squidex.Infrastructure.MongoDb;
using Squidex.Infrastructure.TestHelpers; using Squidex.Infrastructure.TestHelpers;
@ -23,7 +24,7 @@ public abstract class MongoEventStoreFixture : IAsyncLifetime
protected MongoEventStoreFixture(string connectionString) protected MongoEventStoreFixture(string connectionString)
{ {
mongoClient = new MongoClient(connectionString); mongoClient = MongoClientFactory.Create(connectionString);
mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]); mongoDatabase = mongoClient.GetDatabase(TestConfig.Configuration["mongodb:database"]);
BsonJsonConvention.Register(TestUtils.DefaultOptions()); BsonJsonConvention.Register(TestUtils.DefaultOptions());

6
backend/tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj

@ -15,13 +15,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.3.1" /> <PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="FluentAssertions" Version="6.8.0" /> <PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" /> <PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" /> <PackageReference Include="System.ValueTuple" Version="4.5.0" />

4
backend/tests/Squidex.Infrastructure.Tests/TestHelpers/TestUtils.cs

@ -12,6 +12,7 @@ using System.Text.Json.Serialization;
using MongoDB.Bson.IO; using MongoDB.Bson.IO;
using MongoDB.Bson.Serialization; using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Serializers;
using NodaTime; using NodaTime;
using NodaTime.Serialization.SystemTextJson; using NodaTime.Serialization.SystemTextJson;
using Squidex.Infrastructure.Json; using Squidex.Infrastructure.Json;
@ -45,6 +46,9 @@ public static class TestUtils
public static void SetupBson() public static void SetupBson()
{ {
// Allow all types, independent from the actual assembly.
BsonSerializer.TryRegisterSerializer(new ObjectSerializer(type => true));
BsonDomainIdSerializer.Register(); BsonDomainIdSerializer.Register();
BsonEscapedDictionarySerializer<JsonValue, JsonObject>.Register(); BsonEscapedDictionarySerializer<JsonValue, JsonObject>.Register();
BsonInstantSerializer.Register(); BsonInstantSerializer.Register();

6
backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj

@ -13,12 +13,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.3.1" /> <PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="FluentAssertions" Version="6.8.0" /> <PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.22">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">

15
frontend/src/app/features/settings/pages/clients/client-connect-form.component.html

@ -169,6 +169,21 @@
</p> </p>
</div> </div>
<div class="section step">
<h5><span class="badge rounded-pill bg-dark">2</span> {{ 'clients.connectWizard.sdkStep2_15' | sqxTranslate }}</h5>
<p>
<sqx-code>
<div ngPreserveWhitespaces>var client = new SquidexClient(new SquidexOptions</div>
<div ngPreserveWhitespaces>{{'{'}}</div>
<div ngPreserveWhitespaces> AppName = {{appName}},</div>
<div ngPreserveWhitespaces> ClientId = {{appName}}:{{client.id}},</div>
<div ngPreserveWhitespaces> ClientSecret = {{client.secret}},</div>
<div ngPreserveWhitespaces> Url = {{apiUrl.value}}</div>
<div ngPreserveWhitespaces>});</div>
</sqx-code>
</p>
</div>
<div class="section step"> <div class="section step">
<h5><span class="badge rounded-pill bg-dark">3</span> {{ 'clients.connectWizard.sdkStep3' | sqxTranslate }}</h5> <h5><span class="badge rounded-pill bg-dark">3</span> {{ 'clients.connectWizard.sdkStep3' | sqxTranslate }}</h5>

6
tools/TestSuite/TestSuite.ApiTests/AdminUsersTests.cs

@ -44,8 +44,8 @@ public sealed class AdminUsersTests : IClassFixture<ClientFixture>
// STEP 2: Get users by email. // STEP 2: Get users by email.
var usersByEmail = await _.Client.UserManagement.GetUsersAsync(user_0.Email); var usersByEmail = await _.Client.UserManagement.GetUsersAsync(user_0.Email);
Assert.Equal(email, usersByEmail.Items.First().Email); Assert.Equal(email, usersByEmail.Items[0].Email);
Assert.Equal(email, usersByEmail.Items.First().DisplayName); Assert.Equal(email, usersByEmail.Items[0].DisplayName);
} }
[Fact] [Fact]
@ -97,7 +97,7 @@ public sealed class AdminUsersTests : IClassFixture<ClientFixture>
Assert.Equal(email, user_0.DisplayName); Assert.Equal(email, user_0.DisplayName);
// STEP 1: Delete user // STEP 1: Delete user.
await _.Client.UserManagement.DeleteUserAsync(user_0.Id); await _.Client.UserManagement.DeleteUserAsync(user_0.Id);

4
tools/TestSuite/TestSuite.ApiTests/AnonymousTests.cs

@ -45,7 +45,7 @@ public class AnonymousTests : IClassFixture<ClientFixture>
await app.Apps.PutClientAsync("default", clientRequest); await app.Apps.PutClientAsync("default", clientRequest);
// STEP 3: Check anonymous permission // STEP 3: Check anonymous permission.
var url = $"{_.Client.Options.Url}api/apps/{appName}/settings"; var url = $"{_.Client.Options.Url}api/apps/{appName}/settings";
using (var httpClient = new HttpClient()) using (var httpClient = new HttpClient())
@ -77,7 +77,7 @@ public class AnonymousTests : IClassFixture<ClientFixture>
await app.Apps.PutClientAsync("default", clientRequest); await app.Apps.PutClientAsync("default", clientRequest);
// STEP 3: Create schema // STEP 3: Create schema.
var schemaRequest = new CreateSchemaDto var schemaRequest = new CreateSchemaDto
{ {
Name = "my-content", Name = "my-content",

2
tools/TestSuite/TestSuite.ApiTests/AppClientsTests.cs

@ -93,7 +93,7 @@ public sealed class AppClientsTests : IClassFixture<ClientFixture>
var client = await CreateAsync(app); var client = await CreateAsync(app);
// STEP 1: Delete client // STEP 1: Delete client.
var clients_2 = await app.Apps.DeleteClientAsync(client.Id); var clients_2 = await app.Apps.DeleteClientAsync(client.Id);
// Should not return deleted client. // Should not return deleted client.

31
tools/TestSuite/TestSuite.ApiTests/AppCreationTests.cs

@ -28,28 +28,28 @@ public class AppCreationTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_create_app() public async Task Should_create_app()
{ {
// STEP 1: Create app // STEP 1: Create app.
var (app, dto) = await _.PostAppAsync(appName); var (app, dto) = await _.PostAppAsync(appName);
// Should return created app with correct name. // Should return created app with correct name.
Assert.Equal(appName, app.Options.AppName); Assert.Equal(appName, app.Options.AppName);
// STEP 2: Get all apps // STEP 2: Get all apps.
var apps = await app.Apps.GetAppsAsync(); var apps = await app.Apps.GetAppsAsync();
// Should provide new app when apps are queried. // Should provide new app when apps are queried.
Assert.Contains(apps, x => x.Name == appName); Assert.Contains(apps, x => x.Name == appName);
// STEP 3: Check contributors // STEP 3: Check contributors.
var contributors = await app.Apps.GetContributorsAsync(); var contributors = await app.Apps.GetContributorsAsync();
// Should not add client itself as a contributor. // Should not add client itself as a contributor.
Assert.Empty(contributors.Items); Assert.Empty(contributors.Items);
// STEP 4: Check clients // STEP 4: Check clients.
var clients = await app.Apps.GetClientsAsync(); var clients = await app.Apps.GetClientsAsync();
// Should create default client. // Should create default client.
@ -61,11 +61,11 @@ public class AppCreationTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_not_allow_creation_if_name_used() public async Task Should_not_allow_creation_if_name_used()
{ {
// STEP 1: Create app // STEP 1: Create app.
await _.PostAppAsync(appName); await _.PostAppAsync(appName);
// STEP 2: Create again and fail // STEP 2: Create again and fail.
var ex = await Assert.ThrowsAnyAsync<SquidexManagementException>(() => var ex = await Assert.ThrowsAnyAsync<SquidexManagementException>(() =>
{ {
return _.PostAppAsync(appName); return _.PostAppAsync(appName);
@ -77,11 +77,11 @@ public class AppCreationTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_archive_app() public async Task Should_archive_app()
{ {
// STEP 1: Create app // STEP 1: Create app.
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 2: Archive app // STEP 2: Archive app.
await app.Apps.DeleteAppAsync(); await app.Apps.DeleteAppAsync();
var apps = await app.Apps.GetAppsAsync(); var apps = await app.Apps.GetAppsAsync();
@ -93,21 +93,16 @@ public class AppCreationTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_recreate_after_archived() public async Task Should_recreate_after_archived()
{ {
// STEP 1: Create app // STEP 1: Create app.
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 2: Archive app // STEP 2: Archive app.
await app.Apps.DeleteAppAsync(); await app.Apps.DeleteAppAsync();
// STEP 3: Create app again // STEP 3: Create app again.
var createRequest = new CreateAppDto await _.PostAppAsync(appName);
{
Name = appName
};
await _.PostAppAsync(createRequest);
} }
[Fact] [Fact]
@ -130,7 +125,7 @@ public class AppCreationTests : IClassFixture<ClientFixture>
var (app, _) = await _.PostAppAsync(createRequest); var (app, _) = await _.PostAppAsync(createRequest);
// STEP 3: Get schemas // STEP 3: Get schemas.
var schemas = await app.Schemas.GetSchemasAsync(); var schemas = await app.Schemas.GetSchemasAsync();
Assert.NotEmpty(schemas.Items); Assert.NotEmpty(schemas.Items);

10
tools/TestSuite/TestSuite.ApiTests/AppLanguagesTests.cs

@ -29,7 +29,7 @@ public sealed class AppLanguagesTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_add_language() public async Task Should_add_language()
{ {
// STEP 0: Add app. // STEP 0: Create app.
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
@ -47,7 +47,7 @@ public sealed class AppLanguagesTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_add_custom_language() public async Task Should_add_custom_language()
{ {
// STEP 0: Add app. // STEP 0: Create app.
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
@ -65,7 +65,7 @@ public sealed class AppLanguagesTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_update_language() public async Task Should_update_language()
{ {
// STEP 0: Add app. // STEP 0: Create app.
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
@ -96,7 +96,7 @@ public sealed class AppLanguagesTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_update_master_language() public async Task Should_update_master_language()
{ {
// STEP 0: Add app. // STEP 0: Create app.
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
@ -145,7 +145,7 @@ public sealed class AppLanguagesTests : IClassFixture<ClientFixture>
[Fact] [Fact]
public async Task Should_delete_language() public async Task Should_delete_language()
{ {
// STEP 0: Add app. // STEP 0: Create app.
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);

16
tools/TestSuite/TestSuite.ApiTests/AppRolesTests.cs

@ -30,7 +30,7 @@ public sealed class AppRolesTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_create_role() public async Task Should_create_role()
{ {
// STEP 1: Add role. // STEP 1: Add role..
var role = await CreateRoleAsync(roleName); var role = await CreateRoleAsync(roleName);
// Should return role with correct name. // Should return role with correct name.
@ -43,7 +43,7 @@ public sealed class AppRolesTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_create_role_with_buggy_name() public async Task Should_create_role_with_buggy_name()
{ {
// STEP 1: Add role. // STEP 1: Add role..
var role = await CreateRoleAsync($"{Guid.NewGuid()}/1"); var role = await CreateRoleAsync($"{Guid.NewGuid()}/1");
// Should return role with correct name. // Should return role with correct name.
@ -56,11 +56,11 @@ public sealed class AppRolesTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_update_role() public async Task Should_update_role()
{ {
// STEP 1: Add role. // STEP 1: Add role..
var role = await CreateRoleAsync(roleName); var role = await CreateRoleAsync(roleName);
// STEP 2: Update role. // STEP 2: Update role..
var updateRequest = new UpdateRoleDto var updateRequest = new UpdateRoleDto
{ {
Permissions = new List<string> { "a", "b" } Permissions = new List<string> { "a", "b" }
@ -79,7 +79,7 @@ public sealed class AppRolesTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_prevent_deletion_if_client_assigned() public async Task Should_prevent_deletion_if_client_assigned()
{ {
// STEP 1: Add role. // STEP 1: Add role..
var role = await CreateRoleAsync(roleName); var role = await CreateRoleAsync(roleName);
@ -125,7 +125,7 @@ public sealed class AppRolesTests : IClassFixture<CreatedAppFixture>
var role = await CreateRoleAsync(roleName); var role = await CreateRoleAsync(roleName);
// STEP 2 Assign contributor. // STEP 2 Assign contributor..
await AssignContributor(roleName); await AssignContributor(roleName);
var roles_2 = await _.Client.Apps.GetRolesAsync(); var roles_2 = await _.Client.Apps.GetRolesAsync();
@ -136,7 +136,7 @@ public sealed class AppRolesTests : IClassFixture<CreatedAppFixture>
Assert.Equal(1, role_2.NumContributors); Assert.Equal(1, role_2.NumContributors);
// STEP 4: Try to delete role. // STEP 4: Try to delete role..
var ex = await Assert.ThrowsAnyAsync<SquidexManagementException>(() => var ex = await Assert.ThrowsAnyAsync<SquidexManagementException>(() =>
{ {
return _.Client.Apps.DeleteRoleAsync(roleName); return _.Client.Apps.DeleteRoleAsync(roleName);
@ -145,7 +145,7 @@ public sealed class AppRolesTests : IClassFixture<CreatedAppFixture>
Assert.Equal(400, ex.StatusCode); Assert.Equal(400, ex.StatusCode);
// STEP 5: Remove role after contributor removed. // STEP 5: Remove role after contributor removed..
await AssignContributor("Developer"); await AssignContributor("Developer");
var roles_3 = await _.Client.Apps.DeleteRoleAsync(roleName); var roles_3 = await _.Client.Apps.DeleteRoleAsync(roleName);

4
tools/TestSuite/TestSuite.ApiTests/AppTests.cs

@ -35,7 +35,7 @@ public sealed class AppTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_set_label() public async Task Should_set_label()
{ {
// STEP 1: Update app // STEP 1: Update app.
var updateRequest = new UpdateAppDto var updateRequest = new UpdateAppDto
{ {
Label = Guid.NewGuid().ToString() Label = Guid.NewGuid().ToString()
@ -49,7 +49,7 @@ public sealed class AppTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_set_description() public async Task Should_set_description()
{ {
// STEP 1: Update app // STEP 1: Update app.
var updateRequest = new UpdateAppDto var updateRequest = new UpdateAppDto
{ {
Description = Guid.NewGuid().ToString() Description = Guid.NewGuid().ToString()

93
tools/TestSuite/TestSuite.ApiTests/AssetTests.cs

@ -30,7 +30,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_upload_asset() public async Task Should_upload_asset()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open)) await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
@ -47,7 +47,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_upload_asset_using_tus() public async Task Should_upload_asset_using_tus()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var fileParameter = FileParameter.FromPath("Assets/SampleVideo_1280x720_1mb.mp4"); var fileParameter = FileParameter.FromPath("Assets/SampleVideo_1280x720_1mb.mp4");
await using (fileParameter.Data) await using (fileParameter.Data)
@ -73,7 +73,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
{ {
for (var i = 0; i < 5; i++) for (var i = 0; i < 5; i++)
{ {
// STEP 1: Create asset // STEP 1: Create asset.
progress = new ProgressHandler(); progress = new ProgressHandler();
var fileParameter = FileParameter.FromPath("Assets/SampleVideo_1280x720_1mb.mp4"); var fileParameter = FileParameter.FromPath("Assets/SampleVideo_1280x720_1mb.mp4");
@ -100,7 +100,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
{ {
var id = Guid.NewGuid().ToString(); var id = Guid.NewGuid().ToString();
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", id: id); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", id: id);
Assert.Equal(id, asset_1.Id); Assert.Equal(id, asset_1.Id);
@ -113,7 +113,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
{ {
var id = Guid.NewGuid().ToString(); var id = Guid.NewGuid().ToString();
// STEP 1: Create asset // STEP 1: Create asset.
var fileParameter = FileParameter.FromPath("Assets/logo-squared.png"); var fileParameter = FileParameter.FromPath("Assets/logo-squared.png");
await _.Client.Assets.UploadAssetAsync(fileParameter, progress.AsOptions(id)); await _.Client.Assets.UploadAssetAsync(fileParameter, progress.AsOptions(id));
@ -126,7 +126,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
{ {
var id = Guid.NewGuid().ToString(); var id = Guid.NewGuid().ToString();
// STEP 1: Create asset // STEP 1: Create asset.
await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", id: id); await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", id: id);
@ -142,11 +142,11 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_not_create_very_big_asset() public async Task Should_not_create_very_big_asset()
{ {
// STEP 1: Create small asset // STEP 1: Create small asset.
await _.Client.Assets.UploadRandomFileAsync(1_000_000); await _.Client.Assets.UploadRandomFileAsync(1_000_000);
// STEP 2: Create big asset // STEP 2: Create big asset.
var ex = await Assert.ThrowsAnyAsync<Exception>(() => var ex = await Assert.ThrowsAnyAsync<Exception>(() =>
{ {
return _.Client.Assets.UploadRandomFileAsync(10_000_000); return _.Client.Assets.UploadRandomFileAsync(10_000_000);
@ -159,11 +159,11 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_replace_asset() public async Task Should_replace_asset()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
// STEP 2: Reupload asset // STEP 2: Reupload asset.
var asset_2 = await _.Client.Assets.UploadFileAsync("Assets/logo-wide.png", asset_1); var asset_2 = await _.Client.Assets.UploadFileAsync("Assets/logo-wide.png", asset_1);
await using (var stream = new FileStream("Assets/logo-wide.png", FileMode.Open)) await using (var stream = new FileStream("Assets/logo-wide.png", FileMode.Open))
@ -180,11 +180,11 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_replace_asset_using_tus() public async Task Should_replace_asset_using_tus()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
// STEP 2: Reupload asset // STEP 2: Reupload asset.
var fileParameter = FileParameter.FromPath("Assets/SampleVideo_1280x720_1mb.mp4"); var fileParameter = FileParameter.FromPath("Assets/SampleVideo_1280x720_1mb.mp4");
await using (fileParameter.Data) await using (fileParameter.Data)
@ -210,11 +210,11 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
{ {
for (var i = 0; i < 1; i++) for (var i = 0; i < 1; i++)
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
// STEP 2: Reupload asset // STEP 2: Reupload asset.
progress = new ProgressHandler(); progress = new ProgressHandler();
var fileParameter = FileParameter.FromPath("Assets/SampleVideo_1280x720_1mb.mp4"); var fileParameter = FileParameter.FromPath("Assets/SampleVideo_1280x720_1mb.mp4");
@ -239,7 +239,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_annote_asset_file_name() public async Task Should_annote_asset_file_name()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
@ -260,7 +260,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_annote_asset_metadata() public async Task Should_annote_asset_metadata()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
@ -285,7 +285,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_annote_asset_slug() public async Task Should_annote_asset_slug()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
@ -306,7 +306,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_annote_asset_tags() public async Task Should_annote_asset_tags()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
@ -331,7 +331,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_annotate_asset_in_parallel() public async Task Should_annotate_asset_in_parallel()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
@ -377,7 +377,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
var asset_2 = await _.Client.Assets.PutAssetAsync(asset_1.Id, metadataRequest); var asset_2 = await _.Client.Assets.PutAssetAsync(asset_1.Id, metadataRequest);
// STEP 4: Check tags // STEP 4: Check tags.
var tags = await _.Client.Assets.WaitForTagsAsync(tag1, TimeSpan.FromMinutes(2)); var tags = await _.Client.Assets.WaitForTagsAsync(tag1, TimeSpan.FromMinutes(2));
Assert.Contains(tag1, tags); Assert.Contains(tag1, tags);
@ -393,11 +393,11 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_protect_asset() public async Task Should_protect_asset()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
// STEP 2: Download asset // STEP 2: Download asset.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open)) await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
{ {
var downloaded = await _.DownloadAsync(asset_1); var downloaded = await _.DownloadAsync(asset_1);
@ -407,7 +407,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
} }
// STEP 4: Protect asset // STEP 4: Protect asset.
var protectRequest = new AnnotateAssetDto var protectRequest = new AnnotateAssetDto
{ {
IsProtected = true IsProtected = true
@ -465,12 +465,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
var appName = Guid.NewGuid().ToString(); var appName = Guid.NewGuid().ToString();
// STEP 0: Create app. // STEP 0: Create app.
var appRequest = new CreateAppDto var (app, _) = await _.PostAppAsync(appName);
{
Name = appName
};
await _.PostAppAsync(appRequest);
// STEP 1: Create folder. // STEP 1: Create folder.
@ -479,14 +474,14 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
FolderName = "folder" FolderName = "folder"
}; };
var folder = await _.Client.Assets.PostAssetFolderAsync(folderRequest); var folder = await app.Assets.PostAssetFolderAsync(folderRequest);
// STEP 2: Create asset // STEP 2: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", parentId: folder.Id); var asset_1 = await app.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", parentId: folder.Id);
// STEP 3: Download asset // STEP 3: Download asset.
await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open)) await using (var stream = new FileStream("Assets/logo-squared.png", FileMode.Open))
{ {
var downloaded = await _.DownloadAsync(asset_1); var downloaded = await _.DownloadAsync(asset_1);
@ -496,7 +491,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
} }
// STEP 4: Protect asset using a script // STEP 4: Protect asset using a script.
var scriptsRequest = new UpdateAssetScriptsDto var scriptsRequest = new UpdateAssetScriptsDto
{ {
Query = $@" Query = $@"
@ -505,7 +500,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
}}" }}"
}; };
await _.Client.Apps.PutAssetScriptsAsync(scriptsRequest); await app.Apps.PutAssetScriptsAsync(scriptsRequest);
// STEP 5: Download asset. // STEP 5: Download asset.
@ -526,7 +521,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_query_asset_by_metadata() public async Task Should_query_asset_by_metadata()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
@ -548,7 +543,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
}); });
// STEP 4: Query asset by custom metadata // STEP 4: Query asset by custom metadata.
var assets_2 = await _.Client.Assets.GetAssetsAsync(new AssetQuery var assets_2 = await _.Client.Assets.GetAssetsAsync(new AssetQuery
{ {
Filter = "metadata/custom eq 'foo'" Filter = "metadata/custom eq 'foo'"
@ -560,7 +555,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_query_asset_by_root_folder() public async Task Should_query_asset_by_root_folder()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
@ -576,7 +571,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_query_asset_by_subfolder() public async Task Should_query_asset_by_subfolder()
{ {
// STEP 1: Create asset folder // STEP 1: Create asset folder.
var folderRequest = new CreateAssetFolderDto var folderRequest = new CreateAssetFolderDto
{ {
FolderName = "sub" FolderName = "sub"
@ -585,7 +580,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
var folder = await _.Client.Assets.PostAssetFolderAsync(folderRequest); var folder = await _.Client.Assets.PostAssetFolderAsync(folderRequest);
// STEP 1: Create asset in folder // STEP 1: Create asset in folder.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", parentId: folder.Id); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", parentId: folder.Id);
@ -601,7 +596,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_delete_recursively() public async Task Should_delete_recursively()
{ {
// STEP 1: Create asset folder // STEP 1: Create asset folder.
var createRequest1 = new CreateAssetFolderDto var createRequest1 = new CreateAssetFolderDto
{ {
FolderName = "folder1" FolderName = "folder1"
@ -610,7 +605,7 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
var folder_1 = await _.Client.Assets.PostAssetFolderAsync(createRequest1); var folder_1 = await _.Client.Assets.PostAssetFolderAsync(createRequest1);
// STEP 2: Create nested asset folder // STEP 2: Create nested asset folder.
var createRequest2 = new CreateAssetFolderDto var createRequest2 = new CreateAssetFolderDto
{ {
FolderName = "subfolder", FolderName = "subfolder",
@ -621,11 +616,11 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
var folder_2 = await _.Client.Assets.PostAssetFolderAsync(createRequest2); var folder_2 = await _.Client.Assets.PostAssetFolderAsync(createRequest2);
// STEP 3: Create asset in folder // STEP 3: Create asset in folder.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", null, folder_2.Id); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png", null, folder_2.Id);
// STEP 4: Create asset outside folder // STEP 4: Create asset outside folder.
var asset_2 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_2 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
@ -644,11 +639,11 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[InlineData(true)] [InlineData(true)]
public async Task Should_delete_asset(bool permanent) public async Task Should_delete_asset(bool permanent)
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
// STEP 2: Delete asset // STEP 2: Delete asset.
await _.Client.Assets.DeleteAssetAsync(asset.Id, permanent: permanent); await _.Client.Assets.DeleteAssetAsync(asset.Id, permanent: permanent);
// Should return 404 when asset deleted. // Should return 404 when asset deleted.
@ -680,15 +675,15 @@ public class AssetTests : IClassFixture<CreatedAppFixture>
[InlineData(true)] [InlineData(true)]
public async Task Should_recreate_deleted_asset(bool permanent) public async Task Should_recreate_deleted_asset(bool permanent)
{ {
// STEP 1: Create asset // STEP 1: Create asset.
var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png"); var asset_1 = await _.Client.Assets.UploadFileAsync("Assets/logo-squared.png", "image/png");
// STEP 2: Delete asset // STEP 2: Delete asset.
await _.Client.Assets.DeleteAssetAsync(asset_1.Id, permanent: permanent); await _.Client.Assets.DeleteAssetAsync(asset_1.Id, permanent: permanent);
// STEP 3: Recreate asset // STEP 3: Recreate asset.
var asset_2 = await _.Client.Assets.UploadFileAsync("Assets/logo-wide.png", "image/png"); var asset_2 = await _.Client.Assets.UploadFileAsync("Assets/logo-wide.png", "image/png");
Assert.NotEqual(asset_1.FileSize, asset_2.FileSize); Assert.NotEqual(asset_1.FileSize, asset_2.FileSize);

22
tools/TestSuite/TestSuite.ApiTests/BackupTests.cs

@ -35,15 +35,15 @@ public class BackupTests : IClassFixture<ClientFixture>
// Load the backup from another URL, because the public URL is might not be accessible for the server. // Load the backup from another URL, because the public URL is might not be accessible for the server.
var backupUrl = TestHelpers.GetAndPrintValue("config:backupUrl", _.Url); var backupUrl = TestHelpers.GetAndPrintValue("config:backupUrl", _.Url);
// STEP 1: Create app // STEP 0: Create app.
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 2: Prepare app. // STEP 1: Prepare app.
await PrepareAppAsync(app); await PrepareAppAsync(app);
// STEP 3: Create backup // STEP 2: Create backup.
await app.Backups.PostBackupAsync(); await app.Backups.PostBackupAsync();
var backups = await app.Backups.WaitForBackupsAsync(x => x.Status is JobStatus.Completed or JobStatus.Failed, TimeSpan.FromMinutes(2)); var backups = await app.Backups.WaitForBackupsAsync(x => x.Status is JobStatus.Completed or JobStatus.Failed, TimeSpan.FromMinutes(2));
@ -52,7 +52,7 @@ public class BackupTests : IClassFixture<ClientFixture>
Assert.Equal(JobStatus.Completed, backup?.Status); Assert.Equal(JobStatus.Completed, backup?.Status);
// STEP 4: Restore backup // STEP 3: Restore backup.
var uri = new Uri(new Uri(backupUrl), backup._links["download"].Href); var uri = new Uri(new Uri(backupUrl), backup._links["download"].Href);
var restoreRequest = new RestoreRequestDto var restoreRequest = new RestoreRequestDto
@ -65,7 +65,7 @@ public class BackupTests : IClassFixture<ClientFixture>
await _.Client.Backups.PostRestoreJobAsync(restoreRequest); await _.Client.Backups.PostRestoreJobAsync(restoreRequest);
// STEP 5: Wait for the backup. // STEP 4: Wait for the backup.
var restore = await app.Backups.WaitForRestoreAsync(x => x.Url == uri && x.Status is JobStatus.Completed or JobStatus.Failed, TimeSpan.FromMinutes(2)); var restore = await app.Backups.WaitForRestoreAsync(x => x.Url == uri && x.Status is JobStatus.Completed or JobStatus.Failed, TimeSpan.FromMinutes(2));
Assert.Equal(JobStatus.Completed, restore?.Status); Assert.Equal(JobStatus.Completed, restore?.Status);
@ -77,15 +77,15 @@ public class BackupTests : IClassFixture<ClientFixture>
// Load the backup from another URL, because the public URL is might not be accessible for the server. // Load the backup from another URL, because the public URL is might not be accessible for the server.
var backupUrl = TestHelpers.GetAndPrintValue("config:backupUrl", _.Url); var backupUrl = TestHelpers.GetAndPrintValue("config:backupUrl", _.Url);
// STEP 1: Create app // STEP 0: Create app.
var (app, _) = await _.PostAppAsync(appNameRestore); var (app, _) = await _.PostAppAsync(appNameRestore);
// STEP 2: Prepare app. // STEP 1: Prepare app.
await PrepareAppAsync(app); await PrepareAppAsync(app);
// STEP 3: Create backup // STEP 2: Create backup.
await app.Backups.PostBackupAsync(); await app.Backups.PostBackupAsync();
var backups = await app.Backups.WaitForBackupsAsync(x => x.Status is JobStatus.Completed or JobStatus.Failed, TimeSpan.FromMinutes(2)); var backups = await app.Backups.WaitForBackupsAsync(x => x.Status is JobStatus.Completed or JobStatus.Failed, TimeSpan.FromMinutes(2));
@ -94,11 +94,11 @@ public class BackupTests : IClassFixture<ClientFixture>
Assert.Equal(JobStatus.Completed, backup?.Status); Assert.Equal(JobStatus.Completed, backup?.Status);
// STEP 4: Delete app // STEP 3: Delete app.
await app.Apps.DeleteAppAsync(); await app.Apps.DeleteAppAsync();
// STEP 5: Restore backup // STEP 4: Restore backup.
var uri = new Uri(new Uri(backupUrl), backup._links["download"].Href); var uri = new Uri(new Uri(backupUrl), backup._links["download"].Href);
var restoreRequest = new RestoreRequestDto var restoreRequest = new RestoreRequestDto
@ -111,7 +111,7 @@ public class BackupTests : IClassFixture<ClientFixture>
await app.Backups.PostRestoreJobAsync(restoreRequest); await app.Backups.PostRestoreJobAsync(restoreRequest);
// STEP 6: Wait for the backup. // STEP 5: Wait for the backup.
var restore = await app.Backups.WaitForRestoreAsync(x => x.Url == uri && x.Status is JobStatus.Completed or JobStatus.Failed, TimeSpan.FromMinutes(2)); var restore = await app.Backups.WaitForRestoreAsync(x => x.Url == uri && x.Status is JobStatus.Completed or JobStatus.Failed, TimeSpan.FromMinutes(2));
Assert.Equal(JobStatus.Completed, restore?.Status); Assert.Equal(JobStatus.Completed, restore?.Status);

2
tools/TestSuite/TestSuite.ApiTests/CommentsTests.cs

@ -45,7 +45,7 @@ public class CommentsTests : IClassFixture<CreatedAppFixture>
await _.Client.Comments.PostCommentAsync(resource, createRequest); await _.Client.Comments.PostCommentAsync(resource, createRequest);
// STEP 2: Get comments // STEP 2: Get comments.
var comments = await _.Client.Comments.GetCommentsAsync(resource); var comments = await _.Client.Comments.GetCommentsAsync(resource);
Assert.Contains(comments.CreatedComments, x => x.Text == createRequest.Text); Assert.Contains(comments.CreatedComments, x => x.Text == createRequest.Text);

2
tools/TestSuite/TestSuite.ApiTests/ContentCleanupTests.cs

@ -80,7 +80,7 @@ public class ContentCleanupTests : IClassFixture<CreatedAppFixture>
}); });
// STEP 3: Delete a reference // STEP 3: Delete a reference.
await contents.DeleteAsync(contentA_1.Id); await contents.DeleteAsync(contentA_1.Id);

6
tools/TestSuite/TestSuite.ApiTests/ContentLanguageTests.cs

@ -25,7 +25,7 @@ public class ContentLanguageTests : IClassFixture<ContentFixture>
[Fact] [Fact]
public async Task Should_filter_language() public async Task Should_filter_language()
{ {
// STEP 1: Create content // STEP 1: Create content.
var content = await _.Contents.CreateAsync(new TestEntityData var content = await _.Contents.CreateAsync(new TestEntityData
{ {
Localized = new Dictionary<string, string> Localized = new Dictionary<string, string>
@ -45,7 +45,7 @@ public class ContentLanguageTests : IClassFixture<ContentFixture>
[InlineData("custom", "Custom")] [InlineData("custom", "Custom")]
public async Task Should_flatten_language(string code, string expected) public async Task Should_flatten_language(string code, string expected)
{ {
// STEP 1: Create content // STEP 1: Create content.
var content = await _.Contents.CreateAsync(new TestEntityData var content = await _.Contents.CreateAsync(new TestEntityData
{ {
Localized = new Dictionary<string, string> Localized = new Dictionary<string, string>
@ -68,7 +68,7 @@ public class ContentLanguageTests : IClassFixture<ContentFixture>
[Fact] [Fact]
public async Task Should_provide_etag_based_on_headers() public async Task Should_provide_etag_based_on_headers()
{ {
// STEP 1: Create content // STEP 1: Create content.
var content = await _.Contents.CreateAsync(new TestEntityData var content = await _.Contents.CreateAsync(new TestEntityData
{ {
Localized = new Dictionary<string, string> Localized = new Dictionary<string, string>

14
tools/TestSuite/TestSuite.ApiTests/ContentReferencesTests.cs

@ -39,20 +39,20 @@ public class ContentReferencesTests : IClassFixture<ContentReferencesFixture>
}, ContentCreateOptions.AsPublish); }, ContentCreateOptions.AsPublish);
// STEP 3: Query new item // STEP 3: Query new item.
var contentB_2 = await _.Contents.GetAsync(contentB_1.Id); var contentB_2 = await _.Contents.GetAsync(contentB_1.Id);
Assert.Empty(contentB_2.Data.References); Assert.Empty(contentB_2.Data.References);
// STEP 4: Publish reference // STEP 4: Publish reference.
await _.Contents.ChangeStatusAsync(contentA_1.Id, new ChangeStatus await _.Contents.ChangeStatusAsync(contentA_1.Id, new ChangeStatus
{ {
Status = "Published" Status = "Published"
}); });
// STEP 5: Query new item again // STEP 5: Query new item again.
var contentB_3 = await _.Contents.GetAsync(contentB_1.Id); var contentB_3 = await _.Contents.GetAsync(contentB_1.Id);
Assert.Equal(new string[] { contentA_1.Id }, contentB_3.Data.References); Assert.Equal(new string[] { contentA_1.Id }, contentB_3.Data.References);
@ -84,7 +84,7 @@ public class ContentReferencesTests : IClassFixture<ContentReferencesFixture>
}); });
// STEP 4: Delete without referrer check // STEP 4: Delete without referrer check.
await _.Contents.DeleteAsync(contentA_1.Id); await _.Contents.DeleteAsync(contentA_1.Id);
} }
@ -117,7 +117,7 @@ public class ContentReferencesTests : IClassFixture<ContentReferencesFixture>
}); });
// STEP 4: Delete without referrer check // STEP 4: Delete without referrer check.
await _.Contents.ChangeStatusAsync(contentA_1.Id, new ChangeStatus await _.Contents.ChangeStatusAsync(contentA_1.Id, new ChangeStatus
{ {
Status = "Draft", Status = "Draft",
@ -161,7 +161,7 @@ public class ContentReferencesTests : IClassFixture<ContentReferencesFixture>
Assert.NotNull(result1[0].Error); Assert.NotNull(result1[0].Error);
// STEP 4: Delete without referrer check // STEP 4: Delete without referrer check.
var result2 = await _.Contents.BulkUpdateAsync(new BulkUpdate var result2 = await _.Contents.BulkUpdateAsync(new BulkUpdate
{ {
Jobs = new List<BulkUpdateJob> Jobs = new List<BulkUpdateJob>
@ -214,7 +214,7 @@ public class ContentReferencesTests : IClassFixture<ContentReferencesFixture>
Assert.NotNull(result1[0].Error); Assert.NotNull(result1[0].Error);
// STEP 4: Delete without referrer check // STEP 4: Delete without referrer check.
var result2 = await _.Contents.BulkUpdateAsync(new BulkUpdate var result2 = await _.Contents.BulkUpdateAsync(new BulkUpdate
{ {
Jobs = new List<BulkUpdateJob> Jobs = new List<BulkUpdateJob>

6
tools/TestSuite/TestSuite.ApiTests/ContentScriptingTests.cs

@ -40,7 +40,7 @@ public class ContentScriptingTests : IClassFixture<CreatedAppFixture>
await TestEntity.CreateSchemaAsync(_.Client.Schemas, schemaName, scripts); await TestEntity.CreateSchemaAsync(_.Client.Schemas, schemaName, scripts);
// STEP 2: Create content // STEP 2: Create content.
var contents = _.Client.Contents<TestEntity, TestEntityData>(schemaName); var contents = _.Client.Contents<TestEntity, TestEntityData>(schemaName);
var content = await contents.CreateAsync(new TestEntityData var content = await contents.CreateAsync(new TestEntityData
@ -65,7 +65,7 @@ public class ContentScriptingTests : IClassFixture<CreatedAppFixture>
await TestEntity.CreateSchemaAsync(_.Client.Schemas, schemaName, scripts); await TestEntity.CreateSchemaAsync(_.Client.Schemas, schemaName, scripts);
// STEP 2: Create content // STEP 2: Create content.
var contents = _.Client.Contents<TestEntity, TestEntityData>(schemaName); var contents = _.Client.Contents<TestEntity, TestEntityData>(schemaName);
var content = await contents.CreateAsync(new TestEntityData var content = await contents.CreateAsync(new TestEntityData
@ -92,7 +92,7 @@ public class ContentScriptingTests : IClassFixture<CreatedAppFixture>
await TestEntity.CreateSchemaAsync(_.Client.Schemas, schemaName, scripts); await TestEntity.CreateSchemaAsync(_.Client.Schemas, schemaName, scripts);
// STEP 2: Create content // STEP 2: Create content.
var contents = _.Client.Contents<TestEntity, TestEntityData>(schemaName); var contents = _.Client.Contents<TestEntity, TestEntityData>(schemaName);
var content = await contents.CreateAsync(new TestEntityData var content = await contents.CreateAsync(new TestEntityData

4
tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs

@ -238,7 +238,7 @@ public class ContentUpdateTests : IClassFixture<ContentFixture>
Assert.Equal(1, updated_1.Data.Number); Assert.Equal(1, updated_1.Data.Number);
// STEP 4: Get the unpublished version // STEP 4: Get the unpublished version.
var unpublished = await _.Contents.GetAsync(content.Id, QueryContext.Default.Unpublished()); var unpublished = await _.Contents.GetAsync(content.Id, QueryContext.Default.Unpublished());
Assert.Equal(2, unpublished.Data.Number); Assert.Equal(2, unpublished.Data.Number);
@ -708,7 +708,7 @@ public class ContentUpdateTests : IClassFixture<ContentFixture>
Assert.Equal(2, content_2.Data.Number); Assert.Equal(2, content_2.Data.Number);
// STEP 4: Get previous version // STEP 4: Get previous version.
var content_1 = await _.Contents.GetAsync(content.Id, content.Version - 1); var content_1 = await _.Contents.GetAsync(content.Id, content.Version - 1);
Assert.Equal(1, content_1.Data.Number); Assert.Equal(1, content_1.Data.Number);

6
tools/TestSuite/TestSuite.ApiTests/GraphQLFixture.cs

@ -165,17 +165,17 @@ public sealed class GraphQLFixture : ContentFixture
return stateResponse.Id; return stateResponse.Id;
} }
// STEP 1: Create state 1 // STEP 1: Create state. 1
var sachsenCapital = await CreateCityAsync("Leipzig"); var sachsenCapital = await CreateCityAsync("Leipzig");
var sachstenState = await CreateStateAsync("Sachsen", sachsenCapital); var sachstenState = await CreateStateAsync("Sachsen", sachsenCapital);
// STEP 1: Create state 2 // STEP 1: Create state. 2
var badenWCapital = await CreateCityAsync("Stuttgart"); var badenWCapital = await CreateCityAsync("Stuttgart");
var badenWState = await CreateStateAsync("Baden Württemberg", badenWCapital); var badenWState = await CreateStateAsync("Baden Württemberg", badenWCapital);
// STEP 3: Create country // STEP 3: Create country.
var countryData = new var countryData = new
{ {
name = new name = new

56
tools/TestSuite/TestSuite.ApiTests/RuleRunnerTests.cs

@ -40,11 +40,11 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Start webhook session // STEP 1: Start webhook session.
var (url, sessionId) = await webhookCatcher.CreateSessionAsync(); var (url, sessionId) = await webhookCatcher.CreateSessionAsync();
// STEP 2: Create rule // STEP 2: Create rule.
var createRule = new CreateRuleDto var createRule = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -64,7 +64,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var rule = await app.Rules.PostRuleAsync(createRule); var rule = await app.Rules.PostRuleAsync(createRule);
// STEP 3: Create test content // STEP 3: Create test content.
await CreateContentAsync(app); await CreateContentAsync(app);
// Get requests. // Get requests.
@ -76,7 +76,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
Assert.Equal(request.Headers["X-Signature"], WebhookUtils.CalculateSignature(request.Content, secret)); Assert.Equal(request.Headers["X-Signature"], WebhookUtils.CalculateSignature(request.Content, secret));
// STEP 4: Get events // STEP 4: Get events.
var eventsAll = await app.Rules.GetEventsAsync(rule.Id); var eventsAll = await app.Rules.GetEventsAsync(rule.Id);
var eventsRule = await app.Rules.GetEventsAsync(); var eventsRule = await app.Rules.GetEventsAsync();
@ -91,11 +91,11 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Start webhook session // STEP 1: Start webhook session.
var (url, sessionId) = await webhookCatcher.CreateSessionAsync(); var (url, sessionId) = await webhookCatcher.CreateSessionAsync();
// STEP 2: Create contents // STEP 2: Create contents.
var referencedSchema = await TestEntity.CreateSchemaAsync(app.Schemas, schemaName); var referencedSchema = await TestEntity.CreateSchemaAsync(app.Schemas, schemaName);
// Create a test content. // Create a test content.
@ -120,7 +120,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
}); });
// STEP 2: Create rule // STEP 2: Create rule.
var createRule = new CreateRuleDto var createRule = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -160,7 +160,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var rule = await app.Rules.PostRuleAsync(createRule); var rule = await app.Rules.PostRuleAsync(createRule);
// STEP 3: Update referenced content // STEP 3: Update referenced content.
var updatedString = Guid.NewGuid().ToString(); var updatedString = Guid.NewGuid().ToString();
var updateEvent = "ReferenceUpdated"; var updateEvent = "ReferenceUpdated";
@ -177,7 +177,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
Assert.NotNull(request); Assert.NotNull(request);
// STEP 4: Get events // STEP 4: Get events.
var eventsAll = await app.Rules.GetEventsAsync(rule.Id); var eventsAll = await app.Rules.GetEventsAsync(rule.Id);
var eventsRule = await app.Rules.GetEventsAsync(); var eventsRule = await app.Rules.GetEventsAsync();
@ -192,11 +192,11 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Start webhook session // STEP 1: Start webhook session.
var (url, sessionId) = await webhookCatcher.CreateSessionAsync(); var (url, sessionId) = await webhookCatcher.CreateSessionAsync();
// STEP 2: Create rule // STEP 2: Create rule.
var createRule = new CreateRuleDto var createRule = new CreateRuleDto
{ {
Action = new ScriptRuleActionDto Action = new ScriptRuleActionDto
@ -214,7 +214,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var rule = await app.Rules.PostRuleAsync(createRule); var rule = await app.Rules.PostRuleAsync(createRule);
// STEP 3: Create test content // STEP 3: Create test content.
await CreateContentAsync(app); await CreateContentAsync(app);
// Get requests. // Get requests.
@ -224,7 +224,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
Assert.NotNull(request); Assert.NotNull(request);
// STEP 4: Get events // STEP 4: Get events.
var eventsAll = await app.Rules.GetEventsAsync(rule.Id); var eventsAll = await app.Rules.GetEventsAsync(rule.Id);
var eventsRule = await app.Rules.GetEventsAsync(); var eventsRule = await app.Rules.GetEventsAsync();
@ -239,11 +239,11 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Start webhook session // STEP 1: Start webhook session.
var (url, sessionId) = await webhookCatcher.CreateSessionAsync(); var (url, sessionId) = await webhookCatcher.CreateSessionAsync();
// STEP 2: Create rule // STEP 2: Create rule.
var createRule = new CreateRuleDto var createRule = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -260,7 +260,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var rule = await app.Rules.PostRuleAsync(createRule); var rule = await app.Rules.PostRuleAsync(createRule);
// STEP 3: Create test asset // STEP 3: Create test asset.
await CreateAssetAsync(app); await CreateAssetAsync(app);
// Get requests. // Get requests.
@ -272,7 +272,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
Assert.Equal(request.Headers["X-Signature"], WebhookUtils.CalculateSignature(request.Content, secret)); Assert.Equal(request.Headers["X-Signature"], WebhookUtils.CalculateSignature(request.Content, secret));
// STEP 4: Get events // STEP 4: Get events.
var eventsAll = await app.Rules.GetEventsAsync(rule.Id); var eventsAll = await app.Rules.GetEventsAsync(rule.Id);
var eventsRule = await app.Rules.GetEventsAsync(); var eventsRule = await app.Rules.GetEventsAsync();
@ -287,11 +287,11 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Start webhook session // STEP 1: Start webhook session.
var (url, sessionId) = await webhookCatcher.CreateSessionAsync(); var (url, sessionId) = await webhookCatcher.CreateSessionAsync();
// STEP 2: Create rule // STEP 2: Create rule.
var createRule = new CreateRuleDto var createRule = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -308,7 +308,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var rule = await app.Rules.PostRuleAsync(createRule); var rule = await app.Rules.PostRuleAsync(createRule);
// STEP 3: Create test schema // STEP 3: Create test schema.
await TestEntity.CreateSchemaAsync(app.Schemas, schemaName); await TestEntity.CreateSchemaAsync(app.Schemas, schemaName);
// Get requests. // Get requests.
@ -320,7 +320,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
Assert.Equal(request.Headers["X-Signature"], WebhookUtils.CalculateSignature(request.Content, secret)); Assert.Equal(request.Headers["X-Signature"], WebhookUtils.CalculateSignature(request.Content, secret));
// STEP 4: Get events // STEP 4: Get events.
var eventsAll = await app.Rules.GetEventsAsync(rule.Id); var eventsAll = await app.Rules.GetEventsAsync(rule.Id);
var eventsRule = await app.Rules.GetEventsAsync(); var eventsRule = await app.Rules.GetEventsAsync();
@ -335,11 +335,11 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Start webhook session // STEP 1: Start webhook session.
var (url, sessionId) = await webhookCatcher.CreateSessionAsync(); var (url, sessionId) = await webhookCatcher.CreateSessionAsync();
// STEP 2: Create rule // STEP 2: Create rule.
var createRule = new CreateRuleDto var createRule = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -356,7 +356,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var rule = await app.Rules.PostRuleAsync(createRule); var rule = await app.Rules.PostRuleAsync(createRule);
// STEP 3: Trigger rule // STEP 3: Trigger rule.
await app.Rules.TriggerRuleAsync(rule.Id); await app.Rules.TriggerRuleAsync(rule.Id);
// Get requests. // Get requests.
@ -368,7 +368,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
Assert.Equal(request.Headers["X-Signature"], WebhookUtils.CalculateSignature(request.Content, secret)); Assert.Equal(request.Headers["X-Signature"], WebhookUtils.CalculateSignature(request.Content, secret));
// STEP 4: Get events // STEP 4: Get events.
var eventsAll = await app.Rules.GetEventsAsync(rule.Id); var eventsAll = await app.Rules.GetEventsAsync(rule.Id);
var eventsRule = await app.Rules.GetEventsAsync(); var eventsRule = await app.Rules.GetEventsAsync();
@ -385,11 +385,11 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Start webhook session // STEP 1: Start webhook session.
var (url, sessionId) = await webhookCatcher.CreateSessionAsync(); var (url, sessionId) = await webhookCatcher.CreateSessionAsync();
// STEP 2: Create disabled rule // STEP 2: Create disabled rule.
var createRule = new CreateRuleDto var createRule = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -411,7 +411,7 @@ public class RuleRunnerTests : IClassFixture<ClientFixture>, IClassFixture<Webho
await app.Rules.DisableRuleAsync(rule.Id); await app.Rules.DisableRuleAsync(rule.Id);
// STEP 3: Create test content before rule // STEP 3: Create test content before rule.
await CreateContentAsync(app); await CreateContentAsync(app);

10
tools/TestSuite/TestSuite.ApiTests/RuleTests.cs

@ -33,7 +33,7 @@ public class RuleTests : IClassFixture<ClientFixture>
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Create rule // STEP 1: Create rule.
var createRule = new CreateRuleDto var createRule = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -63,7 +63,7 @@ public class RuleTests : IClassFixture<ClientFixture>
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Create rule // STEP 1: Create rule.
var createRequest = new CreateRuleDto var createRequest = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -82,7 +82,7 @@ public class RuleTests : IClassFixture<ClientFixture>
var rule_0 = await app.Rules.PostRuleAsync(createRequest); var rule_0 = await app.Rules.PostRuleAsync(createRequest);
// STEP 2: Update rule // STEP 2: Update rule.
var updateRequest = new UpdateRuleDto var updateRequest = new UpdateRuleDto
{ {
Name = ruleName Name = ruleName
@ -102,7 +102,7 @@ public class RuleTests : IClassFixture<ClientFixture>
var (app, _) = await _.PostAppAsync(appName); var (app, _) = await _.PostAppAsync(appName);
// STEP 1: Create rule // STEP 1: Create rule.
var createRequest = new CreateRuleDto var createRequest = new CreateRuleDto
{ {
Action = new WebhookRuleActionDto Action = new WebhookRuleActionDto
@ -121,7 +121,7 @@ public class RuleTests : IClassFixture<ClientFixture>
var rule = await app.Rules.PostRuleAsync(createRequest); var rule = await app.Rules.PostRuleAsync(createRequest);
// STEP 2: Delete rule // STEP 2: Delete rule.
await app.Rules.DeleteRuleAsync(rule.Id); await app.Rules.DeleteRuleAsync(rule.Id);
var rules = await app.Rules.GetRulesAsync(); var rules = await app.Rules.GetRulesAsync();

30
tools/TestSuite/TestSuite.ApiTests/SchemaTests.cs

@ -29,7 +29,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_create_schema() public async Task Should_create_schema()
{ {
// STEP 1: Create schema // STEP 1: Create schema.
var createRequest = new CreateSchemaDto var createRequest = new CreateSchemaDto
{ {
Name = schemaName Name = schemaName
@ -41,7 +41,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
Assert.Equal(schemaName, schema.Name); Assert.Equal(schemaName, schema.Name);
// STEP 2: Get all schemas // STEP 2: Get all schemas.
var schemas = await _.Client.Schemas.GetSchemasAsync(); var schemas = await _.Client.Schemas.GetSchemasAsync();
// Should provide new schema when apps are schemas. // Should provide new schema when apps are schemas.
@ -51,7 +51,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_not_allow_creation_if_name_used() public async Task Should_not_allow_creation_if_name_used()
{ {
// STEP 1: Create schema // STEP 1: Create schema.
var createRequest = new CreateSchemaDto var createRequest = new CreateSchemaDto
{ {
Name = schemaName Name = schemaName
@ -60,7 +60,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
var schema = await _.Client.Schemas.PostSchemaAsync(createRequest); var schema = await _.Client.Schemas.PostSchemaAsync(createRequest);
// STEP 2: Create again and fail // STEP 2: Create again and fail.
var ex = await Assert.ThrowsAnyAsync<SquidexManagementException>(() => var ex = await Assert.ThrowsAnyAsync<SquidexManagementException>(() =>
{ {
return _.Client.Schemas.PostSchemaAsync(createRequest); return _.Client.Schemas.PostSchemaAsync(createRequest);
@ -72,7 +72,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_create_singleton_schema() public async Task Should_create_singleton_schema()
{ {
// STEP 1: Create schema // STEP 1: Create schema.
var createRequest = new CreateSchemaDto var createRequest = new CreateSchemaDto
{ {
Name = schemaName, Name = schemaName,
@ -91,14 +91,14 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
.IgnoreMember<SchemaDto>(x => x.Name); .IgnoreMember<SchemaDto>(x => x.Name);
// STEP 2: Get all schemas // STEP 2: Get all schemas.
var schemas = await _.Client.Schemas.GetSchemasAsync(); var schemas = await _.Client.Schemas.GetSchemasAsync();
// Should provide new schema when apps are schemas. // Should provide new schema when apps are schemas.
Assert.Contains(schemas.Items, x => x.Name == schemaName); Assert.Contains(schemas.Items, x => x.Name == schemaName);
// STEP 3: Get singleton content // STEP 3: Get singleton content.
var content = await _.Client.DynamicContents(schemaName).GetAsync(schema.Id); var content = await _.Client.DynamicContents(schemaName).GetAsync(schema.Id);
Assert.NotNull(content); Assert.NotNull(content);
@ -107,7 +107,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_create_singleton_schema_with_obsolete_property() public async Task Should_create_singleton_schema_with_obsolete_property()
{ {
// STEP 1: Create schema // STEP 1: Create schema.
var createRequest = new CreateSchemaDto var createRequest = new CreateSchemaDto
{ {
Name = schemaName, Name = schemaName,
@ -126,14 +126,14 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
.IgnoreMember<SchemaDto>(x => x.Name); .IgnoreMember<SchemaDto>(x => x.Name);
// STEP 2: Get all schemas // STEP 2: Get all schemas.
var schemas = await _.Client.Schemas.GetSchemasAsync(); var schemas = await _.Client.Schemas.GetSchemasAsync();
// Should provide new schema when apps are schemas. // Should provide new schema when apps are schemas.
Assert.Contains(schemas.Items, x => x.Name == schemaName); Assert.Contains(schemas.Items, x => x.Name == schemaName);
// STEP 3: Get singleton content // STEP 3: Get singleton content.
var content = await _.Client.DynamicContents(schemaName).GetAsync(schema.Id); var content = await _.Client.DynamicContents(schemaName).GetAsync(schema.Id);
Assert.NotNull(content); Assert.NotNull(content);
@ -142,7 +142,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_create_schema_with_checkboxes() public async Task Should_create_schema_with_checkboxes()
{ {
// STEP 1: Create schema // STEP 1: Create schema.
var createRequest = new CreateSchemaDto var createRequest = new CreateSchemaDto
{ {
Name = schemaName, Name = schemaName,
@ -179,7 +179,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_delete_Schema() public async Task Should_delete_Schema()
{ {
// STEP 1: Create schema // STEP 1: Create schema.
var createRequest = new CreateSchemaDto var createRequest = new CreateSchemaDto
{ {
Name = schemaName Name = schemaName
@ -191,7 +191,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
Assert.Equal(schemaName, schema.Name); Assert.Equal(schemaName, schema.Name);
// STEP 2: Delete schema // STEP 2: Delete schema.
await _.Client.Schemas.DeleteSchemaAsync(schemaName); await _.Client.Schemas.DeleteSchemaAsync(schemaName);
var schemas = await _.Client.Schemas.GetSchemasAsync(); var schemas = await _.Client.Schemas.GetSchemasAsync();
@ -203,7 +203,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
[Fact] [Fact]
public async Task Should_recreate_after_deleted() public async Task Should_recreate_after_deleted()
{ {
// STEP 1: Create schema // STEP 1: Create schema.
var createRequest = new CreateSchemaDto var createRequest = new CreateSchemaDto
{ {
Name = schemaName Name = schemaName
@ -219,7 +219,7 @@ public class SchemaTests : IClassFixture<CreatedAppFixture>
await _.Client.Schemas.DeleteSchemaAsync(schemaName); await _.Client.Schemas.DeleteSchemaAsync(schemaName);
// STEP 3: Create app again // STEP 3: Create app again.
await _.Client.Schemas.PostSchemaAsync(createRequest); await _.Client.Schemas.PostSchemaAsync(createRequest);
} }
} }

6
tools/TestSuite/TestSuite.ApiTests/SearchTests.cs

@ -26,7 +26,7 @@ public class SearchTests : IClassFixture<ContentFixture>
[Fact] [Fact]
public async Task Should_search_asset() public async Task Should_search_asset()
{ {
// STEP 1: Create asset // STEP 1: Create asset.
await _.Client.Assets.UploadFileAsync("Assets/logo-wide.png", "image/png"); await _.Client.Assets.UploadFileAsync("Assets/logo-wide.png", "image/png");
@ -39,7 +39,7 @@ public class SearchTests : IClassFixture<ContentFixture>
[Fact] [Fact]
public async Task Should_search_schema() public async Task Should_search_schema()
{ {
// STEP 1: Create schema // STEP 1: Create schema.
var schemaName = Guid.NewGuid().ToString(); var schemaName = Guid.NewGuid().ToString();
var createRequest = new CreateSchemaDto var createRequest = new CreateSchemaDto
@ -59,7 +59,7 @@ public class SearchTests : IClassFixture<ContentFixture>
[Fact] [Fact]
public async Task Should_search_content() public async Task Should_search_content()
{ {
// STEP 1: Create content // STEP 1: Create content.
var contentString = Guid.NewGuid().ToString(); var contentString = Guid.NewGuid().ToString();
var createRequest = new TestEntityData var createRequest = new TestEntityData

2
tools/TestSuite/TestSuite.ApiTests/Settings/VerifySettings.cs

@ -14,7 +14,7 @@ public static class VerifySettings
[ModuleInitializer] [ModuleInitializer]
public static void Initialize() public static void Initialize()
{ {
VerifierSettings.DerivePathInfo((sourceFile, projectDirectory, type, method) => Verifier.DerivePathInfo((sourceFile, projectDirectory, type, method) =>
{ {
var path = Path.Combine(projectDirectory, "Verify"); var path = Path.Combine(projectDirectory, "Verify");

2
tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj

@ -26,7 +26,7 @@
<PackageReference Include="PuppeteerSharp" Version="9.0.2" /> <PackageReference Include="PuppeteerSharp" Version="9.0.2" />
<PackageReference Include="Squidex.Assets" Version="5.4.0" /> <PackageReference Include="Squidex.Assets" Version="5.4.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="Verify.Xunit" Version="17.5.0" /> <PackageReference Include="Verify.Xunit" Version="19.11.2" />
<PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>

48
tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_read_access.verified.txt

@ -1,68 +1,68 @@
{ {
id: Guid_1, Id: Guid_1,
name: Guid_2, Name: Guid_2,
version: 2, Version: 2,
canAccessContent: true, CanAccessContent: true,
_links: { _links: {
assets: { assets: {
method: GET Method: GET
}, },
assets/create: { assets/create: {
method: POST Method: POST
}, },
assets/scripts: { assets/scripts: {
method: DELETE Method: DELETE
}, },
backups: { backups: {
method: GET Method: GET
}, },
clients: { clients: {
method: GET Method: GET
}, },
contributors: { contributors: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
image/delete: { image/delete: {
method: DELETE Method: DELETE
}, },
image/upload: { image/upload: {
method: POST Method: POST
}, },
languages: { languages: {
method: GET Method: GET
}, },
ping: { ping: {
method: GET Method: GET
}, },
plans: { plans: {
method: GET Method: GET
}, },
roles: { roles: {
method: GET Method: GET
}, },
rules: { rules: {
method: GET Method: GET
}, },
schemas: { schemas: {
method: GET Method: GET
}, },
schemas/create: { schemas/create: {
method: POST Method: POST
}, },
settings: { settings: {
method: GET Method: GET
}, },
transfer: { transfer: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
}, },
workflows: { workflows: {
method: GET Method: GET
} }
} }
} }

48
tools/TestSuite/TestSuite.ApiTests/Verify/AnonymousTests.Should_create_app_with_anonymous_write_access.verified.txt

@ -1,68 +1,68 @@
{ {
id: Guid_1, Id: Guid_1,
name: Guid_2, Name: Guid_2,
version: 2, Version: 2,
canAccessContent: true, CanAccessContent: true,
_links: { _links: {
assets: { assets: {
method: GET Method: GET
}, },
assets/create: { assets/create: {
method: POST Method: POST
}, },
assets/scripts: { assets/scripts: {
method: DELETE Method: DELETE
}, },
backups: { backups: {
method: GET Method: GET
}, },
clients: { clients: {
method: GET Method: GET
}, },
contributors: { contributors: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
image/delete: { image/delete: {
method: DELETE Method: DELETE
}, },
image/upload: { image/upload: {
method: POST Method: POST
}, },
languages: { languages: {
method: GET Method: GET
}, },
ping: { ping: {
method: GET Method: GET
}, },
plans: { plans: {
method: GET Method: GET
}, },
roles: { roles: {
method: GET Method: GET
}, },
rules: { rules: {
method: GET Method: GET
}, },
schemas: { schemas: {
method: GET Method: GET
}, },
schemas/create: { schemas/create: {
method: POST Method: POST
}, },
settings: { settings: {
method: GET Method: GET
}, },
transfer: { transfer: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
}, },
workflows: { workflows: {
method: GET Method: GET
} }
} }
} }

12
tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_create_client.verified.txt

@ -1,14 +1,14 @@
{ {
id: Guid_1, Id: Guid_1,
name: Guid_1, Name: Guid_1,
role: Editor, Role: Editor,
allowAnonymous: false, AllowAnonymous: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }

18
tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_delete_client.verified.txt

@ -1,26 +1,26 @@
{ {
items: [ Items: [
{ {
id: default, Id: default,
name: default, Name: default,
role: Owner, Role: Owner,
allowAnonymous: false, AllowAnonymous: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

34
tools/TestSuite/TestSuite.ApiTests/Verify/AppClientsTests.Should_update_client.verified.txt

@ -1,42 +1,42 @@
{ {
items: [ Items: [
{ {
id: default, Id: default,
name: default, Name: default,
role: Owner, Role: Owner,
allowAnonymous: false, AllowAnonymous: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
id: Guid_1, Id: Guid_1,
name: My Client, Name: My Client,
role: Owner, Role: Owner,
apiCallsLimit: 100, ApiCallsLimit: 100,
apiTrafficLimit: 200, ApiTrafficLimit: 200,
allowAnonymous: true, AllowAnonymous: true,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

6
tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_invite_contributor.verified.txt

@ -1,11 +1,11 @@
{ {
role: Developer, Role: Developer,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: POST Method: POST
} }
} }
} }

6
tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_remove_contributor.verified.txt

@ -1,11 +1,11 @@
{ {
maxContributors: -1, MaxContributors: -1,
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

1
tools/TestSuite/TestSuite.ApiTests/Verify/AppContributorsTests.Should_update_contributor.verified.txt

@ -1 +0,0 @@


48
tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app.verified.txt

@ -1,68 +1,68 @@
{ {
id: Guid_1, Id: Guid_1,
name: Guid_2, Name: Guid_2,
version: 2, Version: 2,
canAccessContent: true, CanAccessContent: true,
_links: { _links: {
assets: { assets: {
method: GET Method: GET
}, },
assets/create: { assets/create: {
method: POST Method: POST
}, },
assets/scripts: { assets/scripts: {
method: DELETE Method: DELETE
}, },
backups: { backups: {
method: GET Method: GET
}, },
clients: { clients: {
method: GET Method: GET
}, },
contributors: { contributors: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
image/delete: { image/delete: {
method: DELETE Method: DELETE
}, },
image/upload: { image/upload: {
method: POST Method: POST
}, },
languages: { languages: {
method: GET Method: GET
}, },
ping: { ping: {
method: GET Method: GET
}, },
plans: { plans: {
method: GET Method: GET
}, },
roles: { roles: {
method: GET Method: GET
}, },
rules: { rules: {
method: GET Method: GET
}, },
schemas: { schemas: {
method: GET Method: GET
}, },
schemas/create: { schemas/create: {
method: POST Method: POST
}, },
settings: { settings: {
method: GET Method: GET
}, },
transfer: { transfer: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
}, },
workflows: { workflows: {
method: GET Method: GET
} }
} }
} }

380
tools/TestSuite/TestSuite.ApiTests/Verify/AppCreationTests.Should_create_app_from_templates.verified.txt

@ -1,17 +1,16 @@
{ {
items: [ Items: [
{ {
id: Guid_1, Id: Guid_1,
name: pages, Name: pages,
properties: { Properties: {
label: Pages, Label: Pages,
validateOnPublish: false ValidateOnPublish: false
}, },
isPublished: true, IsPublished: true,
version: 7, Version: 7,
scripts: { Scripts: {
create: Create:
var data = ctx.data; var data = ctx.data;
if (data.title && data.title.iv) { if (data.title && data.title.iv) {
@ -19,8 +18,7 @@
replace(data); replace(data);
}, },
update: Update:
var data = ctx.data; var data = ctx.data;
if (data.title && data.title.iv) { if (data.title && data.title.iv) {
@ -29,181 +27,177 @@
replace(data); replace(data);
} }
}, },
fields: [ Fields: [
{ {
fieldId: 1, FieldId: 1,
name: title, Name: title,
isHidden: false, IsHidden: false,
isLocked: false, IsLocked: false,
isDisabled: false, IsDisabled: false,
partitioning: invariant, Partitioning: invariant,
properties: { Properties: {
fieldType: String, MaxLength: 100,
maxLength: 100, IsUnique: false,
isUnique: false, IsEmbeddable: false,
isEmbeddable: false, InlineEditable: false,
inlineEditable: false, CreateEnum: false,
createEnum: false, Label: Title,
label: Title, Hints: The title of the page.,
hints: The title of the page., IsRequired: true,
isRequired: true, IsRequiredOnPublish: false,
isRequiredOnPublish: false, IsHalfWidth: false
isHalfWidth: false
}, },
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
disable: { disable: {
method: PUT Method: PUT
}, },
hide: { hide: {
method: PUT Method: PUT
}, },
lock: { lock: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
fieldId: 2, FieldId: 2,
name: text, Name: text,
isHidden: false, IsHidden: false,
isLocked: false, IsLocked: false,
isDisabled: false, IsDisabled: false,
partitioning: invariant, Partitioning: invariant,
properties: { Properties: {
fieldType: String, IsUnique: false,
isUnique: false, IsEmbeddable: false,
isEmbeddable: false, InlineEditable: false,
inlineEditable: false, CreateEnum: false,
createEnum: false, Editor: RichText,
editor: RichText, Label: Text,
label: Text, Hints: The text of the page.,
hints: The text of the page., IsRequired: true,
isRequired: true, IsRequiredOnPublish: false,
isRequiredOnPublish: false, IsHalfWidth: false
isHalfWidth: false
}, },
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
disable: { disable: {
method: PUT Method: PUT
}, },
hide: { hide: {
method: PUT Method: PUT
}, },
lock: { lock: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
fieldId: 3, FieldId: 3,
name: slug, Name: slug,
isHidden: false, IsHidden: false,
isLocked: false, IsLocked: false,
isDisabled: true, IsDisabled: true,
partitioning: invariant, Partitioning: invariant,
properties: { Properties: {
fieldType: String, IsUnique: false,
isUnique: false, IsEmbeddable: false,
isEmbeddable: false, InlineEditable: false,
inlineEditable: false, CreateEnum: false,
createEnum: false, Label: Slug (Autogenerated),
label: Slug (Autogenerated), Hints: Autogenerated slug that can be used to identity the page.,
hints: Autogenerated slug that can be used to identity the page., IsRequired: false,
isRequired: false, IsRequiredOnPublish: false,
isRequiredOnPublish: false, IsHalfWidth: false
isHalfWidth: false
}, },
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
enable: { enable: {
method: PUT Method: PUT
}, },
hide: { hide: {
method: PUT Method: PUT
}, },
lock: { lock: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
contents: { contents: {
method: GET Method: GET
}, },
contents/create: { contents/create: {
method: POST Method: POST
}, },
contents/create/publish: { contents/create/publish: {
method: POST Method: POST
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
fields/add: { fields/add: {
method: POST Method: POST
}, },
fields/order: { fields/order: {
method: PUT Method: PUT
}, },
fields/ui: { fields/ui: {
method: PUT Method: PUT
}, },
self: { self: {
method: GET Method: GET
}, },
unpublish: { unpublish: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
}, },
update/category: { update/category: {
method: PUT Method: PUT
}, },
update/rules: { update/rules: {
method: PUT Method: PUT
}, },
update/scripts: { update/scripts: {
method: PUT Method: PUT
}, },
update/sync: { update/sync: {
method: PUT Method: PUT
}, },
update/urls: { update/urls: {
method: PUT Method: PUT
} }
} }
}, },
{ {
id: Guid_2, Id: Guid_2,
name: posts, Name: posts,
properties: { Properties: {
label: Posts, Label: Posts,
validateOnPublish: false ValidateOnPublish: false
}, },
isPublished: true, IsPublished: true,
version: 7, Version: 7,
scripts: { Scripts: {
create: Create:
var data = ctx.data; var data = ctx.data;
if (data.title && data.title.iv) { if (data.title && data.title.iv) {
@ -211,8 +205,7 @@
replace(data); replace(data);
}, },
update: Update:
var data = ctx.data; var data = ctx.data;
if (data.title && data.title.iv) { if (data.title && data.title.iv) {
@ -221,176 +214,173 @@
replace(data); replace(data);
} }
}, },
fields: [ Fields: [
{ {
fieldId: 1, FieldId: 1,
name: title, Name: title,
isHidden: false, IsHidden: false,
isLocked: false, IsLocked: false,
isDisabled: false, IsDisabled: false,
partitioning: invariant, Partitioning: invariant,
properties: { Properties: {
fieldType: String, MaxLength: 100,
maxLength: 100, IsUnique: false,
isUnique: false, IsEmbeddable: false,
isEmbeddable: false, InlineEditable: false,
inlineEditable: false, CreateEnum: false,
createEnum: false, Label: Title,
label: Title, Hints: The title of the post.,
hints: The title of the post., IsRequired: true,
isRequired: true, IsRequiredOnPublish: false,
isRequiredOnPublish: false, IsHalfWidth: false
isHalfWidth: false
}, },
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
disable: { disable: {
method: PUT Method: PUT
}, },
hide: { hide: {
method: PUT Method: PUT
}, },
lock: { lock: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
fieldId: 2, FieldId: 2,
name: text, Name: text,
isHidden: false, IsHidden: false,
isLocked: false, IsLocked: false,
isDisabled: false, IsDisabled: false,
partitioning: invariant, Partitioning: invariant,
properties: { Properties: {
fieldType: String, IsUnique: false,
isUnique: false, IsEmbeddable: false,
isEmbeddable: false, InlineEditable: false,
inlineEditable: false, CreateEnum: false,
createEnum: false, Editor: RichText,
editor: RichText, Label: Text,
label: Text, Hints: The text of the post.,
hints: The text of the post., IsRequired: true,
isRequired: true, IsRequiredOnPublish: false,
isRequiredOnPublish: false, IsHalfWidth: false
isHalfWidth: false
}, },
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
disable: { disable: {
method: PUT Method: PUT
}, },
hide: { hide: {
method: PUT Method: PUT
}, },
lock: { lock: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
fieldId: 3, FieldId: 3,
name: slug, Name: slug,
isHidden: false, IsHidden: false,
isLocked: false, IsLocked: false,
isDisabled: true, IsDisabled: true,
partitioning: invariant, Partitioning: invariant,
properties: { Properties: {
fieldType: String, IsUnique: false,
isUnique: false, IsEmbeddable: false,
isEmbeddable: false, InlineEditable: false,
inlineEditable: false, CreateEnum: false,
createEnum: false, Label: Slug (Autogenerated),
label: Slug (Autogenerated), Hints: Autogenerated slug that can be used to identity the post.,
hints: Autogenerated slug that can be used to identity the post., IsRequired: false,
isRequired: false, IsRequiredOnPublish: false,
isRequiredOnPublish: false, IsHalfWidth: false
isHalfWidth: false
}, },
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
enable: { enable: {
method: PUT Method: PUT
}, },
hide: { hide: {
method: PUT Method: PUT
}, },
lock: { lock: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
contents: { contents: {
method: GET Method: GET
}, },
contents/create: { contents/create: {
method: POST Method: POST
}, },
contents/create/publish: { contents/create/publish: {
method: POST Method: POST
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
fields/add: { fields/add: {
method: POST Method: POST
}, },
fields/order: { fields/order: {
method: PUT Method: PUT
}, },
fields/ui: { fields/ui: {
method: PUT Method: PUT
}, },
self: { self: {
method: GET Method: GET
}, },
unpublish: { unpublish: {
method: PUT Method: PUT
}, },
update: { update: {
method: PUT Method: PUT
}, },
update/category: { update/category: {
method: PUT Method: PUT
}, },
update/rules: { update/rules: {
method: PUT Method: PUT
}, },
update/scripts: { update/scripts: {
method: PUT Method: PUT
}, },
update/sync: { update/sync: {
method: PUT Method: PUT
}, },
update/urls: { update/urls: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

38
tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_custom_language.verified.txt

@ -1,46 +1,46 @@
{ {
items: [ Items: [
{ {
iso2Code: en, Iso2Code: en,
englishName: English, EnglishName: English,
isMaster: true, IsMaster: true,
isOptional: false IsOptional: false
}, },
{ {
iso2Code: abc, Iso2Code: abc,
englishName: , EnglishName: ,
isMaster: false, IsMaster: false,
isOptional: false, IsOptional: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
iso2Code: xyz, Iso2Code: xyz,
englishName: , EnglishName: ,
isMaster: false, IsMaster: false,
isOptional: false, IsOptional: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

38
tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_add_language.verified.txt

@ -1,46 +1,46 @@
{ {
items: [ Items: [
{ {
iso2Code: en, Iso2Code: en,
englishName: English, EnglishName: English,
isMaster: true, IsMaster: true,
isOptional: false IsOptional: false
}, },
{ {
iso2Code: de, Iso2Code: de,
englishName: German, EnglishName: German,
isMaster: false, IsMaster: false,
isOptional: false, IsOptional: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
iso2Code: it, Iso2Code: it,
englishName: Italian, EnglishName: Italian,
isMaster: false, IsMaster: false,
isOptional: false, IsOptional: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

26
tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_delete_language.verified.txt

@ -1,32 +1,32 @@
{ {
items: [ Items: [
{ {
iso2Code: en, Iso2Code: en,
englishName: English, EnglishName: English,
isMaster: true, IsMaster: true,
isOptional: false IsOptional: false
}, },
{ {
iso2Code: it, Iso2Code: it,
englishName: Italian, EnglishName: Italian,
isMaster: false, IsMaster: false,
isOptional: true, IsOptional: true,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

40
tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_language.verified.txt

@ -1,49 +1,49 @@
{ {
items: [ Items: [
{ {
iso2Code: en, Iso2Code: en,
englishName: English, EnglishName: English,
isMaster: true, IsMaster: true,
isOptional: false IsOptional: false
}, },
{ {
iso2Code: de, Iso2Code: de,
englishName: German, EnglishName: German,
fallback: [ Fallback: [
it it
], ],
isMaster: false, IsMaster: false,
isOptional: true, IsOptional: true,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
iso2Code: it, Iso2Code: it,
englishName: Italian, EnglishName: Italian,
isMaster: false, IsMaster: false,
isOptional: false, IsOptional: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

38
tools/TestSuite/TestSuite.ApiTests/Verify/AppLanguagesTests.Should_update_master_language.verified.txt

@ -1,46 +1,46 @@
{ {
items: [ Items: [
{ {
iso2Code: it, Iso2Code: it,
englishName: Italian, EnglishName: Italian,
isMaster: true, IsMaster: true,
isOptional: false IsOptional: false
}, },
{ {
iso2Code: de, Iso2Code: de,
englishName: German, EnglishName: German,
isMaster: false, IsMaster: false,
isOptional: false, IsOptional: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
}, },
{ {
iso2Code: en, Iso2Code: en,
englishName: English, EnglishName: English,
isMaster: false, IsMaster: false,
isOptional: false, IsOptional: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

6
tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role.verified.txt

@ -1,11 +1,11 @@
{ {
isDefaultRole: false, IsDefaultRole: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }

6
tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_create_role_with_buggy_name.verified.txt

@ -1,11 +1,11 @@
{ {
isDefaultRole: false, IsDefaultRole: false,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }

8
tools/TestSuite/TestSuite.ApiTests/Verify/AppRolesTests.Should_update_role.verified.txt

@ -1,15 +1,15 @@
{ {
isDefaultRole: false, IsDefaultRole: false,
permissions: [ Permissions: [
a, a,
b b
], ],
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }

20
tools/TestSuite/TestSuite.ApiTests/Verify/AppTests.Should_update_settings.verified.txt

@ -1,24 +1,24 @@
{ {
patterns: [ Patterns: [
{ {
name: pattern, Name: pattern,
regex: .* Regex: .*
} }
], ],
editors: [ Editors: [
{ {
name: editor, Name: editor,
url: http://squidex.io/path/to/editor Url: http://squidex.io/path/to/editor
} }
], ],
hideScheduler: false, HideScheduler: false,
hideDateTimeModeButton: false, HideDateTimeModeButton: false,
_links: { _links: {
self: { self: {
method: GET Method: GET
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }

36
tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_create_workflow.verified.txt

@ -1,41 +1,41 @@
{ {
id: Guid_1, Id: Guid_1,
name: Guid_2, Name: Guid_2,
steps: { Steps: {
Archived: { Archived: {
transitions: { Transitions: {
Draft: {} Draft: {}
}, },
color: #eb3142, Color: #eb3142,
validate: false, Validate: false,
noUpdate: true NoUpdate: true
}, },
Draft: { Draft: {
transitions: { Transitions: {
Archived: {}, Archived: {},
Published: {} Published: {}
}, },
color: #8091a5, Color: #8091a5,
validate: false, Validate: false,
noUpdate: false NoUpdate: false
}, },
Published: { Published: {
transitions: { Transitions: {
Archived: {}, Archived: {},
Draft: {} Draft: {}
}, },
color: #4bb958, Color: #4bb958,
validate: false, Validate: false,
noUpdate: false NoUpdate: false
} }
}, },
initial: Draft, Initial: Draft,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }

4
tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_delete_workflow.verified.txt

@ -1,10 +1,10 @@
{ {
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

28
tools/TestSuite/TestSuite.ApiTests/Verify/AppWorkflowsTests.Should_update_workflow.verified.txt

@ -1,38 +1,38 @@
{ {
items: [ Items: [
{ {
id: Guid_1, Id: Guid_1,
name: Guid_2, Name: Guid_2,
steps: { Steps: {
Draft: { Draft: {
transitions: { Transitions: {
Published: {} Published: {}
}, },
validate: false, Validate: false,
noUpdate: false NoUpdate: false
}, },
Published: { Published: {
validate: false, Validate: false,
noUpdate: false NoUpdate: false
} }
}, },
initial: Draft, Initial: Draft,
_links: { _links: {
delete: { delete: {
method: DELETE Method: DELETE
}, },
update: { update: {
method: PUT Method: PUT
} }
} }
} }
], ],
_links: { _links: {
create: { create: {
method: POST Method: POST
}, },
self: { self: {
method: GET Method: GET
} }
} }
} }

40
tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_fix_orientation.verified.txt

@ -1,47 +1,47 @@
{ {
id: Guid_1, Id: Guid_1,
parentId: Guid_Empty, ParentId: Guid_Empty,
fileName: logo-wide-rotated.jpg, FileName: logo-wide-rotated.jpg,
fileHash: TLNAlI4UM3i8O4IF/O7ZuH3PrI3+bsz4AsBt9NrEydI=, FileHash: TLNAlI4UM3i8O4IF/O7ZuH3PrI3+bsz4AsBt9NrEydI=,
isProtected: false, IsProtected: false,
slug: logo-wide-rotated.jpg, Slug: logo-wide-rotated.jpg,
mimeType: image/jpg, MimeType: image/jpg,
fileType: jpg, FileType: jpg,
metadataText: 600x135px, 15.1 kB, MetadataText: 600x135px, 15.1 kB,
metadata: { Metadata: {
description: JFIF File, description: JFIF File,
imageQuality: 79, imageQuality: 79,
pixelHeight: 135, pixelHeight: 135,
pixelWidth: 600 pixelWidth: 600
}, },
tags: [ Tags: [
type/jpg, type/jpg,
image, image,
image/medium image/medium
], ],
fileSize: 15425, FileSize: 15425,
type: Image, Type: Image,
_links: { _links: {
content: { content: {
method: GET Method: GET
}, },
content/slug: { content/slug: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
move: { move: {
method: PUT Method: PUT
}, },
self: { self: {
method: GET Method: GET
}, },
update: { update: {
method: PUT Method: PUT
}, },
upload: { upload: {
method: PUT Method: PUT
} }
} }
} }

40
tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_audio_mp3.verified.txt

@ -1,46 +1,46 @@
{ {
id: Guid_1, Id: Guid_1,
parentId: Guid_Empty, ParentId: Guid_Empty,
fileName: SampleAudio_0.4mb.mp3, FileName: SampleAudio_0.4mb.mp3,
fileHash: 0pbi5CFhQWqqSVy37vaw8bUOg3k1tDrlK1ySXxDrmNE=, FileHash: 0pbi5CFhQWqqSVy37vaw8bUOg3k1tDrlK1ySXxDrmNE=,
isProtected: false, IsProtected: false,
slug: sampleaudio-0.4mb.mp3, Slug: sampleaudio-0.4mb.mp3,
mimeType: audio/mp3, MimeType: audio/mp3,
fileType: mp3, FileType: mp3,
metadataText: 00:00:28.2708750, 433.5 kB, MetadataText: 00:00:28.2708750, 433.5 kB,
metadata: { Metadata: {
audioBitrate: 128, audioBitrate: 128,
audioChannels: 2, audioChannels: 2,
audioSampleRate: 44100, audioSampleRate: 44100,
description: MPEG Version 1 Audio, Layer 3, description: MPEG Version 1 Audio, Layer 3,
duration: 00:00:28.2708750 duration: 00:00:28.2708750
}, },
tags: [ Tags: [
type/mp3 type/mp3
], ],
fileSize: 443926, FileSize: 443926,
type: Audio, Type: Audio,
_links: { _links: {
content: { content: {
method: GET Method: GET
}, },
content/slug: { content/slug: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
move: { move: {
method: PUT Method: PUT
}, },
self: { self: {
method: GET Method: GET
}, },
update: { update: {
method: PUT Method: PUT
}, },
upload: { upload: {
method: PUT Method: PUT
} }
} }
} }

40
tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_encode_to_webp.verified.txt

@ -1,45 +1,45 @@
{ {
id: Guid_1, Id: Guid_1,
parentId: Guid_Empty, ParentId: Guid_Empty,
fileName: SampleImage_700kb.bmp, FileName: SampleImage_700kb.bmp,
fileHash: LNQGH33R2ShAFTo54UlxKOKzBg8a+yjVaFgzwiHw2LQ=, FileHash: LNQGH33R2ShAFTo54UlxKOKzBg8a+yjVaFgzwiHw2LQ=,
isProtected: false, IsProtected: false,
slug: sampleimage-700kb.bmp, Slug: sampleimage-700kb.bmp,
mimeType: image/bmp, MimeType: image/bmp,
fileType: bmp, FileType: bmp,
metadataText: 600x400px, 703.2 kB, MetadataText: 600x400px, 703.2 kB,
metadata: { Metadata: {
pixelHeight: 400, pixelHeight: 400,
pixelWidth: 600 pixelWidth: 600
}, },
tags: [ Tags: [
type/bmp, type/bmp,
image, image,
image/medium image/medium
], ],
fileSize: 720054, FileSize: 720054,
type: Image, Type: Image,
_links: { _links: {
content: { content: {
method: GET Method: GET
}, },
content/slug: { content/slug: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
move: { move: {
method: PUT Method: PUT
}, },
self: { self: {
method: GET Method: GET
}, },
update: { update: {
method: PUT Method: PUT
}, },
upload: { upload: {
method: PUT Method: PUT
} }
} }
} }

40
tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_bmp_and_resize.verified.txt

@ -1,45 +1,45 @@
{ {
id: Guid_1, Id: Guid_1,
parentId: Guid_Empty, ParentId: Guid_Empty,
fileName: SampleImage_700kb.bmp, FileName: SampleImage_700kb.bmp,
fileHash: LNQGH33R2ShAFTo54UlxKOKzBg8a+yjVaFgzwiHw2LQ=, FileHash: LNQGH33R2ShAFTo54UlxKOKzBg8a+yjVaFgzwiHw2LQ=,
isProtected: false, IsProtected: false,
slug: sampleimage-700kb.bmp, Slug: sampleimage-700kb.bmp,
mimeType: image/bmp, MimeType: image/bmp,
fileType: bmp, FileType: bmp,
metadataText: 600x400px, 703.2 kB, MetadataText: 600x400px, 703.2 kB,
metadata: { Metadata: {
pixelHeight: 400, pixelHeight: 400,
pixelWidth: 600 pixelWidth: 600
}, },
tags: [ Tags: [
type/bmp, type/bmp,
image, image,
image/medium image/medium
], ],
fileSize: 720054, FileSize: 720054,
type: Image, Type: Image,
_links: { _links: {
content: { content: {
method: GET Method: GET
}, },
content/slug: { content/slug: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
move: { move: {
method: PUT Method: PUT
}, },
self: { self: {
method: GET Method: GET
}, },
update: { update: {
method: PUT Method: PUT
}, },
upload: { upload: {
method: PUT Method: PUT
} }
} }
} }

40
tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_and_resize.verified.txt

@ -1,46 +1,46 @@
{ {
id: Guid_1, Id: Guid_1,
parentId: Guid_Empty, ParentId: Guid_Empty,
fileName: SampleImage_150kb.gif, FileName: SampleImage_150kb.gif,
fileHash: j+n9HuQJ0F4n5z0G29NfFlWJTuaGIW+eqw3NDOYCtU8=, FileHash: j+n9HuQJ0F4n5z0G29NfFlWJTuaGIW+eqw3NDOYCtU8=,
isProtected: false, IsProtected: false,
slug: sampleimage-150kb.gif, Slug: sampleimage-150kb.gif,
mimeType: image/gif, MimeType: image/gif,
fileType: gif, FileType: gif,
metadataText: 600x400px, 154.2 kB, MetadataText: 600x400px, 154.2 kB,
metadata: { Metadata: {
description: GIF File, description: GIF File,
pixelHeight: 400, pixelHeight: 400,
pixelWidth: 600 pixelWidth: 600
}, },
tags: [ Tags: [
type/gif, type/gif,
image, image,
image/medium image/medium
], ],
fileSize: 157934, FileSize: 157934,
type: Image, Type: Image,
_links: { _links: {
content: { content: {
method: GET Method: GET
}, },
content/slug: { content/slug: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
move: { move: {
method: PUT Method: PUT
}, },
self: { self: {
method: GET Method: GET
}, },
update: { update: {
method: PUT Method: PUT
}, },
upload: { upload: {
method: PUT Method: PUT
} }
} }
} }

34
tools/TestSuite/TestSuite.ApiTests/Verify/AssetFormatTests.Should_upload_image_gif_without_extension.verified.txt

@ -1,42 +1,42 @@
{ {
id: Guid_1, Id: Guid_1,
parentId: Guid_Empty, ParentId: Guid_Empty,
isProtected: false, IsProtected: false,
mimeType: image/gif, MimeType: image/gif,
fileType: blob, FileType: blob,
metadataText: 600x400px, 154.2 kB, MetadataText: 600x400px, 154.2 kB,
metadata: { Metadata: {
pixelHeight: 400, pixelHeight: 400,
pixelWidth: 600 pixelWidth: 600
}, },
tags: [ Tags: [
type/blob, type/blob,
image, image,
image/medium image/medium
], ],
fileSize: 157934, FileSize: 157934,
type: Image, Type: Image,
_links: { _links: {
content: { content: {
method: GET Method: GET
}, },
content/slug: { content/slug: {
method: GET Method: GET
}, },
delete: { delete: {
method: DELETE Method: DELETE
}, },
move: { move: {
method: PUT Method: PUT
}, },
self: { self: {
method: GET Method: GET
}, },
update: { update: {
method: PUT Method: PUT
}, },
upload: { upload: {
method: PUT Method: PUT
} }
} }
} }

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

Loading…
Cancel
Save