@superdoc/sdk 2.17.1-next.1 → 2.17.1-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/embedded-tools.generated.cjs +5 -5
- package/dist/embedded-tools.generated.js +5 -5
- package/dist/generated/client.d.ts +4 -370
- package/dist/generated/contract.cjs +1 -1
- package/dist/generated/contract.js +1 -1
- package/dist/runtime/sdk-version.generated.cjs +1 -1
- package/dist/runtime/sdk-version.generated.d.ts +1 -1
- package/dist/runtime/sdk-version.generated.js +1 -1
- package/package.json +7 -7
- package/tools/catalog.json +5 -1
- package/tools/tools-policy.json +1 -1
- package/tools/tools.anthropic.json +5 -1
- package/tools/tools.generic.json +5 -1
- package/tools/tools.openai.json +5 -1
- package/tools/tools.vercel.json +5 -1
package/README.md
CHANGED
|
@@ -60,6 +60,42 @@ is not supported for Liveblocks or the standalone document host.
|
|
|
60
60
|
|
|
61
61
|
See the [Node.js SDK guide](https://docs.superdoc.dev/agents/automation/node-sdk) for a complete workflow.
|
|
62
62
|
|
|
63
|
+
## Discover footer paragraphs
|
|
64
|
+
|
|
65
|
+
`blocks.list({ in: story })` lists top-level blocks. To discover paragraphs
|
|
66
|
+
inside footer tables, including tables wrapped in block content controls, use
|
|
67
|
+
the paragraph node selector:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
const story = { kind: 'story', storyType: 'headerFooterPart', refId: footerPart.refId };
|
|
71
|
+
const paragraphs = await document.find({
|
|
72
|
+
in: story,
|
|
73
|
+
select: { type: 'node', nodeType: 'paragraph' },
|
|
74
|
+
limit: 100,
|
|
75
|
+
offset: 0,
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Page with `offset` and `limit` until you have read `total` paragraphs. Each
|
|
80
|
+
item's `address.nodeId` is the supported `blockId` for a text position, and
|
|
81
|
+
`address.story` scopes that position to the footer. Use the returned address;
|
|
82
|
+
do not derive it from OOXML `w14:paraId`. The supplied XML ID may match the API
|
|
83
|
+
ID, but that equality is not a contract, and structural edits can replace a
|
|
84
|
+
paragraph and its ID. Rediscover the paragraph after such edits.
|
|
85
|
+
|
|
86
|
+
For a token replacement, `query.match` returns the complete mutation target,
|
|
87
|
+
including the story and text offsets:
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
const matches = await document.query.match({
|
|
91
|
+
in: story,
|
|
92
|
+
select: { type: 'text', pattern: '{{contract_number}}', mode: 'contains' },
|
|
93
|
+
});
|
|
94
|
+
if (matches.total === 1) {
|
|
95
|
+
await document.replace({ target: matches.items[0].target, text: 'PO-123' });
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
63
99
|
## Tracked comparison with exact-file review
|
|
64
100
|
|
|
65
101
|
The SDK's `diff.capture` and `diff.compare` describe a snapshot comparison. A
|