Table kit command

table.documents.get

Read the document

Reads the document's title, every table with its fields and views, and its dashboards' ids and titles, without changing anything.

Kit
Table 0.4.0 (.ktable)
Changes the document
no

Parameters

None.

Call through table_run

text
table_run {
  "path": "<file>.ktable",
  "steps": [{ "command": "table.documents.get" }]
}

The required parameters, with placeholders for their types: not a tested example. table_run answers the step’s result in completed[i].result.

Result

Result of table.documents.get
NameTypeRequiredDescription
changeobject | nullnoWhat the call changed, or null.
errorobjectnoWhy the call failed (A18); the file is as it was.
resultobjectnoThe document with its tables and dashboards.
Result JSON Schema
json
{
  "additionalProperties": false,
  "description": "The request's own answer is in `result`, beside `change`: what the call changed in the document (null when nothing changed). A failed call answers `error` instead (A18).",
  "properties": {
    "change": {
      "description": "What the call changed, or null.",
      "oneOf": [
        {
          "additionalProperties": false,
          "description": "What one projection changed in the relational tables, by integer id. Every list is sorted and\nholds no repeats.",
          "properties": {
            "dashboards": {
              "description": "A dashboard, or the base's list of them, changed.",
              "type": "boolean"
            },
            "documentId": {
              "type": "string"
            },
            "origin": {
              "description": "Who wrote it: kind:principal, or a system origin's label.",
              "type": "string"
            },
            "recordsDeleted": {
              "description": "[tableId, rowKey] pairs.",
              "items": {
                "items": {},
                "type": "array"
              },
              "type": "array"
            },
            "recordsReordered": {
              "description": "Tables whose records' positions changed.",
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            "recordsUpserted": {
              "description": "[tableId, rowKey] pairs.",
              "items": {
                "items": {},
                "type": "array"
              },
              "type": "array"
            },
            "schema": {
              "description": "Tables whose fields were added, removed, updated, or reordered.",
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            "tables": {
              "description": "Tables whose own row changed: created, deleted, renamed, moved, or given a new primary\nfield.",
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            "views": {
              "description": "Views created, deleted, updated, or reordered, or whose column widths or visibility\nchanged.",
              "items": {
                "type": "integer"
              },
              "type": "array"
            }
          },
          "required": [
            "tables",
            "schema",
            "views",
            "recordsReordered",
            "dashboards"
          ],
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "additionalProperties": false,
      "description": "Why the call failed (A18); the file is as it was.",
      "properties": {
        "code": {
          "enum": [
            "invalid-params",
            "invalid-op",
            "invalid-value",
            "not-found",
            "read-only",
            "unknown-command",
            "command-failed",
            "not-open",
            "draft-required",
            "not-allowed",
            "unsupported",
            "unavailable",
            "failed"
          ],
          "type": "string"
        },
        "index": {
          "description": "The failing step or operation.",
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "result": {
      "additionalProperties": true,
      "description": "The document with its tables and dashboards.",
      "properties": {
        "color": {
          "description": "Always empty.",
          "type": "string"
        },
        "created_at": {
          "description": "When the file was created, in Unix milliseconds.",
          "type": "integer"
        },
        "dashboards": {
          "items": {
            "additionalProperties": true,
            "description": "A dashboard's summary.",
            "properties": {
              "id": {
                "description": "The dashboard's id.",
                "type": "string"
              },
              "order": {
                "description": "Its position.",
                "type": "number"
              },
              "title": {
                "description": "Its title.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "description": {
          "description": "Always empty.",
          "type": "string"
        },
        "icon": {
          "description": "Always empty.",
          "type": "string"
        },
        "id": {
          "description": "Always 1.",
          "type": "integer"
        },
        "meta": {
          "description": "Always null."
        },
        "path": {
          "description": "The document's name as the host opened it.",
          "type": "string"
        },
        "tables": {
          "items": {
            "additionalProperties": true,
            "description": "A table with its fields and views.",
            "properties": {
              "created_at": {
                "description": "When it was created, in Unix milliseconds.",
                "type": "integer"
              },
              "description": {
                "description": "The table's description.",
                "type": "string"
              },
              "document_id": {
                "description": "Always 1: the document's id.",
                "type": "integer"
              },
              "fields": {
                "items": {
                  "additionalProperties": true,
                  "description": "A field (column).",
                  "properties": {
                    "ai_prompt": {
                      "description": "A legacy AI prompt.",
                      "type": "string"
                    },
                    "created_at": {
                      "description": "When it was created, in Unix milliseconds.",
                      "type": "integer"
                    },
                    "document_id": {
                      "description": "Always 1: the document's id.",
                      "type": "integer"
                    },
                    "formula": {
                      "description": "A formula field's expression.",
                      "type": "string"
                    },
                    "id": {
                      "description": "The field's local projection address (fieldId).",
                      "type": "integer"
                    },
                    "is_primary": {
                      "description": "It names the record.",
                      "type": "boolean"
                    },
                    "meta": {
                      "additionalProperties": true,
                      "description": "Metadata the host keeps with the field.",
                      "type": "object"
                    },
                    "name": {
                      "description": "The key of its values in a record's `values`.",
                      "type": "string"
                    },
                    "options": {
                      "additionalProperties": true,
                      "description": "The settings its type reads (choices, target_table_id, …).",
                      "type": "object"
                    },
                    "order": {
                      "description": "Its position among the table's fields, from 1.",
                      "type": "integer"
                    },
                    "readonly": {
                      "description": "Values are not written by hand (formula and AI fields).",
                      "type": "boolean"
                    },
                    "required": {
                      "description": "A record needs a value.",
                      "type": "boolean"
                    },
                    "table_id": {
                      "description": "The table's id.",
                      "type": "integer"
                    },
                    "title": {
                      "description": "The title people see.",
                      "type": "string"
                    },
                    "tool_id": {
                      "description": "The stable UUID accepted by fieldId and used by receipts and conflicts.",
                      "type": "string"
                    },
                    "type": {
                      "description": "The field type.",
                      "enum": [
                        "text",
                        "long_text",
                        "number",
                        "date",
                        "datetime",
                        "single_select",
                        "multi_select",
                        "checkbox",
                        "url",
                        "attachment",
                        "document_link",
                        "formula",
                        "ai",
                        "rating",
                        "user",
                        "link_to_record",
                        "lookup",
                        "rollup",
                        "button",
                        "created_time",
                        "last_modified_time",
                        "created_by",
                        "last_modified_by",
                        "auto_number"
                      ],
                      "type": "string"
                    },
                    "unique": {
                      "description": "Values must differ between records.",
                      "type": "boolean"
                    },
                    "updated_at": {
                      "description": "When it last changed, in Unix milliseconds.",
                      "type": "integer"
                    },
                    "user_id": {
                      "description": "Always 0: the document's own user.",
                      "type": "integer"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "description": "The table's local projection address (tableId).",
                "type": "integer"
              },
              "meta": {
                "additionalProperties": true,
                "description": "Metadata the host keeps with the table.",
                "type": "object"
              },
              "name": {
                "description": "The table's internal name.",
                "type": "string"
              },
              "order": {
                "description": "Its position among the tables, from 1.",
                "type": "integer"
              },
              "primary_field_id": {
                "description": "The id of the field that names a record.",
                "oneOf": [
                  {
                    "description": "The id of the field that names a record.",
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "title": {
                "description": "The table's title.",
                "type": "string"
              },
              "tool_id": {
                "description": "The stable UUID accepted by tableId and used by receipts and conflicts.",
                "type": "string"
              },
              "updated_at": {
                "description": "When it last changed, in Unix milliseconds.",
                "type": "integer"
              },
              "user_id": {
                "description": "Always 0: the document's own user.",
                "type": "integer"
              },
              "views": {
                "items": {
                  "additionalProperties": true,
                  "description": "A view of a table.",
                  "properties": {
                    "config": {
                      "additionalProperties": true,
                      "description": "Its filters, sorts, groups and display settings.",
                      "type": "object"
                    },
                    "created_at": {
                      "description": "When it was created, in Unix milliseconds.",
                      "type": "integer"
                    },
                    "document_id": {
                      "description": "Always 1: the document's id.",
                      "type": "integer"
                    },
                    "id": {
                      "description": "The view's local projection address (viewId).",
                      "type": "integer"
                    },
                    "locked": {
                      "description": "The view is locked against changes in the editor.",
                      "type": "boolean"
                    },
                    "order": {
                      "description": "Its position among the table's views, from 1.",
                      "type": "integer"
                    },
                    "table_id": {
                      "description": "The table's id.",
                      "type": "integer"
                    },
                    "title": {
                      "description": "The view's title.",
                      "type": "string"
                    },
                    "tool_id": {
                      "description": "The stable UUID accepted by viewId and used by receipts and conflicts.",
                      "type": "string"
                    },
                    "type": {
                      "description": "The view type.",
                      "enum": [
                        "grid",
                        "kanban",
                        "calendar",
                        "gallery"
                      ],
                      "type": "string"
                    },
                    "updated_at": {
                      "description": "When it last changed, in Unix milliseconds.",
                      "type": "integer"
                    },
                    "user_id": {
                      "description": "Always 0: the document's own user.",
                      "type": "integer"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "title": {
          "description": "The document's title, else its name without .ktable.",
          "type": "string"
        },
        "tool_id": {
          "description": "The document's stable Base UUID, used by queries, batches and receipts.",
          "type": "string"
        },
        "updated_at": {
          "description": "When it last changed, in Unix milliseconds.",
          "type": "integer"
        },
        "user_id": {
          "description": "Always 0.",
          "type": "integer"
        },
        "workspace_root": {
          "description": "Always empty.",
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}

Generated from kition-sdk packages/script/kits/table.ts and the kit itself (kition-table@ee73209). As data: commands.jsonl.