forked from farhoodlabs/paperclip
e2c5b6698c
Add secure claim secret flow for agent join requests with timing-safe comparison, expiry, and one-time use. Expose machine-readable onboarding manifests and skill index API endpoints. Add company brand color with hex validation, pattern icon generation, and settings page integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
977 B
TypeScript
24 lines
977 B
TypeScript
import type { Company } from "@paperclip/shared";
|
|
import { api } from "./client";
|
|
|
|
export type CompanyStats = Record<string, { agentCount: number; issueCount: number }>;
|
|
|
|
export const companiesApi = {
|
|
list: () => api.get<Company[]>("/companies"),
|
|
get: (companyId: string) => api.get<Company>(`/companies/${companyId}`),
|
|
stats: () => api.get<CompanyStats>("/companies/stats"),
|
|
create: (data: { name: string; description?: string | null; budgetMonthlyCents?: number }) =>
|
|
api.post<Company>("/companies", data),
|
|
update: (
|
|
companyId: string,
|
|
data: Partial<
|
|
Pick<
|
|
Company,
|
|
"name" | "description" | "status" | "budgetMonthlyCents" | "requireBoardApprovalForNewAgents" | "brandColor"
|
|
>
|
|
>,
|
|
) => api.patch<Company>(`/companies/${companyId}`, data),
|
|
archive: (companyId: string) => api.post<Company>(`/companies/${companyId}/archive`, {}),
|
|
remove: (companyId: string) => api.delete<{ ok: true }>(`/companies/${companyId}`),
|
|
};
|