bitable-upload 1.3.1 → 1.3.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/README.md +143 -17
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,19 +1,145 @@
1
1
  # 🚀 bitable-upload
2
2
 
3
- <p align="center">
4
- <a href="https://github.com/xiaxiamao2026/xiaxiamao-lark-bitable/releases">
5
- <img src="https://img.shields.io/github/v/release/xiaxiamao2026/xiaxiamao-lark-bitable" alt="Release">
6
- </a>
7
- <a href="https://www.npmjs.com/package/bitable-upload">
8
- <img src="https://img.shields.io/npm/v/bitable-upload" alt="npm">
9
- </a>
10
- <a href="https://github.com/xiaxiamao2026/xiaxiamao-lark-bitable/blob/main/LICENSE">
11
- <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
12
- </a>
13
- </p>
14
-
15
- <p align="center">
16
- <b>Node.js CLI工具 - 上传附件到Lark多维表格</b><br>
17
- 支持图片和PDF文件,命令行调用<br>
18
- <a href="#安装">开始使用</a> • <a href="#功能特性">功能特性</a> • <a href="#使用方法">使用方法</a>
19
- </p>
3
+ Node.js CLI tool for uploading attachments to Lark Bitable multidimensional tables
4
+
5
+ ## 📦 **安装**
6
+
7
+ ```bash
8
+ # 全局安装(推荐)
9
+ npm install -g bitable-upload
10
+
11
+ # 或作为项目依赖
12
+ npm install bitable-upload --save
13
+ ```
14
+
15
+ ## 🎯 **使用方法**
16
+
17
+ ### 1. 交互式模式(推荐)
18
+ ```bash
19
+ bitable-upload
20
+ ```
21
+
22
+ ### 2. 快速上传模式
23
+ ```bash
24
+ bitable-upload <appToken> <tableId> <recordId> <fieldName> <filePath>
25
+ ```
26
+
27
+ ### 3. 查看帮助
28
+ ```bash
29
+ bitable-upload --help
30
+ ```
31
+
32
+ ### 4. 获取版本信息
33
+ ```bash
34
+ bitable-upload --version
35
+ ```
36
+
37
+ ## ✨ **功能特性**
38
+
39
+ - **智能发现** - 自动列出多维表格、数据表和附件字段
40
+ - **通用上传** - 支持图片、PDF等任意文件类型
41
+ - **批量处理** - 支持多文件批量上传
42
+ - **错误重试** - 自动重试失败的任务
43
+ - **Token管理** - 自动处理Token过期和刷新
44
+
45
+ ## 🔧 **配置**
46
+
47
+ ### 环境变量配置
48
+ ```bash
49
+ # Lark应用凭证(必需)
50
+ export LARK_APP_ID="cli_your_app_id"
51
+ export LARK_APP_SECRET="your_app_secret"
52
+
53
+ # 可选:设置默认参数
54
+ export LARK_DEFAULT_APP_TOKEN="your_default_app_token"
55
+ export LARK_DEFAULT_TABLE_ID="your_default_table_id"
56
+ ```
57
+
58
+ ## 🎯 **使用示例**
59
+
60
+ ### 交互式上传流程
61
+ ```
62
+ $ bitable-upload
63
+
64
+ 🚀 开始多维表格附件上传流程
65
+
66
+ 📋 正在获取多维表格列表...
67
+ 📋 可用的多维表格:
68
+ 1. 项目管理表 (app_a1b2c3d4e5f6g7h8)
69
+ 2. 资产登记表 (app_i9j0k1l2m3n4o5p6)
70
+ 3. 产品资料库 (app_q7r8s9t0u1v2w3x4)
71
+
72
+ 请选择表格编号 (1-3): 1
73
+ ✅ 已选择表格: 项目管理表
74
+
75
+ 🗂️ 正在获取数据表列表...
76
+ 🗂️ 数据表列表:
77
+ 1. 项目附件 (table_1a2b3c4d5e6f7g8h)
78
+ 2. 团队资料 (table_9i0j1k2l3m4n5o6p)
79
+
80
+ 请选择数据表编号 (1-2): 1
81
+ ✅ 已选择数据表: 项目附件
82
+
83
+ 🔍 正在获取字段列表...
84
+ 📎 附件字段列表:
85
+ 1. 设计稿 (field_design)
86
+ 2. 需求文档 (field_requirements)
87
+
88
+ 请选择附件字段编号 (1-2): 1
89
+ ✅ 已选择附件字段: 设计稿
90
+
91
+ 📝 正在获取记录列表...
92
+ 📝 记录列表 (前20条):
93
+ 1. 移动端UI设计 (rec_1a2b3c4d5e)
94
+ 2. 后台管理系统 (rec_6f7g8h9i0j)
95
+ 3. 数据可视化大屏 (rec_k1l2m3n4o5)
96
+
97
+ 请选择记录编号 (1-20) 或输入记录ID: 1
98
+ ✅ 已选择记录: rec_1a2b3c4d5e
99
+
100
+ 📁 请输入要上传的图片文件路径: /tmp/design_mockup.png
101
+ 📤 正在上传图片: /tmp/design_mockup.png...
102
+ ✅ 文件上传成功: file_x1y2z3a4b5c6d7e8f9
103
+
104
+ 🔄 正在更新记录附件字段...
105
+ 🎉 附件上传完成!
106
+ 📎 记录ID: rec_1a2b3c4d5e
107
+ 📄 字段: 设计稿
108
+ 🖼️ 附件: file_x1y2z3a4b5c6d7e8f9
109
+ ```
110
+
111
+ ### 快速上传
112
+ ```bash
113
+ bitable-upload app_a1b2c3d4e5f6g7h8 table_1a2b3c4d5e6f7g8h rec_1a2b3c4d5e "设计稿" /tmp/design.png
114
+ ```
115
+
116
+ ## 📋 **API使用**
117
+
118
+ ```javascript
119
+ const FeishuBitableAttachmentUploader = require('bitable-upload');
120
+
121
+ // 创建上传器
122
+ const uploader = new FeishuBitableAttachmentUploader(
123
+ 'your_app_id',
124
+ 'your_app_secret'
125
+ );
126
+
127
+ // 快速上传
128
+ await uploader.quickUpload({
129
+ appToken: 'your_app_token',
130
+ tableId: 'your_table_id',
131
+ recordId: 'your_record_id',
132
+ fieldName: '附件字段名',
133
+ filePath: '/path/to/image.png',
134
+ customName: 'custom_name.png' // 可选
135
+ });
136
+
137
+ // 交互式上传
138
+ await uploader.interactiveUpload();
139
+ ```
140
+
141
+ ## 📄 **许可证**
142
+ MIT License
143
+
144
+ ## 🤝 **贡献**
145
+ 欢迎提交Issue和Pull Request
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitable-upload",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Node.js CLI tool for uploading attachments to Lark Bitable multidimensional tables",
5
5
  "main": "index.js",
6
6
  "bin": {