Node SDK: TypeScript Types

The SDK exports full TypeScript types for all API objects.

Importing Types

import type {
  TimeEntry,
  CreateTimeEntryInput,
  UpdateTimeEntryInput,
  Expense,
  CreateExpenseInput,
  Project,
  User,
  PaginatedResponse,
  ListTimeEntriesParams,
  ListExpensesParams,
} from '@keito/sdk';

TimeEntry

interface TimeEntry {
  id: string;
  project_id: string;
  task_id: string | null;
  user_id: string;
  spent_date: string;
  hours: number;
  notes: string | null;
  is_running: boolean;
  is_billable: boolean;
  source: 'web' | 'cli' | 'api' | 'agent';
  metadata: Record<string, unknown> | null;
  created_at: string;
  updated_at: string;
}

CreateTimeEntryInput

interface CreateTimeEntryInput {
  project_id: string;
  spent_date: string;
  hours?: number;
  task_id?: string;
  notes?: string;
  is_running?: boolean;
  is_billable?: boolean;
  source?: 'web' | 'cli' | 'api' | 'agent';
  metadata?: Record<string, unknown>;
}

Expense

interface Expense {
  id: string;
  project_id: string;
  expense_category_id: string;
  spent_date: string;
  units: number | null;
  unit_price: number | null;
  total_cost: number;
  notes: string | null;
  source: 'web' | 'cli' | 'api' | 'agent';
  metadata: Record<string, unknown> | null;
  created_at: string;
}

Project

interface Project {
  id: string;
  name: string;
  client_id: string;
  billing_type: 'time_and_materials' | 'fixed_fee' | 'non_billable';
  is_billable: boolean;
  budget_hours: number | null;
  budget_amount: number | null;
  is_active: boolean;
  created_at: string;
}

User

interface User {
  id: string;
  name: string;
  email: string;
  user_type: 'human' | 'agent';
  is_active: boolean;
  billable_rate: number;
  cost_rate: number;
  created_at: string;
}

PaginatedResponse

interface PaginatedResponse<T> {
  data: T[];
  next_cursor: string | null;
  has_more: boolean;
}

Source Type

type Source = 'web' | 'cli' | 'api' | 'agent';