SurfSense/surfsense_web/lib/apis
CREDO23 b18a5fdca9 feat(web): automations contracts, API client, atoms and hooks
Foundation for the v1 automations UI. Mirrors backend Pydantic schemas
into Zod and wires the data layer end-to-end so feature surfaces can
be built on top.

contracts/types/automation.types.ts:
- AutomationStatus, TriggerType, RunStatus enums.
- AutomationDefinition envelope (PlanStep, TriggerSpec, Execution,
  Metadata, Inputs).
- AutomationCreate/Update/Detail/Summary/List + listParams.
- TriggerCreate/Update/Detail.
- RunSummary/Detail/List + runListParams.

lib/apis/automations-api.service.ts:
- list/get/create/update/delete automations.
- add/update/remove triggers (sub-resource).
- list/get runs (read-only sub-resource).
- safeParse on every write, 204-safe deletes.

atoms/automations/:
- automationsListAtom (active search space, first page).
- 6 mutation atoms with toast + cache invalidation.

hooks/:
- use-automations.ts wraps the list atom.
- use-automation.ts: parameterized detail by id.
- use-automation-runs.ts: useAutomationRuns + useAutomationRun.

lib/query-client/cache-keys.ts: automations namespace (list, detail,
runs, run) keyed by (id, limit, offset) where relevant.

Smoke: zod round-trip OK on backend-shape payloads (Automation,
AutomationCreate, Trigger, Run); typecheck clean for new files;
biome clean.
2026-05-28 00:55:57 +02:00
..
agent-actions-api.service.ts feat: improved agent streaming 2026-04-29 07:20:31 -07:00
agent-flags-api.service.ts feat: moved most things behind correct feature flag 2026-05-02 23:10:48 -07:00
agent-permissions-api.service.ts feat: updated agent harness 2026-04-28 09:22:19 -07:00
agent-tools-api.service.ts feat: refactor agent tools management and add UI integration 2026-03-10 17:36:26 -07:00
anonymous-chat-api.service.ts refactor(anon-chat): route upload through anonymousChatApiService 2026-04-23 03:26:42 -07:00
auth-api.service.ts feat: migrated from zod v3 to v4 2025-12-20 05:10:47 -08:00
automations-api.service.ts feat(web): automations contracts, API client, atoms and hooks 2026-05-28 00:55:57 +02:00
base-api.service.ts fix(web): handle 204 No Content responses in base API service 2026-05-28 00:55:46 +02:00
chat-comments-api.service.ts feat: perf optimizations 2026-02-27 17:19:25 -08:00
chat-threads-api.service.ts refactor: rename snapshot types to PublicChatSnapshot prefix 2026-02-02 16:05:23 +02:00
connectors-api.service.ts connector-popup: surface trusted-tools UI in MCP edit view; consolidate disconnect 2026-05-15 16:40:16 +02:00
documents-api.service.ts chore: ran linting 2026-05-02 03:36:13 +05:30
folders-api.service.ts feat: implement local folder synchronization and versioning with new metadata handling and document_versions table 2026-04-02 23:46:21 +05:30
image-gen-config-api.service.ts chore: linting 2026-02-09 16:49:11 -08:00
incentive-tasks-api.service.ts feat: added incentive credits system 2026-01-26 23:32:30 -08:00
invites-api.service.ts chore: linting 2026-03-27 03:17:05 -07:00
logs-api.service.ts chore: linting 2026-03-27 03:17:05 -07:00
members-api.service.ts chore: linting 2026-03-27 03:17:05 -07:00
new-llm-config-api.service.ts style: simplify LLM model terminology in UI 2026-04-02 10:11:35 +05:30
notes-api.service.ts feat: add source_markdown column to documents and implement migration logic for existing records using a pure-Python BlockNote JSON to Markdown converter 2026-02-17 11:34:11 +05:30
notifications-api.service.ts chore: ran linting 2026-03-10 16:17:12 +05:30
permissions-api.service.ts chore: add TODO for edit role dialog implementation 2025-12-16 09:07:33 +00:00
prompts-api.service.ts add is_public to frontend types and API service 2026-03-30 19:38:00 +02:00
public-chat-api.service.ts feat: add snapshot types and API services 2026-01-30 14:19:56 +02:00
roles-api.service.ts feat: migrated from zod v3 to v4 2025-12-20 05:10:47 -08:00
search-spaces-api.service.ts feat: added ai file sorting 2026-04-14 01:43:30 -07:00
stripe-api.service.ts feat: implement finalize checkout endpoint and update purchase success handling 2026-05-05 01:01:12 -07:00
user-api.service.ts chore: linting 2026-01-15 00:05:53 -08:00
vision-llm-config-api.service.ts Add dynamic vision model list from OpenRouter with combobox selector 2026-04-07 23:39:52 +02:00