Files
Umbraco-CMS/src/Umbraco.Cms.Api.Management/Mapping/Installer/InstallerViewModelsMapDefinition.cs

148 lines
7.3 KiB
C#
Raw Normal View History

Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
using Umbraco.Cms.Core.Install.Models;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Infrastructure.Persistence;
using Umbraco.Cms.Api.Management.ViewModels.Installer;
using Umbraco.Cms.Core.Models.Installer;
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
namespace Umbraco.Cms.Api.Management.Mapping.Installer;
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
public class InstallerViewModelsMapDefinition : IMapDefinition
{
public void DefineMaps(IUmbracoMapper mapper)
{
mapper.Define<InstallRequestModel, InstallData>((source, context) => new InstallData(), Map);
mapper.Define<UserInstallPresentationModel, UserInstallData>((source, context) => new UserInstallData(), Map);
mapper.Define<DatabaseInstallPresentationModel, DatabaseInstallData>((source, context) => new DatabaseInstallData(), Map);
mapper.Define<DatabaseInstallPresentationModel, DatabaseModel>((source, context) => new DatabaseModel(), Map);
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
mapper.Define<DatabaseInstallData, DatabaseModel>((source, context) => new DatabaseModel(), Map);
mapper.Define<InstallSettingsModel, InstallSettingsResponseModel>((source, context) => new InstallSettingsResponseModel(), Map);
mapper.Define<UserSettingsModel, UserSettingsPresentationModel>((source, context) => new UserSettingsPresentationModel(), Map);
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
mapper.Define<IDatabaseProviderMetadata, DatabaseSettingsModel>((source, context) => new DatabaseSettingsModel(), Map);
mapper.Define<DatabaseSettingsModel, DatabaseSettingsPresentationModel>((source, context) => new DatabaseSettingsPresentationModel(), Map);
mapper.Define<ConsentLevelModel, ConsentLevelPresentationModel>((source, context) => new ConsentLevelPresentationModel(), Map);
mapper.Define<UpgradeSettingsModel, UpgradeSettingsResponseModel>((source, context) => new UpgradeSettingsResponseModel(), Map);
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
}
// Umbraco.Code.MapAll
private void Map(UpgradeSettingsModel source, UpgradeSettingsResponseModel target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.CurrentState = source.CurrentState;
target.NewState = source.NewState;
target.NewVersion = source.NewVersion.ToString();
target.OldVersion = source.OldVersion.ToString();
}
// Umbraco.Code.MapAll
private void Map(DatabaseInstallPresentationModel source, DatabaseModel target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.ConnectionString = source.ConnectionString;
target.DatabaseName = source.Name ?? string.Empty;
target.DatabaseProviderMetadataId = source.Id;
target.IntegratedAuth = source.UseIntegratedAuthentication;
target.Login = source.Username;
target.Password = source.Password;
target.ProviderName = source.ProviderName;
target.Server = source.Server!;
target.TrustServerCertificate = source.TrustServerCertificate;
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
}
// Umbraco.Code.MapAll
private static void Map(InstallRequestModel source, InstallData target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.TelemetryLevel = source.TelemetryLevel;
target.User = context.Map<UserInstallData>(source.User)!;
target.Database = context.Map<DatabaseInstallData>(source.Database)!;
}
// Umbraco.Code.MapAll
private static void Map(UserInstallPresentationModel source, UserInstallData target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.Email = source.Email;
target.Name = source.Name;
target.Password = source.Password;
target.SubscribeToNewsletter = source.SubscribeToNewsletter;
}
// Umbraco.Code.MapAll
private static void Map(DatabaseInstallPresentationModel source, DatabaseInstallData target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.Id = source.Id;
target.ProviderName = source.ProviderName;
target.Server = source.Server;
target.Name = source.Name;
target.Username = source.Username;
target.Password = source.Password;
target.UseIntegratedAuthentication = source.UseIntegratedAuthentication;
target.ConnectionString = source.ConnectionString;
target.TrustServerCertificate = source.TrustServerCertificate;
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
}
// Umbraco.Code.MapAll
private static void Map(DatabaseInstallData source, DatabaseModel target, MapperContext context)
{
target.ConnectionString = source.ConnectionString;
target.DatabaseName = source.Name ?? string.Empty;
target.DatabaseProviderMetadataId = source.Id;
target.IntegratedAuth = source.UseIntegratedAuthentication;
target.Login = source.Username;
target.Password = source.Password;
target.ProviderName = source.ProviderName;
target.Server = source.Server!;
target.TrustServerCertificate = source.TrustServerCertificate;
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
}
// Umbraco.Code.MapAll
private static void Map(InstallSettingsModel source, InstallSettingsResponseModel target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.User = context.Map<UserSettingsPresentationModel>(source.UserSettings)!;
target.Databases = context.MapEnumerable<DatabaseSettingsModel, DatabaseSettingsPresentationModel>(source.DatabaseSettings);
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
}
// Umbraco.Code.MapAll
private static void Map(UserSettingsModel source, UserSettingsPresentationModel target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.MinCharLength = source.PasswordSettings.MinCharLength;
target.MinNonAlphaNumericLength = source.PasswordSettings.MinNonAlphaNumericLength;
target.ConsentLevels = context.MapEnumerable<ConsentLevelModel, ConsentLevelPresentationModel>(source.ConsentLevels);
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
}
// Umbraco.Code.MapAll
private static void Map(IDatabaseProviderMetadata source, DatabaseSettingsModel target, MapperContext context)
{
target.DefaultDatabaseName = source.DefaultDatabaseName;
target.DisplayName = source.DisplayName;
target.Id = source.Id;
target.ProviderName = source.ProviderName ?? string.Empty;
target.RequiresConnectionTest = source.RequiresConnectionTest;
target.RequiresCredentials = source.RequiresCredentials;
target.RequiresServer = source.RequiresServer;
target.ServerPlaceholder = source.ServerPlaceholder ?? string.Empty;
target.SortOrder = source.SortOrder;
target.SupportsIntegratedAuthentication = source.SupportsIntegratedAuthentication;
target.IsConfigured = false; // Defaults to false, we'll set this to true if needed,
}
// Umbraco.Code.MapAll
private static void Map(DatabaseSettingsModel source, DatabaseSettingsPresentationModel target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.DefaultDatabaseName = source.DefaultDatabaseName;
target.DisplayName = source.DisplayName;
target.Id = source.Id;
target.IsConfigured = source.IsConfigured;
target.ProviderName = source.ProviderName;
target.RequiresConnectionTest = source.RequiresConnectionTest;
target.RequiresCredentials = source.RequiresCredentials;
target.RequiresServer = source.RequiresServer;
target.ServerPlaceholder = source.ServerPlaceholder;
target.SortOrder = source.SortOrder;
target.SupportsIntegratedAuthentication = source.SupportsIntegratedAuthentication;
}
// Umbraco.Code.MapAll
private static void Map(ConsentLevelModel source, ConsentLevelPresentationModel target, MapperContext context)
Implement new backoffice installer (#12790) * Add new BackOfficeApi project * Add swagger * Add and route new install controller * Add new install steps * Add Setup endpoint * Add missing RequiresExecution methods * Fix nullability of databasemodel * Move user information to separate model * Remove ping method * Add view models install data * Move mapping folder * Move ViewModels * Add settings endpoint * Remove unused binderprovider * Postfix RequiresExecution with async * Update NewDatabaseUpgradeStep to not depend on install step * Add installstep collection * Move registration into backoffice project * Add InstallService * Use service in controller * Add upgrade to install service and use in controller * Correctly check is database is configured * Reorganize * Reorganize into new core and infrastructure * Rename steps * Rename BackofficeApi to MangementApi * Make install step an interface instead of abstract class * Rename InstallStep to create CreateUserStep * Move restart runtime and sign in user into install steps * Move install service into new core project * Map controllers in composer * Restrict access to installcontroller based on runtime level * Use FireAndForget when logging install * Use actionresult instead of iactionresult * Set new projects as not packable * Link to backoffice in 201 response when installed * Register installations * Add custom backoffice routing template token * Move umbraco path trimming out of application convention * Make it easier to route to backoffice api * Make swagger version aware and move behind backoffice path * Obsolete old install classes * Move maps into single file This is all mappint to/from viewmodels in some manner * Remove usage of InstallSetupResult * Move new projects to the src folder * Remove InstallationType from IInstallStep This upgrade steps should implement their own IUpgradeStep interface * Remove upgrade from service and controller This should be its own service and controller * Add xml docs * Remove internals visible to * Disable package validation for new projects Quite the gotcha here, if the projects are brand new, there is no nuget packages to compare with, this causes the build to fail. * Add ValidateDatabase endpoint * Remove project references to new backoffice We don't actually want to depend on this yet, it's just needed for testing/development * Obsolete installationtype * Add DatabaseSettingsFactory tests * Add InstallServiceTests * Fix InstallServiceTests * Test RequireRuntimeLevelAttribute * Implement new backoffice upgrader (#12818) * Add UpgradeSettingsModel and viewmodel * Add upgrade/settings endpoint * Implement upgrade steps * Add upgrade step collection * Add UpgradeService * Add authorize endpoint to UpgradeController * Fix interface * Add upgrade service tests * Remove runtime check in databaseinstallstep * Move RequireRuntimeLevel to controller * Add a readme to the new backoffice part * BackOffice not Backoffice * Add conditional project references * Fixes based on review * Fix up * Move running of steps into its own method in UpgradeService * Make services transient * More fixup * Log exceptions when running steps
2022-08-29 09:50:48 +02:00
{
target.Description = source.Description;
target.Level = source.Level;
}
}