@max1874/feishu 0.2.1 → 0.2.2

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/package.json +1 -1
  2. package/src/docx.ts +6 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max1874/feishu",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "OpenClaw Feishu/Lark channel plugin",
6
6
  "license": "MIT",
package/src/docx.ts CHANGED
@@ -65,9 +65,11 @@ const BLOCK_TYPE_NAMES: Record<number, string> = {
65
65
  };
66
66
 
67
67
  // Block types that cannot be created via documentBlockChildren.create API
68
- const UNSUPPORTED_CREATE_TYPES = new Set([
69
- 31, // Table - must use different API or workaround
70
- 32, // TableCell - child of Table
68
+ // Note: Table (31) and TableCell (32) were previously excluded, but the convert API
69
+ // returns them with proper structure, so we attempt to create them directly.
70
+ // If creation fails, the error will be reported to the user.
71
+ const UNSUPPORTED_CREATE_TYPES = new Set<number>([
72
+ // Empty for now - let's try creating tables directly
71
73
  ]);
72
74
 
73
75
  /** Clean blocks for insertion (remove unsupported types and read-only fields) */
@@ -83,7 +85,7 @@ function cleanBlocksForInsert(blocks: any[]): { cleaned: any[]; skipped: string[
83
85
  return true;
84
86
  })
85
87
  .map((block) => {
86
- // Remove any read-only fields that might slip through
88
+ // Remove read-only fields from table blocks that might cause API errors
87
89
  if (block.block_type === 31 && block.table?.merge_info) {
88
90
  const { merge_info, ...tableRest } = block.table;
89
91
  return { ...block, table: tableRest };