chore: update
ci-api / test (push) Successful in 22m11s
ci-web / test (push) Successful in 13m32s

This commit is contained in:
Xor290
2026-08-02 16:54:09 +02:00
parent 09928c0d76
commit 6992e505ae
26 changed files with 681 additions and 695 deletions
-17
View File
@@ -44,14 +44,6 @@ async function request<T>(method: string, path: string, body?: unknown): Promise
export type Role = 'admin' | 'client'
export interface Lead {
id: string
telegram: string
message?: string
status: string
created_at: string
}
export type DemoStatus =
| 'pending'
| 'provisioning'
@@ -63,7 +55,6 @@ export type DemoStatus =
export interface Demo {
id: string
username: string
lead_id?: string
status: DemoStatus
namespace: string
url: string
@@ -76,7 +67,6 @@ export type StorageDriver = 'local' | 's3'
export interface CreateDemoParams {
username: string
leadId?: string
telegramBotUsername?: string
telegramBotToken?: string
nowPaymentsApiKey?: string
@@ -165,19 +155,12 @@ export const api = {
expired_at: string
}>('GET', '/auth/me'), logout: () => request<{ status: string }>('POST', '/auth/logout'),
createLead: (telegram: string, message?: string) =>
request<Lead>('POST', '/leads', { telegram, message }),
listLeads: () => request<{ items: Lead[] }>('GET', '/leads'),
setLeadStatus: (id: string, status: string) =>
request<Lead>('PATCH', `/leads/${id}/status`, { status }),
listDemos: () => request<{ items: Demo[] }>('GET', '/demos'),
listMyDemos: () => request<{ items: Demo[] }>('GET', '/demos/mine'),
getDemo: (id: string) => request<Demo>('GET', `/demos/${id}`),
createDemo: (params: CreateDemoParams) =>
request<Demo>('POST', '/demos', {
username: params.username,
...(params.leadId ? { lead_id: params.leadId } : {}),
...(params.telegramBotUsername ? { telegram_bot_username: params.telegramBotUsername } : {}),
...(params.telegramBotToken ? { telegram_bot_token: params.telegramBotToken } : {}),
...(params.nowPaymentsApiKey ? { nowpayments_api_key: params.nowPaymentsApiKey } : {}),