docs(skill): update inkreach-teable skill for fixed field routes + select-choice dependency

- cli-reference.md: field get/update/delete now <tableId> <fieldId>;
  new field visible-choices command; note --options goes via convert API
- tables-fields.md: correct update/delete signatures; options-rewrite
  semantics (convert API, whole-replace not merge); new section on
  select-choice visibilityFilter dependency (read/write/evaluate,
  backend 400 guards, write-time enforcement message)
This commit is contained in:
yeuimu
2026-08-16 05:35:23 +00:00
parent 10b52db8b2
commit 5a984eb5f8
2 changed files with 24 additions and 8 deletions
@@ -43,12 +43,13 @@ inkreach-teable table create --name <n> [--base-id <id>] [--fields '<json>']
inkreach-teable table update <tableId> --name <n> inkreach-teable table update <tableId> --name <n>
inkreach-teable table delete <tableId> inkreach-teable table delete <tableId>
# field # field (get/update/delete take <tableId> <fieldId> — 2026-08 fix; old /api/field/:id routes never existed)
inkreach-teable field list <tableId> inkreach-teable field list <tableId>
inkreach-teable field get <fieldId> inkreach-teable field get <tableId> <fieldId>
inkreach-teable field create --table-id <tid> --name <n> --type <t> [--options '<json>'] inkreach-teable field create --table-id <tid> --name <n> --type <t> [--options '<json>']
inkreach-teable field update <fieldId> [--name <n>] [--options '<json>'] inkreach-teable field update <tableId> <fieldId> [--name <n>] [--options '<json>'] # --options goes via convert API
inkreach-teable field delete <fieldId> inkreach-teable field visible-choices <tableId> <recordId> <fieldId> # evaluate select-choice visibilityFilter
inkreach-teable field delete <tableId> <fieldId>
# record # record
inkreach-teable record get --table-id <tid> [--filter '<json>'] [--projection '<json>'] [--page-size <n>] [--page <n>] [--search <kw>] inkreach-teable record get --table-id <tid> [--filter '<json>'] [--projection '<json>'] [--page-size <n>] [--page <n>] [--search <kw>]
@@ -142,16 +142,31 @@ inkreach-teable field create --table-id tblXXX --name "Project" --type link \
### Update & Delete ### Update & Delete
```bash ```bash
inkreach-teable field update <fieldId> [--name "<n>"] [--options '<json>'] inkreach-teable field update <tableId> <fieldId> [--name "<n>"] [--options '<json>']
inkreach-teable field delete <fieldId> inkreach-teable field delete <tableId> <fieldId>
``` ```
| Detail | Rule | | Detail | Rule |
|--------|------| |--------|------|
| `--name` only | Convenience; for other props use `--options` | | `--name` only | Uses the PATCH update API (name/description only) |
| `--options` merge | Partial updates; omitted keys are preserved | | `--options` | Rewrites options via the **convert** API (`PUT …/field/:fid/convert`) — the PATCH update API strips `options` by design. CLI auto-fetches the field's current type; omitted keys are **replaced whole**, not merged |
| `--name` + `--options` | Both applied via one convert call |
| `field delete` | Irreversible — all cell data in that field is lost | | `field delete` | Irreversible — all cell data in that field is lost |
### Select-choice dependency (visibilityFilter) — 2026-08
Single/multiple-select choices may carry a `visibilityFilter` making them visible only when another select field matches:
```json
{"choices":[{"id":"choA","name":"墨盒","visibilityFilter":{
"filterSet":[{"fieldId":"fldDeviceType","operator":"is","value":"choPrinter"}]}}]}
```
- **Read config**: `inkreach-teable field get <tableId> <fieldId>` → `options.choices[].visibilityFilter`
- **Write config**: `field update --options` (convert API). Backend rejects self-reference (`Self-reference in visibilityFilter is not allowed`) and dependency cycles (`Dependency cycle detected…`) with 400 — enforced on both V1 and V2 paths since fix `26ed1f732`
- **Evaluate for a record**: `inkreach-teable field visible-choices <tableId> <recordId> <fieldId>` → choices currently selectable
- **Write-time enforcement**: writing a record value that fails its visibility condition → 400 `Option "X" does not meet the current row conditions and cannot be selected.`
--- ---
## Records ## Records