summaryrefslogtreecommitdiff
path: root/makima/frontend/src/lib/api.ts
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-26 17:03:45 +0000
committerGitHub <noreply@github.com>2026-01-26 17:03:45 +0000
commit6328477bc459eca0243b685553dbd75b925fdc8a (patch)
treebf3eb29258244fea61daf93e128cd91540039dbc /makima/frontend/src/lib/api.ts
parent1d83595f81fbfcc034c37c2260d695f094f5776e (diff)
downloadsoryu-6328477bc459eca0243b685553dbd75b925fdc8a.tar.gz
soryu-6328477bc459eca0243b685553dbd75b925fdc8a.zip
Add dynamic contract type templates with user customization (#33)
- Add 'execute' contract type as a built-in template in backend - Fix API response field name mismatch (types -> contractTypes) - Remove duplicate ContractTypeTemplate definition in api.ts - Merge built-in types from API with user templates from localStorage - User templates created in the Templates page now appear in contract creation Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/frontend/src/lib/api.ts')
-rw-r--r--makima/frontend/src/lib/api.ts38
1 files changed, 1 insertions, 37 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts
index 64ce591..b3c18a5 100644
--- a/makima/frontend/src/lib/api.ts
+++ b/makima/frontend/src/lib/api.ts
@@ -1529,7 +1529,7 @@ export interface ContractTypeTemplate {
/** Response from list contract types endpoint */
export interface ListContractTypesResponse {
- types: ContractTypeTemplate[];
+ contractTypes: ContractTypeTemplate[];
}
/**
@@ -2045,42 +2045,6 @@ export async function getTemplate(id: string): Promise<FileTemplate> {
}
// =============================================================================
-// Contract Type Templates (Workflow Definitions)
-// =============================================================================
-
-/** A contract type template defining a workflow */
-export interface ContractTypeTemplate {
- /** Unique identifier (e.g., 'simple', 'specification', 'feature-development') */
- id: string;
- /** Display name */
- name: string;
- /** What this contract type is for */
- description: string;
- /** Ordered list of phases in the workflow */
- phases: string[];
- /** Starting phase */
- defaultPhase: string;
- /** True for built-in types ('simple', 'specification') */
- isBuiltin: boolean;
-}
-
-export interface ListContractTypesResponse {
- contractTypes: ContractTypeTemplate[];
-}
-
-/**
- * List all available contract type templates.
- * Returns built-in types (simple, specification) and any custom types.
- */
-export async function listContractTypes(): Promise<ListContractTypesResponse> {
- const res = await authFetch(`${API_BASE}/api/v1/contract-types`);
- if (!res.ok) {
- throw new Error(`Failed to list contract types: ${res.statusText}`);
- }
- return res.json();
-}
-
-// =============================================================================
// Supervisor Question Types and Functions
// =============================================================================