diff --git a/src/Umbraco.Web.UI.Client/schemas/api/api.yml b/src/Umbraco.Web.UI.Client/schemas/api/api.yml index 26aac5895b..dba85c3812 100644 --- a/src/Umbraco.Web.UI.Client/schemas/api/api.yml +++ b/src/Umbraco.Web.UI.Client/schemas/api/api.yml @@ -99,7 +99,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UmbracoInstaller' + $ref: '#/components/schemas/UmbracoInstallerPerformInstallRequest' + required: true + responses: + '201': + description: 201 response + '400': + description: 400 response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /install/database/validate: + post: + operationId: PostInstallValidateDatabase + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UmbracoInstallerDatabaseConfiguration' required: true responses: '201': @@ -277,3 +296,45 @@ components: required: - installId - steps + UmbracoInstallerDatabaseConfiguration: + type: object + properties: + connectionString: + type: string + providerName: + type: string + integratedAuth: + type: boolean + databaseProviderMetadataId: + type: string + required: + - connectionString + - providerName + - integratedAuth + - databaseProviderMetadataId + UmbracoInstallerPerformInstallRequest: + type: object + properties: + name: + type: string + email: + type: string + password: + type: string + subscribeToNewsletter: + type: boolean + telemetryLevel: + type: string + enum: + - Minimal + - Basic + - Detailed + database: + $ref: '#/components/schemas/UmbracoInstallerDatabaseConfiguration' + required: + - name + - email + - password + - subscribeToNewsletter + - telemetryLevel + - database diff --git a/src/Umbraco.Web.UI.Client/schemas/generated-schema.ts b/src/Umbraco.Web.UI.Client/schemas/generated-schema.ts index a7647a5744..cc4a3370ec 100644 --- a/src/Umbraco.Web.UI.Client/schemas/generated-schema.ts +++ b/src/Umbraco.Web.UI.Client/schemas/generated-schema.ts @@ -23,6 +23,9 @@ export interface paths { get: operations["GetInstall"]; post: operations["PostInstall"]; }; + "/install/database/validate": { + post: operations["PostInstallValidateDatabase"]; + }; } export interface components { @@ -91,6 +94,21 @@ export interface components { installId: string; steps: components["schemas"]["UmbracoInstallerStep"][]; }; + UmbracoInstallerDatabaseConfiguration: { + connectionString: string; + providerName: string; + integratedAuth: boolean; + databaseProviderMetadataId: string; + }; + UmbracoInstallerPerformInstallRequest: { + name: string; + email: string; + password: string; + subscribeToNewsletter: boolean; + /** @enum {string} */ + telemetryLevel: "Minimal" | "Basic" | "Detailed"; + database: components["schemas"]["UmbracoInstallerDatabaseConfiguration"]; + }; }; } @@ -197,7 +215,25 @@ export interface operations { }; requestBody: { content: { - "application/json": components["schemas"]["UmbracoInstaller"]; + "application/json": components["schemas"]["UmbracoInstallerPerformInstallRequest"]; + }; + }; + }; + PostInstallValidateDatabase: { + parameters: {}; + responses: { + /** 201 response */ + 201: unknown; + /** 400 response */ + 400: { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["UmbracoInstallerDatabaseConfiguration"]; }; }; }; diff --git a/src/Umbraco.Web.UI.Client/src/installer/installer-user.element.ts b/src/Umbraco.Web.UI.Client/src/installer/installer-user.element.ts index 09592a8dca..d045d35a40 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/installer-user.element.ts +++ b/src/Umbraco.Web.UI.Client/src/installer/installer-user.element.ts @@ -41,11 +41,23 @@ export class UmbInstallerUser extends LitElement { this._install(name, email, password, news); }; - private async _install(name: string, email: string, password: string, news: boolean) { - console.log('Installing', name, email, password, news); + private async _install(name: string, email: string, password: string, subscribeToNewsletter: boolean) { + console.log('Installing', name, email, password, subscribeToNewsletter); try { - await postInstall({}); + await postInstall({ + name, + email, + password, + telemetryLevel: 'Basic', + subscribeToNewsletter, + database: { + connectionString: '', + databaseProviderMetadataId: '1', + integratedAuth: false, + providerName: 'SQLite' + } + }); // TODO: Change to redirect when router has been added. this.dispatchEvent(new CustomEvent('install', { bubbles: true, composed: true })); diff --git a/src/Umbraco.Web.UI.Client/temp-schema-generator/installer.ts b/src/Umbraco.Web.UI.Client/temp-schema-generator/installer.ts index 858ccbddc0..3e3c4a4ce4 100644 --- a/src/Umbraco.Web.UI.Client/temp-schema-generator/installer.ts +++ b/src/Umbraco.Web.UI.Client/temp-schema-generator/installer.ts @@ -17,7 +17,7 @@ export class GetInstall { }) export class PostInstall { @request - request(@body body: UmbracoInstaller) { } + request(@body body: UmbracoInstallerPerformInstallRequest) { } @response({ status: 201 }) success() { } @@ -26,6 +26,37 @@ export class PostInstall { badRequest(@body body: ErrorResponse) { } } +@endpoint({ + method: 'POST', + path: '/install/database/validate' +}) +export class PostInstallValidateDatabase { + @request + request(@body body: UmbracoInstallerDatabaseConfiguration) { } + + @response({ status: 201 }) + success() { } + + @response({ status: 400 }) + badRequest(@body body: ErrorResponse) { } +} + +export interface UmbracoInstallerPerformInstallRequest { + name: string; + email: string; + password: string; + subscribeToNewsletter: boolean; + telemetryLevel: 'Minimal' | 'Basic' | 'Detailed'; + database: UmbracoInstallerDatabaseConfiguration; +} + +export interface UmbracoInstallerDatabaseConfiguration { + connectionString: string; + providerName: string; + integratedAuth: boolean; + databaseProviderMetadataId: string; +} + export interface UmbracoInstaller { installId: string; steps: UmbracoInstallerStep[];