chore: update
This commit is contained in:
@@ -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 } : {}),
|
||||
|
||||
Reference in New Issue
Block a user