Skip to content

Commit 23064ee

Browse files
committed
fix: track changes docs
1 parent c80bbbe commit 23064ee

7 files changed

Lines changed: 46 additions & 11 deletions

File tree

apps/docs/document-api/reference/_generated-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,5 +1016,5 @@
10161016
}
10171017
],
10181018
"marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}",
1019-
"sourceHash": "9f517507db3d5a45d0f2e6a22ec14f11de4b6d2f0a94c9b5ecef151ee64b795a"
1019+
"sourceHash": "ea6e458d5c1476621d84f5bde9f85df9c3d620d0e226f206c57456f5ed6d20b3"
10201020
}

apps/docs/document-api/reference/track-changes/get.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Retrieve a single tracked change by ID.
2020

2121
## Expected result
2222

23-
Returns a TrackChangeInfo object with the change type, author, date, affected content, and source Word revision IDs when available.
23+
Returns a TrackChangeInfo object with the change type, author, date, affected content, and raw imported Word OOXML revision IDs (`w:id`) when available.
2424

2525
## Input fields
2626

@@ -137,14 +137,18 @@ Returns a TrackChangeInfo object with the change type, author, date, affected co
137137
},
138138
"wordRevisionIds": {
139139
"additionalProperties": false,
140+
"description": "Raw imported Word OOXML revision IDs (`w:id`) from the source document when available. This is provenance metadata, not the canonical SuperDoc tracked-change ID. Replacements may include both `insert` and `delete` IDs.",
140141
"properties": {
141142
"delete": {
143+
"description": "Raw imported Word OOXML revision ID (`w:id`) from a `<w:del>` element when this logical change includes a deletion.",
142144
"type": "string"
143145
},
144146
"format": {
147+
"description": "Raw imported Word OOXML revision ID (`w:id`) from a `<w:rPrChange>` element when this logical change includes a formatting revision.",
145148
"type": "string"
146149
},
147150
"insert": {
151+
"description": "Raw imported Word OOXML revision ID (`w:id`) from a `<w:ins>` element when this logical change includes an insertion.",
148152
"type": "string"
149153
}
150154
},

apps/docs/document-api/reference/track-changes/list.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ List all tracked changes in the document.
2020

2121
## Expected result
2222

23-
Returns a TrackChangesListResult with tracked change entries, total count, and source Word revision IDs when available.
23+
Returns a TrackChangesListResult with tracked change entries, total count, and raw imported Word OOXML revision IDs (`w:id`) when available.
2424

2525
## Input fields
2626

@@ -168,14 +168,18 @@ Returns a TrackChangesListResult with tracked change entries, total count, and s
168168
},
169169
"wordRevisionIds": {
170170
"additionalProperties": false,
171+
"description": "Raw imported Word OOXML revision IDs (`w:id`) from the source document when available. This is provenance metadata, not the canonical SuperDoc tracked-change ID. Replacements may include both `insert` and `delete` IDs.",
171172
"properties": {
172173
"delete": {
174+
"description": "Raw imported Word OOXML revision ID (`w:id`) from a `<w:del>` element when this logical change includes a deletion.",
173175
"type": "string"
174176
},
175177
"format": {
178+
"description": "Raw imported Word OOXML revision ID (`w:id`) from a `<w:rPrChange>` element when this logical change includes a formatting revision.",
176179
"type": "string"
177180
},
178181
"insert": {
182+
"description": "Raw imported Word OOXML revision ID (`w:id`) from a `<w:ins>` element when this logical change includes an insertion.",
179183
"type": "string"
180184
}
181185
},

packages/document-api/src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ List tracked changes in the document. Supports filtering by `type` and paginatio
711711
Retrieve full information for a single tracked change by its canonical ID. Throws `TARGET_NOT_FOUND` when the ID is invalid.
712712

713713
- **Input**: `TrackChangesGetInput` (`{ id }`)
714-
- **Output**: `TrackChangeInfo` (includes `wordRevisionIds` when imported source OOXML revision IDs are available)
714+
- **Output**: `TrackChangeInfo` (includes `wordRevisionIds` with raw imported Word OOXML `w:id` values when available)
715715
- **Mutates**: No
716716
- **Idempotency**: idempotent
717717

packages/document-api/src/contract/operation-definitions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ export const OPERATION_DEFINITIONS = {
22152215
memberPath: 'trackChanges.list',
22162216
description: 'List all tracked changes in the document.',
22172217
expectedResult:
2218-
'Returns a TrackChangesListResult with tracked change entries, total count, and source Word revision IDs when available.',
2218+
'Returns a TrackChangesListResult with tracked change entries, total count, and raw imported Word OOXML revision IDs (`w:id`) when available.',
22192219
requiresDocumentContext: true,
22202220
metadata: readOperation({
22212221
idempotency: 'idempotent',
@@ -2230,7 +2230,7 @@ export const OPERATION_DEFINITIONS = {
22302230
memberPath: 'trackChanges.get',
22312231
description: 'Retrieve a single tracked change by ID.',
22322232
expectedResult:
2233-
'Returns a TrackChangeInfo object with the change type, author, date, affected content, and source Word revision IDs when available.',
2233+
'Returns a TrackChangeInfo object with the change type, author, date, affected content, and raw imported Word OOXML revision IDs (`w:id`) when available.',
22342234
requiresDocumentContext: true,
22352235
metadata: readOperation({
22362236
idempotency: 'idempotent',

packages/document-api/src/contract/schemas.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,11 +1478,27 @@ const commentDomainItemSchema = discoveryItemSchema(
14781478

14791479
const commentsListResultSchema = discoveryResultSchema(commentDomainItemSchema);
14801480

1481-
const trackChangeWordRevisionIdsSchema = objectSchema({
1482-
insert: { type: 'string' },
1483-
delete: { type: 'string' },
1484-
format: { type: 'string' },
1485-
});
1481+
const trackChangeWordRevisionIdsSchema: JsonSchema = {
1482+
...objectSchema({
1483+
insert: {
1484+
type: 'string',
1485+
description:
1486+
'Raw imported Word OOXML revision ID (`w:id`) from a `<w:ins>` element when this logical change includes an insertion.',
1487+
},
1488+
delete: {
1489+
type: 'string',
1490+
description:
1491+
'Raw imported Word OOXML revision ID (`w:id`) from a `<w:del>` element when this logical change includes a deletion.',
1492+
},
1493+
format: {
1494+
type: 'string',
1495+
description:
1496+
'Raw imported Word OOXML revision ID (`w:id`) from a `<w:rPrChange>` element when this logical change includes a formatting revision.',
1497+
},
1498+
}),
1499+
description:
1500+
'Raw imported Word OOXML revision IDs (`w:id`) from the source document when available. This is provenance metadata, not the canonical SuperDoc tracked-change ID. Replacements may include both `insert` and `delete` IDs.',
1501+
};
14861502

14871503
const trackChangeInfoSchema = objectSchema(
14881504
{

packages/document-api/src/types/track-changes.types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ import type { DiscoveryOutput } from './discovery.js';
33

44
export type TrackChangeType = 'insert' | 'delete' | 'format';
55

6+
/**
7+
* Raw imported Word OOXML revision IDs (`w:id`) from the source document when available.
8+
*
9+
* This is provenance metadata, not the canonical SuperDoc tracked-change ID.
10+
* Replacements may include both `insert` and `delete` IDs.
11+
*/
612
export interface TrackChangeWordRevisionIds {
13+
/** Raw imported Word OOXML revision ID (`w:id`) from a `<w:ins>` element when present. */
714
insert?: string;
15+
/** Raw imported Word OOXML revision ID (`w:id`) from a `<w:del>` element when present. */
816
delete?: string;
17+
/** Raw imported Word OOXML revision ID (`w:id`) from a `<w:rPrChange>` element when present. */
918
format?: string;
1019
}
1120

@@ -14,6 +23,7 @@ export interface TrackChangeInfo {
1423
/** Convenience alias for `address.entityId`. */
1524
id: string;
1625
type: TrackChangeType;
26+
/** Raw imported Word OOXML revision IDs (`w:id`) from the source document when available. */
1727
wordRevisionIds?: TrackChangeWordRevisionIds;
1828
author?: string;
1929
authorEmail?: string;
@@ -34,6 +44,7 @@ export interface TrackChangesListQuery {
3444
export interface TrackChangeDomain {
3545
address: TrackedChangeAddress;
3646
type: TrackChangeType;
47+
/** Raw imported Word OOXML revision IDs (`w:id`) from the source document when available. */
3748
wordRevisionIds?: TrackChangeWordRevisionIds;
3849
author?: string;
3950
authorEmail?: string;

0 commit comments

Comments
 (0)