Mark JavaScript methods that exist in only one context - #55
Merged
Conversation
The JavaScript reference presented the scripting API and the external seatable-api client as one API surface. They are not identical, so readers followed documented methods that are undefined in their context. Most visibly, columns cannot be created or modified from a script: insertColumn, deleteColumn and the other write methods only exist in the external client. The reverse case existed too -- getColumns and getRows are scripting-only and absent from seatable-api -- as did a pure naming divergence, updateLink (external) vs. updateLinks (scripting). - add an "External client only" marker and mark 16 methods across columns, rows, links and metadata - mark getColumns and getRows as scripting-only - document updateLinks as its own scripting entry - add a legend for both markers on the index page; the existing marker had no explanation anywhere - correct the index claim that columns behave the same in both contexts - note the context limits on the constants and files pages - point scripting users to Python or the REST API for column management Availability was verified per method against seatable-api@1.0.46, dtable-sdk@5.0.17, the scripting reference removed in 0d59065, and typeof checks in a running base. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A support ticket reported that
base.insertColumn(),base.renameColumn(),base.modifyColumnType(),base.addColumnOptions()andbase.deleteColumn()areundefinedin a base's JavaScript script editor, although the reference documents them.The report is correct, and so was the reading of the docs. The JavaScript reference merges two APIs that are not identical:
baseis a browser-side SDK instance. Read-only access to columns.basecomes fromnpm install seatable-api. Full column management.index.mdclaimed "The core methods (tables, views, columns, rows, links, SQL) are the same in both contexts. Features that are only available in one context are clearly marked" — but only 6 methods carried a marker, and none of the column write methods did. The examples on the columns page even open withimport { ColumnTypes } from 'seatable-api';, which is impossible in the script editor.This became visible with #NN (
0d59065), which merged the previously separate scripting and client documentation trees. The docs were unified; the APIs were not.Changes
listRows,insertRow,batchAppendRows,batchUpdateRows,batchDeleteRows,batchUpdateLinks,updateLink,getMetadatagetColumnsandgetRowsare scripting-only and do not exist inseatable-api— external users ran into the mirror image of the same bugupdateLinksadded as its own scripting entry (same method, different name in the two contexts)constants.md(noimportin the script editor) andfiles.md(Node.js only)columns.mdpointing scripting users to Python or the REST APItables.mdandviews.mdneeded no changes — they were already correct.Verification
Availability was determined per method against four sources:
seatable-api@1.0.46— external method surface, read from the packagedtable-sdk@5.0.17— browser SDKdocs/scripts/javascript/objects/*.md— the scripting reference removed in0d59065, recovered from git historytypeofchecks in a running base (confirmed the column methods andupdateLink/updateLinks)Independently corroborated by the Chinese scripting manual, which states outright that the JavaScript API section does not apply to scripts.
mkdocs build --strictpasses. All links checked, including the correctedinsertcolumn-1API reference.Note
These markers make the divergence visible; they do not remove it.
updateLink/updateLinksandgetRows/listRowsare identical in semantics and parameters and differ only in name. The scripting API already carries deprecated aliases (getRowById,addRow,modifyRow,getViews), so the mechanism for aligning names exists — it was just never used to converge with the external client. Worth a separate discussion outside this repo.🤖 Generated with Claude Code