feat(skill): teach direct REST API usage — api-reference/rest-api.md

Comprehensive review found the skill taught CLI-only usage (just one
script-action callback snippet); nothing on calling the API directly.

New guide (verified against the live instance):
- base URL + Bearer PAT auth, Node v24 fetch header-drop warning
- full endpoint map mirrored from the CLI's HTTP layer (records/fields/
  tables/views/presets/workflow/secrets/executions/fire/sql/PAT/signup)
- canonical curl examples incl. typecast/fieldKeyType bodies, url-encoded
  filter, convert-for-options, workflow node PUT + activate, script-action
  callback via triggerInput._apiBaseUrl
- gotchas: typecast never creates choices (silent no-op), visibilityFilter
  400, PATCH field strips options, whole-graph node replace, search[] tuple

SKILL.md: module table row + routing rule wired to the new guide.
This commit is contained in:
yeuimu
2026-09-23 05:20:14 +00:00
parent 4a65294626
commit 2530eea8b5
2 changed files with 155 additions and 0 deletions
+2
View File
@@ -42,6 +42,7 @@ Respond in the user's language. Keep answers concise and action-oriented.
| Execution History | Run results / rerun failures | `runs list/get/rerun` | [automation-guide.md § Testing](guides/automation-guide.md) |
| Manual Trigger | Test button-click/webhook | `fire button-click`, `fire webhook` | [automation-guide.md § Testing](guides/automation-guide.md) |
| SQL | Read-only analytics, JOINs | `sql '<sql>'` | [cli-reference.md § sql](guides/cli-reference.md) |
| Direct REST API | Integrate external scripts/services; endpoints the CLI lacks; script actions calling back | `curl` / `fetch` + `Authorization: Bearer <PAT>` | [rest-api.md](api-reference/rest-api.md) |
| Plugins | Dynamic plugins, dev whitelist, CSP | `plugin *` | [cli-reference.md § plugin](guides/cli-reference.md) |
| Subscriptions | Record digest/instant email | `subscription *` | [subscription.md](guides/subscription.md) |
| Dev/Deploy | Build, restart, gotchas | systemd / pnpm | [development.md](guides/development.md) |
@@ -65,6 +66,7 @@ Full command syntax: [cli-reference.md](guides/cli-reference.md). Instance acces
| Analytics / JOIN | `sql` with GROUP BY | Fetch all records + compute |
| Store an API key for scripts | `secret set` → `process.env.NAME` | Hardcoding |
| Workflow didn't run | `runs list --status failed` → `runs get` | Blind re-activate |
| Call the instance from external code / a route the CLI lacks | Direct REST: `Authorization: Bearer <PAT>` + routes in [rest-api.md](api-reference/rest-api.md); unknown route → run the nearest CLI command with `--debug` and copy its request | Official teable API docs (different automation contract) |
## 3. Key Constraints