@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.
- package/package.json +1 -1
- package/src/docx.ts +6 -4
package/package.json
CHANGED
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
|
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 };
|