feat(web): licence banner, settings page and feature gating
This commit is contained in:
@@ -791,3 +791,28 @@ export const api = {
|
||||
return `/api/runs/${runId}/servers/${serverId}/logs/stream`;
|
||||
},
|
||||
};
|
||||
|
||||
export type LicenseState = "valid" | "expired" | "invalid";
|
||||
|
||||
export interface LicenseInfo {
|
||||
instance_id: string;
|
||||
state: LicenseState;
|
||||
reason?: string;
|
||||
tier?: string;
|
||||
expires_at?: string;
|
||||
days_remaining?: number;
|
||||
limits: { max_servers: number; max_secret_groups: number; max_channels: number };
|
||||
features: Record<string, boolean>;
|
||||
usage: { servers: number; secret_groups: number; channels: number };
|
||||
source: string;
|
||||
}
|
||||
|
||||
// `request` already prefixes /api, so these paths do not repeat it.
|
||||
export const licence = {
|
||||
get(): Promise<LicenseInfo> {
|
||||
return request<LicenseInfo>("/license");
|
||||
},
|
||||
put(blob: string): Promise<{ state: LicenseState; tier: string; expires_at?: string }> {
|
||||
return request("/license", { method: "POST", body: JSON.stringify({ blob }) });
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user