dingtalk-wiki 1.2.11 → 1.2.12

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 +42 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1633,6 +1633,48 @@ 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
+ try {
1638
+ const docContentRes = await axios({
1639
+ method: 'GET',
1640
+ url: `${DINGTALK_API_V2}/v2.0/doc/dentries/${input}/contents`,
1641
+ headers: { 'x-acs-dingtalk-access-token': token },
1642
+ params: { operatorId: opId }
1643
+ });
1644
+ steps.push({
1645
+ step: 'doc_2.0 DocContent GET /v2.0/doc/dentries/{uuid}/contents',
1646
+ result: '成功',
1647
+ raw: docContentRes.data
1648
+ });
1649
+ } catch (e) {
1650
+ steps.push({
1651
+ step: 'doc_2.0 DocContent GET /v2.0/doc/dentries/{uuid}/contents',
1652
+ result: '失败',
1653
+ raw: { message: e.response?.data?.message || e.message, code: e.response?.data?.code || '(无)', status: e.response?.status || '(无)' }
1654
+ });
1655
+ }
1656
+
1657
+ // Step 11: doc_2.0 API - GetDocContent (another way to get content)
1658
+ try {
1659
+ const getDocContentRes = await axios({
1660
+ method: 'GET',
1661
+ url: `${DINGTALK_API_V2}/v2.0/doc/me/query/${input}/contents`,
1662
+ headers: { 'x-acs-dingtalk-access-token': token },
1663
+ params: { targetFormat: 'markdown' }
1664
+ });
1665
+ steps.push({
1666
+ step: 'doc_2.0 GetDocContent GET /v2.0/doc/me/query/{uuid}/contents',
1667
+ result: '成功',
1668
+ raw: getDocContentRes.data
1669
+ });
1670
+ } catch (e) {
1671
+ steps.push({
1672
+ step: 'doc_2.0 GetDocContent GET /v2.0/doc/me/query/{uuid}/contents',
1673
+ result: '失败',
1674
+ raw: { message: e.response?.data?.message || e.message, code: e.response?.data?.code || '(无)', status: e.response?.status || '(无)' }
1675
+ });
1676
+ }
1677
+
1636
1678
  const lines = ['🔍 docKey 诊断报告', '', `输入: ${input}`, `operatorId: ${opId}`, ''];
1637
1679
  steps.forEach(s => {
1638
1680
  lines.push(`--- ${s.step} ---`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dingtalk-wiki",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
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": {