dingtalk-wiki 1.2.13 → 1.2.14

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.
Files changed (2) hide show
  1. package/index.js +17 -16
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1633,31 +1633,32 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1633
1633
  }
1634
1634
  }
1635
1635
 
1636
- // Step 10: doc_2.0 API - DocContent (direct dentry content read, async returns taskId)
1637
- for (let attempt = 1; attempt <= 3; attempt++) {
1636
+ // Step 10: doc_2.0 API - DocContent + QueryDocContent
1637
+ for (const cfg of [
1638
+ { label: 'DocContent /v2.0/doc/dentries/{uuid}/contents', params: { operatorId: opId }, data: undefined },
1639
+ { label: 'DocContent + targetFormat query', params: { operatorId: opId, targetFormat: 'markdown' }, data: undefined },
1640
+ { label: 'QueryDocContent /v2.0/doc/query/{uuid}/contents', path: `/v2.0/doc/query/${input}/contents`, params: { operatorId: opId, targetFormat: 'markdown' }, data: undefined },
1641
+ ]) {
1638
1642
  try {
1643
+ const path = cfg.path || `/v2.0/doc/dentries/${input}/contents`;
1639
1644
  const docContentRes = await axios({
1640
1645
  method: 'GET',
1641
- url: `${DINGTALK_API_V2}/v2.0/doc/dentries/${input}/contents`,
1642
- headers: { 'x-acs-dingtalk-access-token': token },
1643
- params: { operatorId: opId }
1646
+ url: `${DINGTALK_API_V2}${path}`,
1647
+ headers: { 'x-acs-dingtalk-access-token': token, 'Content-Type': 'application/json' },
1648
+ params: cfg.params,
1649
+ data: cfg.data
1644
1650
  });
1645
1651
  steps.push({
1646
- step: `doc_2.0 DocContent (attempt ${attempt})`,
1652
+ step: cfg.label,
1647
1653
  result: '成功',
1648
1654
  raw: docContentRes.data
1649
1655
  });
1650
- break;
1651
1656
  } catch (e) {
1652
- if (attempt === 3) {
1653
- steps.push({
1654
- step: `doc_2.0 DocContent (attempt ${attempt})`,
1655
- result: '失败',
1656
- raw: { message: e.response?.data?.message || e.message, code: e.response?.data?.code || '(无)', status: e.response?.status || '(无)' }
1657
- });
1658
- } else {
1659
- await new Promise(r => setTimeout(r, 1000));
1660
- }
1657
+ steps.push({
1658
+ step: cfg.label,
1659
+ result: '失败',
1660
+ raw: { message: e.response?.data?.message || e.message, code: e.response?.data?.code || '(无)', status: e.response?.status || '(无)' }
1661
+ });
1661
1662
  }
1662
1663
  }
1663
1664
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dingtalk-wiki",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "description": "DingTalk Wiki / Docs read-write MCP server that fills the gap left by DingTalk official MCP.",
5
5
  "main": "index.js",
6
6
  "bin": {