feat(org): org creation wizard + app profile (v2 phase A1-2)

This commit is contained in:
mjalmoudy94
2026-10-14 10:46:47 +03:30
parent 5095a29df9
commit 5fb85d6eed
13 changed files with 3485 additions and 71 deletions
+156
View File
@@ -1093,3 +1093,159 @@ export interface WsDeployStatusData {
status: ProductionDeployStatus;
message: string;
}
/* -- org wizard (v2 A1-2) ------------------------------------------------- */
export interface CatalogPayload {
app_types: string[];
app_type_labels: Record<string, string>;
git_sources: string[];
languages: CatalogLanguage[];
}
export interface CatalogLanguage {
key: string;
display: string;
frameworks: CatalogFramework[];
}
export interface CatalogFramework {
key: string;
display: string;
app_type: string;
defaults: CatalogDefaults;
}
export interface CatalogDefaults {
runtime_version: string;
package_manager: string;
setup_command: string;
build_command: string | null;
test_command: string | null;
start_command: string;
app_port: number;
healthcheck_path: string;
docker_image: string;
}
export interface WizardCompleteResult {
organization: { id: string; name: string; slug: string };
project: { id: string; name: string; slug: string };
deploy_target_id: string | null;
}
export interface AppProfile {
project_id: string;
app_type: string | null;
language: string | null;
framework: string | null;
runtime_version: string | null;
package_manager: string | null;
setup_command: string | null;
build_command: string | null;
test_command: string | null;
start_command: string | null;
app_port: number | null;
healthcheck_path: string;
git_source: string;
external_repo_url: string | null;
default_branch: string;
wizard_completed: boolean;
}
export interface DeployTargetSummary {
id: string;
kind: string;
host: string;
port: number;
username: string;
auth_type: string;
remote_path: string;
has_secret: boolean;
last_test_ok: boolean | null;
last_test_message: string | null;
}
/* -- org wizard request bodies (v2 A1-2) -------------------------------- */
/** Persisted wizard draft. Secrets are never stored here — only in the final submit. */
export interface SetupDraft {
step: number;
data: Record<string, unknown>;
}
export interface CheckGitBody {
url: string;
auth_type?: string;
username?: string | null;
secret?: string | null;
}
export interface CheckDeployBody {
kind: string;
host: string;
port?: number;
username: string;
auth_type?: string;
secret?: string | null;
remote_path?: string;
}
/** Final wizard submission. Mirrors the backend `WizardCompleteRequest`. */
export interface WizardCompleteBody {
org_name: string;
slug: string;
app_name: string;
app_type: string;
language: string;
framework: string;
runtime_version?: string | null;
package_manager?: string | null;
setup_command?: string | null;
build_command?: string | null;
test_command?: string | null;
start_command?: string | null;
app_port?: number | null;
healthcheck_path?: string;
git_source?: string;
external_repo_url?: string | null;
external_git_auth_type?: string;
external_git_username?: string | null;
external_git_secret?: string | null;
deploy_target_kind?: string | null;
deploy_target_host?: string | null;
deploy_target_port?: number;
deploy_target_username?: string | null;
deploy_target_auth_type?: string;
deploy_target_secret?: string | null;
deploy_target_remote_path?: string;
}
export type DeployTargetPutBody = CheckDeployBody;
export interface GitCredentialsPutBody {
auth_type?: string;
username?: string | null;
secret?: string | null;
}
/** Updatable app-profile fields (org owner/admin only). */
export type AppProfileUpdate = Partial<
Pick<
AppProfile,
| "app_type"
| "language"
| "framework"
| "runtime_version"
| "package_manager"
| "setup_command"
| "build_command"
| "test_command"
| "start_command"
| "app_port"
| "healthcheck_path"
| "git_source"
| "external_repo_url"
| "default_branch"
>
>;