chore: update
ci-api / test (push) Successful in 24m6s
ci-web / test (push) Successful in 13m50s

This commit is contained in:
Xor290
2026-09-20 11:50:02 +02:00
parent cb48bb2b70
commit 76b1412968
23 changed files with 2141 additions and 89 deletions
+48
View File
@@ -58,6 +58,41 @@ export interface Demo {
expires_at: string
}
// Projets vitrine : abonnement de 1 à 12 mois, suspendu à l'échéance puis
// supprimé après un délai de grâce (voir internal/projects côté API).
export type ProjectStatus =
| 'pending'
| 'provisioning'
| 'ready'
| 'suspended'
| 'deleting'
| 'deleted'
| 'failed'
export interface Project {
id: string
client_name: string
status: ProjectStatus
namespace: string
host: string
url: string
admin_username: string
admin_number: number
months_purchased: number
created_at: string
expires_at: string
delete_at: string
suspended_at?: string
}
export interface CreateProjectParams {
clientName: string
months: number
adminUsername: string
adminPassword: string
adminNumber: number
}
export type StorageDriver = 'local' | 's3'
export interface CreateDemoParams {
@@ -215,6 +250,19 @@ export const api = {
request<Demo>('POST', `/demos/${id}/domain`, { domain }),
transferDemoToPremium: (id: string) => request<Demo>('POST', `/demos/${id}/premium`),
listProjects: () => request<{ items: Project[] }>('GET', '/projects'),
createProject: (params: CreateProjectParams) =>
request<Project>('POST', '/projects', {
client_name: params.clientName,
months: params.months,
admin_username: params.adminUsername,
admin_password: params.adminPassword,
admin_number: params.adminNumber,
}),
extendProject: (id: string, months: number) =>
request<Project>('POST', `/projects/${id}/extend`, { months }),
deleteProject: (id: string) => request<Project>('DELETE', `/projects/${id}`),
listCodes: () => request<{ items: CodeBuySub[] }>('GET', '/codes'),
listPremiumUsers: () => request<{ items: PremiumUser[] }>('GET', '/premium'),
createCode: (username: string) =>