|
| 1 | +--- |
| 2 | +title: clearContent |
| 3 | +sidebarTitle: clearContent |
| 4 | +description: Clear all document body content, leaving a single empty paragraph. |
| 5 | +--- |
| 6 | + |
| 7 | +{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */} |
| 8 | + |
| 9 | +> Alpha: Document API is currently alpha and subject to breaking changes. |
| 10 | +
|
| 11 | +## Summary |
| 12 | + |
| 13 | +Clear all document body content, leaving a single empty paragraph. |
| 14 | + |
| 15 | +- Operation ID: `clearContent` |
| 16 | +- API member path: `editor.doc.clearContent(...)` |
| 17 | +- Mutates document: `yes` |
| 18 | +- Idempotency: `conditional` |
| 19 | +- Supports tracked mode: `no` |
| 20 | +- Supports dry run: `no` |
| 21 | +- Deterministic target resolution: `yes` |
| 22 | + |
| 23 | +## Expected result |
| 24 | + |
| 25 | +Returns a Receipt with success status; reports NO_OP if the document is already empty. |
| 26 | + |
| 27 | +## Input fields |
| 28 | + |
| 29 | +_No fields._ |
| 30 | + |
| 31 | +### Example request |
| 32 | + |
| 33 | +```json |
| 34 | +{} |
| 35 | +``` |
| 36 | + |
| 37 | +## Output fields |
| 38 | + |
| 39 | +### Variant 1 (success=true) |
| 40 | + |
| 41 | +| Field | Type | Required | Description | |
| 42 | +| --- | --- | --- | --- | |
| 43 | +| `inserted` | EntityAddress[] | no | | |
| 44 | +| `removed` | EntityAddress[] | no | | |
| 45 | +| `success` | `true` | yes | Constant: `true` | |
| 46 | +| `updated` | EntityAddress[] | no | | |
| 47 | + |
| 48 | +### Variant 2 (success=false) |
| 49 | + |
| 50 | +| Field | Type | Required | Description | |
| 51 | +| --- | --- | --- | --- | |
| 52 | +| `failure` | object | yes | | |
| 53 | +| `failure.code` | enum | yes | `"NO_OP"` | |
| 54 | +| `failure.details` | any | no | | |
| 55 | +| `failure.message` | string | yes | | |
| 56 | +| `success` | `false` | yes | Constant: `false` | |
| 57 | + |
| 58 | +### Example response |
| 59 | + |
| 60 | +```json |
| 61 | +{ |
| 62 | + "inserted": [ |
| 63 | + { |
| 64 | + "entityId": "entity-789", |
| 65 | + "entityType": "comment", |
| 66 | + "kind": "entity" |
| 67 | + } |
| 68 | + ], |
| 69 | + "success": true, |
| 70 | + "updated": [ |
| 71 | + { |
| 72 | + "entityId": "entity-789", |
| 73 | + "entityType": "comment", |
| 74 | + "kind": "entity" |
| 75 | + } |
| 76 | + ] |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | +## Pre-apply throws |
| 81 | + |
| 82 | +- `CAPABILITY_UNAVAILABLE` |
| 83 | + |
| 84 | +## Non-applied failure codes |
| 85 | + |
| 86 | +- `NO_OP` |
| 87 | + |
| 88 | +## Raw schemas |
| 89 | + |
| 90 | +<Accordion title="Raw input schema"> |
| 91 | +```json |
| 92 | +{ |
| 93 | + "additionalProperties": false, |
| 94 | + "properties": {}, |
| 95 | + "type": "object" |
| 96 | +} |
| 97 | +``` |
| 98 | +</Accordion> |
| 99 | + |
| 100 | +<Accordion title="Raw output schema"> |
| 101 | +```json |
| 102 | +{ |
| 103 | + "oneOf": [ |
| 104 | + { |
| 105 | + "$ref": "#/$defs/ReceiptSuccess" |
| 106 | + }, |
| 107 | + { |
| 108 | + "additionalProperties": false, |
| 109 | + "properties": { |
| 110 | + "failure": { |
| 111 | + "additionalProperties": false, |
| 112 | + "properties": { |
| 113 | + "code": { |
| 114 | + "enum": [ |
| 115 | + "NO_OP" |
| 116 | + ] |
| 117 | + }, |
| 118 | + "details": {}, |
| 119 | + "message": { |
| 120 | + "type": "string" |
| 121 | + } |
| 122 | + }, |
| 123 | + "required": [ |
| 124 | + "code", |
| 125 | + "message" |
| 126 | + ], |
| 127 | + "type": "object" |
| 128 | + }, |
| 129 | + "success": { |
| 130 | + "const": false |
| 131 | + } |
| 132 | + }, |
| 133 | + "required": [ |
| 134 | + "success", |
| 135 | + "failure" |
| 136 | + ], |
| 137 | + "type": "object" |
| 138 | + } |
| 139 | + ] |
| 140 | +} |
| 141 | +``` |
| 142 | +</Accordion> |
| 143 | + |
| 144 | +<Accordion title="Raw success schema"> |
| 145 | +```json |
| 146 | +{ |
| 147 | + "$ref": "#/$defs/ReceiptSuccess" |
| 148 | +} |
| 149 | +``` |
| 150 | +</Accordion> |
| 151 | + |
| 152 | +<Accordion title="Raw failure schema"> |
| 153 | +```json |
| 154 | +{ |
| 155 | + "additionalProperties": false, |
| 156 | + "properties": { |
| 157 | + "failure": { |
| 158 | + "additionalProperties": false, |
| 159 | + "properties": { |
| 160 | + "code": { |
| 161 | + "enum": [ |
| 162 | + "NO_OP" |
| 163 | + ] |
| 164 | + }, |
| 165 | + "details": {}, |
| 166 | + "message": { |
| 167 | + "type": "string" |
| 168 | + } |
| 169 | + }, |
| 170 | + "required": [ |
| 171 | + "code", |
| 172 | + "message" |
| 173 | + ], |
| 174 | + "type": "object" |
| 175 | + }, |
| 176 | + "success": { |
| 177 | + "const": false |
| 178 | + } |
| 179 | + }, |
| 180 | + "required": [ |
| 181 | + "success", |
| 182 | + "failure" |
| 183 | + ], |
| 184 | + "type": "object" |
| 185 | +} |
| 186 | +``` |
| 187 | +</Accordion> |
0 commit comments