Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/docs/document-api/available-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Use the tables below to see what operations are available and where each one is
| Citations | 15 | 0 | 15 | [Reference](/document-api/reference/citations/index) |
| Comments | 5 | 0 | 5 | [Reference](/document-api/reference/comments/index) |
| Content Controls | 55 | 0 | 55 | [Reference](/document-api/reference/content-controls/index) |
| Core | 13 | 0 | 13 | [Reference](/document-api/reference/core/index) |
| Core | 14 | 0 | 14 | [Reference](/document-api/reference/core/index) |
| Create | 6 | 0 | 6 | [Reference](/document-api/reference/create/index) |
| Cross-References | 5 | 0 | 5 | [Reference](/document-api/reference/cross-refs/index) |
| Diff | 3 | 0 | 3 | [Reference](/document-api/reference/diff/index) |
Expand Down Expand Up @@ -148,6 +148,7 @@ Use the tables below to see what operations are available and where each one is
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.getHtml(...)</code></span> | [`getHtml`](/document-api/reference/get-html) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.markdownToFragment(...)</code></span> | [`markdownToFragment`](/document-api/reference/markdown-to-fragment) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.info(...)</code></span> | [`info`](/document-api/reference/info) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.extract(...)</code></span> | [`extract`](/document-api/reference/extract) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.clearContent(...)</code></span> | [`clearContent`](/document-api/reference/clear-content) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.insert(...)</code></span> | [`insert`](/document-api/reference/insert) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.replace(...)</code></span> | [`replace`](/document-api/reference/replace) |
Expand Down
4 changes: 3 additions & 1 deletion apps/docs/document-api/reference/_generated-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"apps/docs/document-api/reference/diff/capture.mdx",
"apps/docs/document-api/reference/diff/compare.mdx",
"apps/docs/document-api/reference/diff/index.mdx",
"apps/docs/document-api/reference/extract.mdx",
"apps/docs/document-api/reference/fields/get.mdx",
"apps/docs/document-api/reference/fields/index.mdx",
"apps/docs/document-api/reference/fields/insert.mdx",
Expand Down Expand Up @@ -436,6 +437,7 @@
"getHtml",
"markdownToFragment",
"info",
"extract",
"clearContent",
"insert",
"replace",
Expand Down Expand Up @@ -1016,5 +1018,5 @@
}
],
"marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}",
"sourceHash": "b61fad6a3a330af8a57b78ded260c8d8918486c9829b50804227fbeb15e8bf53"
"sourceHash": "e74a36833ec8587b67447a79517de348cfc9b4bba1c564729c184f6d5464a018"
}
46 changes: 46 additions & 0 deletions apps/docs/document-api/reference/capabilities/get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,11 @@ _No fields._
| `operations.diff.compare.dryRun` | boolean | yes | |
| `operations.diff.compare.reasons` | enum[] | no | |
| `operations.diff.compare.tracked` | boolean | yes | |
| `operations.extract` | object | yes | |
| `operations.extract.available` | boolean | yes | |
| `operations.extract.dryRun` | boolean | yes | |
| `operations.extract.reasons` | enum[] | no | |
| `operations.extract.tracked` | boolean | yes | |
| `operations.fields.get` | object | yes | |
| `operations.fields.get.available` | boolean | yes | |
| `operations.fields.get.dryRun` | boolean | yes | |
Expand Down Expand Up @@ -3071,6 +3076,11 @@ _No fields._
"dryRun": false,
"tracked": false
},
"extract": {
"available": true,
"dryRun": false,
"tracked": false
},
"fields.get": {
"available": true,
"dryRun": false,
Expand Down Expand Up @@ -10179,6 +10189,41 @@ _No fields._
],
"type": "object"
},
"extract": {
"additionalProperties": false,
"properties": {
"available": {
"type": "boolean"
},
"dryRun": {
"type": "boolean"
},
"reasons": {
"items": {
"enum": [
"COMMAND_UNAVAILABLE",
"HELPER_UNAVAILABLE",
"OPERATION_UNAVAILABLE",
"TRACKED_MODE_UNAVAILABLE",
"DRY_RUN_UNAVAILABLE",
"NAMESPACE_UNAVAILABLE",
"STYLES_PART_MISSING",
"COLLABORATION_ACTIVE"
]
},
"type": "array"
},
"tracked": {
"type": "boolean"
}
},
"required": [
"available",
"tracked",
"dryRun"
],
"type": "object"
},
"fields.get": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -19570,6 +19615,7 @@ _No fields._
"getHtml",
"markdownToFragment",
"info",
"extract",
"clearContent",
"insert",
"replace",
Expand Down
7 changes: 7 additions & 0 deletions apps/docs/document-api/reference/content-controls/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Returns a ContentControlMutationResult with the created content control target.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | string | no | |
| `at` | SelectionTarget | no | SelectionTarget |
| `at.end` | SelectionPoint | no | SelectionPoint |
| `at.kind` | `"selection"` | no | Constant: `"selection"` |
| `at.start` | SelectionPoint | no | SelectionPoint |
| `content` | string | no | |
| `controlType` | string | no | |
| `kind` | enum | yes | `"block"`, `"inline"` |
Expand Down Expand Up @@ -120,6 +124,9 @@ Returns a ContentControlMutationResult with the created content control target.
"alias": {
"type": "string"
},
"at": {
"$ref": "#/$defs/SelectionTarget"
},
"content": {
"type": "string"
},
Expand Down
1 change: 1 addition & 0 deletions apps/docs/document-api/reference/core/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Primary read and write operations.
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/get-html"><code>getHtml</code></a></span> | `getHtml` | No | `idempotent` | No | No |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/markdown-to-fragment"><code>markdownToFragment</code></a></span> | `markdownToFragment` | No | `idempotent` | No | No |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/info"><code>info</code></a></span> | `info` | No | `idempotent` | No | No |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/extract"><code>extract</code></a></span> | `extract` | No | `idempotent` | No | No |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/clear-content"><code>clearContent</code></a></span> | `clearContent` | Yes | `conditional` | No | No |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/insert"><code>insert</code></a></span> | `insert` | Yes | `non-idempotent` | Yes | Yes |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><a href="/document-api/reference/replace"><code>replace</code></a></span> | `replace` | Yes | `conditional` | Yes | Yes |
Expand Down
6 changes: 5 additions & 1 deletion apps/docs/document-api/reference/create/heading.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ Returns a CreateHeadingResult with the new heading block ID and address.
{
"entityId": "entity-789",
"entityType": "trackedChange",
"kind": "entity"
"kind": "entity",
"story": {
"kind": "story",
"storyType": "body"
}
}
]
}
Expand Down
6 changes: 5 additions & 1 deletion apps/docs/document-api/reference/create/paragraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ Returns a CreateParagraphResult with the new paragraph block ID and address.
{
"entityId": "entity-789",
"entityType": "trackedChange",
"kind": "entity"
"kind": "entity",
"story": {
"kind": "story",
"storyType": "body"
}
}
]
}
Expand Down
222 changes: 222 additions & 0 deletions apps/docs/document-api/reference/extract.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
---
title: extract
sidebarTitle: extract
description: Extract all document content with stable IDs for RAG pipelines. Returns blocks with full text, comments, and tracked changes — each with an ID compatible with scrollToElement().
---

{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}

## Summary

Extract all document content with stable IDs for RAG pipelines. Returns blocks with full text, comments, and tracked changes — each with an ID compatible with scrollToElement().

- Operation ID: `extract`
- API member path: `editor.doc.extract(...)`
- Mutates document: `no`
- Idempotency: `idempotent`
- Supports tracked mode: `no`
- Supports dry run: `no`
- Deterministic target resolution: `yes`

## Expected result

Returns an ExtractResult with blocks (nodeId, type, text, headingLevel), comments (entityId, text, anchoredText, blockId, status, author), tracked changes (entityId, type, excerpt, author, date), and revision.

## Input fields

_No fields._

### Example request

```json
{}
```

## Output fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `blocks` | object[] | yes | |
| `comments` | object[] | yes | |
| `revision` | string | yes | |
| `trackedChanges` | object[] | yes | |

### Example response

```json
{
"blocks": [
{
"headingLevel": 1,
"nodeId": "node-def456",
"text": "Hello, world.",
"type": "example"
}
],
"comments": [
{
"anchoredText": "example",
"entityId": "entity-789",
"status": "open",
"text": "Hello, world."
}
],
"revision": "example",
"trackedChanges": [
{
"author": "Jane Doe",
"entityId": "entity-789",
"excerpt": "Sample excerpt...",
"type": "insert"
}
]
}
```

## Pre-apply throws

- None

## Non-applied failure codes

- None

## Raw schemas

<Accordion title="Raw input schema">
```json
{
"additionalProperties": false,
"properties": {},
"type": "object"
}
```
</Accordion>

<Accordion title="Raw output schema">
```json
{
"additionalProperties": false,
"properties": {
"blocks": {
"items": {
"additionalProperties": false,
"properties": {
"headingLevel": {
"description": "Heading level (1–6). Only present for headings.",
"type": "integer"
},
"nodeId": {
"description": "Stable block ID — pass to scrollToElement() for navigation.",
"type": "string"
},
"text": {
"description": "Full plain text content of the block.",
"type": "string"
},
"type": {
"description": "Block type: paragraph, heading, listItem, table, image, etc.",
"type": "string"
}
},
"required": [
"nodeId",
"type",
"text"
],
"type": "object"
},
"type": "array"
},
"comments": {
"items": {
"additionalProperties": false,
"properties": {
"anchoredText": {
"description": "The document text the comment is anchored to.",
"type": "string"
},
"author": {
"description": "Comment author name.",
"type": "string"
},
"blockId": {
"description": "Block ID the comment is anchored to.",
"type": "string"
},
"entityId": {
"description": "Comment entity ID — pass to scrollToElement() for navigation.",
"type": "string"
},
"status": {
"enum": [
"open",
"resolved"
],
"type": "string"
},
"text": {
"description": "Comment body text.",
"type": "string"
}
},
"required": [
"entityId",
"status"
],
"type": "object"
},
"type": "array"
},
"revision": {
"description": "Document revision at the time of extraction.",
"type": "string"
},
"trackedChanges": {
"items": {
"additionalProperties": false,
"properties": {
"author": {
"description": "Change author name.",
"type": "string"
},
"date": {
"description": "Change date (ISO string).",
"type": "string"
},
"entityId": {
"description": "Tracked change entity ID — pass to scrollToElement() for navigation.",
"type": "string"
},
"excerpt": {
"description": "Short text excerpt of the changed content.",
"type": "string"
},
"type": {
"enum": [
"insert",
"delete",
"format"
],
"type": "string"
}
},
"required": [
"entityId",
"type"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"blocks",
"comments",
"trackedChanges",
"revision"
],
"type": "object"
}
```
</Accordion>
Loading
Loading