Table kit command

table.file.export

Export a table as a CSV or Markdown file

Answers one table as a CSV or Markdown file's bytes (base64, in data) for the host to write as a new file, without changing anything.

Kit
Table 0.4.0 (.ktable)
Changes the document
no

Parameters

Parameters of table.file.export
NameTypeRequiredDescription
format"csv" | "md"yescsv, or md for a Markdown table.
tableIdinteger | stringnoThe table to export; default the first table.

Call through table_run

text
table_run {
  "path": "<file>.ktable",
  "steps": [{ "command": "table.file.export", "params": { "format": <"csv" | "md"> } }]
}

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

Result

Result of table.file.export
NameTypeRequiredDescription
bytesintegernoThe file's size.
datastringnoThe file's bytes, base64.
errorobjectnoWhy the call failed (A18); the file is as it was.
extensionstringno
formatstringno
mimestringno
namestringnoThe table's title.
tableIdintegerno
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "bytes": {
      "description": "The file's size.",
      "type": "integer"
    },
    "data": {
      "description": "The file's bytes, base64.",
      "type": "string"
    },
    "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"
    },
    "extension": {
      "type": "string"
    },
    "format": {
      "type": "string"
    },
    "mime": {
      "type": "string"
    },
    "name": {
      "description": "The table's title.",
      "type": "string"
    },
    "tableId": {
      "type": "integer"
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "format": {
      "description": "csv, or md for a Markdown table.",
      "enum": [
        "csv",
        "md"
      ],
      "type": "string"
    },
    "tableId": {
      "description": "The table to export; default the first table.",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-types": [
        "Table"
      ]
    }
  },
  "required": [
    "format"
  ],
  "type": "object"
}

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