Skip to content
Merged
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
6 changes: 5 additions & 1 deletion apps/cli/src/lib/error-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ function mapCreateError(operationId: CliExposedOperationId, error: unknown, code
return new CliError('TARGET_NOT_FOUND', message, { operationId, details });
}

if (code === 'TRACK_CHANGE_COMMAND_UNAVAILABLE') {
if (code === 'AMBIGUOUS_TARGET' || code === 'INVALID_TARGET') {
return new CliError('INVALID_ARGUMENT', message, { operationId, details });
}

if (code === 'TRACK_CHANGE_COMMAND_UNAVAILABLE' || code === 'CAPABILITY_UNAVAILABLE') {
return new CliError('TRACK_CHANGE_COMMAND_UNAVAILABLE', message, { operationId, details });
}

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/document-api/reference/_generated-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@
}
],
"marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}",
"sourceHash": "d53e75c131bc35996800d18ff3b67961de5d6d031ba20f4a6a03106e1117acaa"
"sourceHash": "dd10c0218ba8a9148e8a3412053672bbbe88976f7a779650602aa98dec6efeee"
}
95 changes: 94 additions & 1 deletion apps/docs/document-api/reference/comments/add.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ description: Generated reference for comments.add
- `TARGET_NOT_FOUND`
- `COMMAND_UNAVAILABLE`
- `CAPABILITY_UNAVAILABLE`
- `INVALID_TARGET`

## Non-applied failure codes

Expand All @@ -34,7 +35,100 @@ description: Generated reference for comments.add
```json
{
"additionalProperties": false,
"allOf": [
{
"not": {
"required": [
"target",
"blockId"
]
}
},
{
"not": {
"required": [
"target",
"start"
]
}
},
{
"not": {
"required": [
"target",
"end"
]
}
},
{
"if": {
"required": [
"start"
]
},
"then": {
"required": [
"blockId",
"end"
]
}
},
{
"if": {
"required": [
"end"
]
},
"then": {
"required": [
"blockId",
"start"
]
}
},
{
"if": {
"required": [
"blockId"
]
},
"then": {
"required": [
"start",
"end"
]
}
}
],
"anyOf": [
{
"required": [
"target"
]
},
{
"required": [
"blockId",
"start",
"end"
]
}
],
"properties": {
"blockId": {
"description": "Block ID for block-relative range targeting.",
"type": "string"
},
"end": {
"description": "End offset within the block identified by blockId.",
"minimum": 0,
"type": "integer"
},
"start": {
"description": "Start offset within the block identified by blockId.",
"minimum": 0,
"type": "integer"
},
"target": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -73,7 +167,6 @@ description: Generated reference for comments.add
}
},
"required": [
"target",
"text"
],
"type": "object"
Expand Down
97 changes: 95 additions & 2 deletions apps/docs/document-api/reference/comments/move.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ description: Generated reference for comments.move
- `TARGET_NOT_FOUND`
- `COMMAND_UNAVAILABLE`
- `CAPABILITY_UNAVAILABLE`
- `INVALID_TARGET`

## Non-applied failure codes

Expand All @@ -34,10 +35,103 @@ description: Generated reference for comments.move
```json
{
"additionalProperties": false,
"allOf": [
{
"not": {
"required": [
"target",
"blockId"
]
}
},
{
"not": {
"required": [
"target",
"start"
]
}
},
{
"not": {
"required": [
"target",
"end"
]
}
},
{
"if": {
"required": [
"start"
]
},
"then": {
"required": [
"blockId",
"end"
]
}
},
{
"if": {
"required": [
"end"
]
},
"then": {
"required": [
"blockId",
"start"
]
}
},
{
"if": {
"required": [
"blockId"
]
},
"then": {
"required": [
"start",
"end"
]
}
}
],
"anyOf": [
{
"required": [
"target"
]
},
{
"required": [
"blockId",
"start",
"end"
]
}
],
"properties": {
"blockId": {
"description": "Block ID for block-relative range targeting.",
"type": "string"
},
"commentId": {
"type": "string"
},
"end": {
"description": "End offset within the block identified by blockId.",
"minimum": 0,
"type": "integer"
},
"start": {
"description": "Start offset within the block identified by blockId.",
"minimum": 0,
"type": "integer"
},
"target": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -73,8 +167,7 @@ description: Generated reference for comments.move
}
},
"required": [
"commentId",
"target"
"commentId"
],
"type": "object"
}
Expand Down
40 changes: 36 additions & 4 deletions apps/docs/document-api/reference/create/heading.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ description: Generated reference for create.heading
- `COMMAND_UNAVAILABLE`
- `TRACK_CHANGE_COMMAND_UNAVAILABLE`
- `CAPABILITY_UNAVAILABLE`
- `INVALID_TARGET`
- `AMBIGUOUS_TARGET`

## Non-applied failure codes

Expand Down Expand Up @@ -63,10 +65,26 @@ description: Generated reference for create.heading
},
{
"additionalProperties": false,
"oneOf": [
{
"required": [
"target"
]
},
{
"required": [
"nodeId"
]
}
],
"properties": {
"kind": {
"const": "before"
},
"nodeId": {
"description": "Node ID shorthand — adapter resolves to a full BlockNodeAddress.",
"type": "string"
},
"target": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -98,17 +116,32 @@ description: Generated reference for create.heading
}
},
"required": [
"kind",
"target"
"kind"
],
"type": "object"
},
{
"additionalProperties": false,
"oneOf": [
{
"required": [
"target"
]
},
{
"required": [
"nodeId"
]
}
],
"properties": {
"kind": {
"const": "after"
},
"nodeId": {
"description": "Node ID shorthand — adapter resolves to a full BlockNodeAddress.",
"type": "string"
},
"target": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -140,8 +173,7 @@ description: Generated reference for create.heading
}
},
"required": [
"kind",
"target"
"kind"
],
"type": "object"
}
Expand Down
Loading
Loading