Skip to content

Commit 4ced2d8

Browse files
os-zhuangclaude
andcommitted
docs(service-datasource): list REST routes + Studio/Setup-nav integration
The README mentioned "REST routes under /api/v1/datasources" but didn't enumerate them, and predated the Studio integration. Add: - a REST routes section (lifecycle + drivers catalog + by-name test + GET :name detail + introspection/sync routes), with the credential-split note; - a Studio integration section: datasource is managed through the metadata-admin engine (Setup → Integrations → Datasources), runtime records persist to sys_metadata and rehydrate on restart. Reflects #2083 (drivers), #2085 (remote-tables/object-draft/by-name test), #2086 (GET :name), #2091 (Setup nav), #2096 (persistence). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 95b0e9b commit 4ced2d8

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

  • packages/services/service-datasource

packages/services/service-datasource/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,40 @@ layered on by a private host **without forking**.
3333

3434
The runtime admin owns only the `origin: 'runtime'` lifecycle.
3535

36+
## REST routes
37+
38+
Mounted under `/api/v1/datasources` by `registerDatasourceAdminRoutes` (lifecycle
39+
+ introspection) and the federation routes by the external service. Every route
40+
degrades gracefully (`503` / "unavailable") when its service isn't wired.
41+
42+
**Lifecycle & connection**
43+
- `GET /datasources` — list (code + runtime, with provenance/health)
44+
- `GET /datasources/drivers` — driver catalog + per-driver JSON-Schema `configSchema` (drives the Studio connection form)
45+
- `GET /datasources/:name` — one datasource's detail, **credential-stripped** (`config` + `hasSecret`)
46+
- `POST /datasources` — create a runtime datasource
47+
- `PATCH /datasources/:name` — update a runtime datasource
48+
- `DELETE /datasources/:name` — remove a runtime datasource (blocked while objects are bound)
49+
- `POST /datasources/test` — probe an unsaved draft (inline body)
50+
- `POST /datasources/:name/test` — probe a **saved** datasource by name (backs the `test_connection` action)
51+
52+
**Introspection / sync (read-only)**
53+
- `GET /datasources/:name/remote-tables` — list remote tables
54+
- `POST /datasources/:name/object-draft` — generate an object definition draft for one table (no persistence)
55+
- federation import/validate/refresh routes under `/datasources/:name/external/*` (ADR-0015)
56+
57+
Credentials never travel in `config`: a `format:'password'` field is split into
58+
the top-level `secret` on write (encrypted to `sys_secret`), and reads never
59+
echo it (`hasSecret` only).
60+
61+
## Studio integration
62+
63+
`datasource` is a metadata type, so it is administered through the generic
64+
metadata-admin engine (not a bespoke page): the `DatasourceAdminServicePlugin`
65+
contributes a **Datasources** entry to the Setup app's `group_integrations` nav
66+
slot (→ the engine route `…/component/metadata/resource?type=datasource`), where
67+
the list/create/edit/test/**sync objects**/delete UI lives. Runtime records are
68+
persisted to `sys_metadata` and restored (pools rehydrated) on restart.
69+
3670
## Exports
3771

3872
- Federation: `ExternalDatasourceService`, `ExternalDatasourceServicePlugin`.

0 commit comments

Comments
 (0)