plugin-document-understanding 1.1.9 → 1.1.11
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/dist/client/345.17f88ffb846ec69b.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/345.1e0c321d30702aa1.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +1 -1
- package/dist/locale/en-US.json +171 -121
- package/dist/locale/vi-VN.json +171 -121
- package/dist/locale/zh-CN.json +171 -1
- package/dist/server/services/DocumentUnderstandingService.js +1 -1
- package/package.json +46 -49
- package/src/client/index.tsx +7 -1
- package/src/client-v2/components/EndpointsTab.tsx +177 -108
- package/src/client-v2/components/JobsTab.tsx +94 -59
- package/src/client-v2/components/PipelinesTab.tsx +244 -154
- package/src/client-v2/components/PluginSettings.tsx +2 -0
- package/src/client-v2/components/ServiceConfigTab.tsx +56 -39
- package/src/client-v2/types.ts +32 -0
- package/src/locale/en-US.json +171 -121
- package/src/locale/vi-VN.json +171 -121
- package/src/locale/zh-CN.json +171 -1
- package/src/server/__tests__/document-understanding-service.test.ts +13 -2
- package/src/server/__tests__/pipeline-executor.test.ts +55 -55
- package/src/server/actions.ts +176 -176
- package/src/server/plugin.ts +134 -134
- package/src/server/services/DocumentUnderstandingService.ts +3 -1
- package/src/server/services/PipelineExecutor.ts +477 -477
- package/src/server/types.ts +78 -78
- package/dist/client-v2/794.9b984a25b2fc7c14.js +0 -10
package/src/locale/vi-VN.json
CHANGED
|
@@ -1,121 +1,171 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Document Understanding": "Hiểu Tài Liệu",
|
|
3
|
-
"Document Understanding - Pipeline Orchestrator": "Hiểu Tài Liệu - Bộ Điều Phối Pipeline",
|
|
4
|
-
"Service Connection": "Kết nối dịch vụ",
|
|
5
|
-
"Service Config": "Cấu hình dịch vụ",
|
|
6
|
-
"Endpoints": "Endpoints",
|
|
7
|
-
"Pipelines": "Pipelines",
|
|
8
|
-
"Jobs history": "Lịch sử công việc",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"No
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
|
|
1
|
+
{
|
|
2
|
+
"Document Understanding": "Hiểu Tài Liệu",
|
|
3
|
+
"Document Understanding - Pipeline Orchestrator": "Hiểu Tài Liệu - Bộ Điều Phối Pipeline",
|
|
4
|
+
"Service Connection": "Kết nối dịch vụ",
|
|
5
|
+
"Service Config": "Cấu hình dịch vụ",
|
|
6
|
+
"Endpoints": "Endpoints",
|
|
7
|
+
"Pipelines": "Pipelines",
|
|
8
|
+
"Jobs history": "Lịch sử công việc",
|
|
9
|
+
"Configure the connection to your external document processing service": "Cấu hình kết nối đến dịch vụ xử lý tài liệu bên ngoài",
|
|
10
|
+
"Base URL": "URL gốc",
|
|
11
|
+
"Base URL is required": "URL gốc là bắt buộc",
|
|
12
|
+
"The root URL of your document processing API": "URL gốc của API xử lý tài liệu",
|
|
13
|
+
"Authentication Type": "Loại xác thực",
|
|
14
|
+
"None": "Không",
|
|
15
|
+
"API Key": "Khóa API",
|
|
16
|
+
"Bearer Token": "Token Bearer",
|
|
17
|
+
"Custom Header": "Header tùy chỉnh",
|
|
18
|
+
"Custom Header Name": "Tên Header tùy chỉnh",
|
|
19
|
+
"Enter key or token": "Nhập khóa hoặc token",
|
|
20
|
+
"Request Timeout (ms)": "Timeout request (ms)",
|
|
21
|
+
"Default Retries": "Số lần thử lại mặc định",
|
|
22
|
+
"Poll Interval (ms)": "Khoảng thời gian poll (ms)",
|
|
23
|
+
"Poll Timeout (ms)": "Timeout poll (ms)",
|
|
24
|
+
"Webhook Secret": "Mã bí mật Webhook",
|
|
25
|
+
"Used to verify HMAC-SHA256 signatures on incoming webhook callbacks": "Dùng để xác thực chữ ký HMAC-SHA256 của các webhook callback đến",
|
|
26
|
+
"Optional: secret for webhook signature verification": "Tùy chọn: mã bí mật để xác thực chữ ký webhook",
|
|
27
|
+
"Save Configuration": "Lưu cấu hình",
|
|
28
|
+
"Configuration saved successfully": "Đã lưu cấu hình thành công",
|
|
29
|
+
"Failed to save config": "Lưu cấu hình thất bại",
|
|
30
|
+
"Add Endpoint": "Thêm Endpoint",
|
|
31
|
+
"Edit Endpoint": "Sửa Endpoint",
|
|
32
|
+
"Basic": "Cơ bản",
|
|
33
|
+
"File Input": "File đầu vào",
|
|
34
|
+
"Async Config": "Cấu hình bất đồng bộ",
|
|
35
|
+
"Schema": "Schema",
|
|
36
|
+
"Custom Headers": "Headers tùy chỉnh",
|
|
37
|
+
"Unique Name": "Tên duy nhất",
|
|
38
|
+
"Subpath": "Đường dẫn con",
|
|
39
|
+
"Description": "Mô tả",
|
|
40
|
+
"What this endpoint does": "Endpoint này làm gì",
|
|
41
|
+
"HTTP Method": "Phương thức HTTP",
|
|
42
|
+
"Execution Mode": "Chế độ thực thi",
|
|
43
|
+
"Synchronous": "Đồng bộ",
|
|
44
|
+
"Polling": "Polling",
|
|
45
|
+
"Webhook": "Webhook",
|
|
46
|
+
"File Input Mode": "Chế độ nhập file",
|
|
47
|
+
"Multipart Upload": "Upload Multipart",
|
|
48
|
+
"Base64 in JSON": "Base64 trong JSON",
|
|
49
|
+
"File Field Name": "Tên trường file",
|
|
50
|
+
"Max Files": "Số file tối đa",
|
|
51
|
+
"Task ID Field": "Trường Task ID",
|
|
52
|
+
"Field in response containing the async task ID": "Trường trong response chứa Task ID bất đồng bộ",
|
|
53
|
+
"Poll Result Subpath": "Đường dẫn poll kết quả",
|
|
54
|
+
"URL to poll for result. Use {taskId} as placeholder.": "URL để poll kết quả. Dùng {taskId} làm placeholder.",
|
|
55
|
+
"Required for polling mode": "Bắt buộc với chế độ polling",
|
|
56
|
+
"Result Field": "Trường kết quả",
|
|
57
|
+
"Field in poll response containing the actual result": "Trường trong response poll chứa kết quả thực tế",
|
|
58
|
+
"Status Field (optional)": "Trường trạng thái (tùy chọn)",
|
|
59
|
+
"Field to check completion status. If empty, any non-null result = complete.": "Trường để kiểm tra trạng thái hoàn thành. Nếu để trống, mọi kết quả khác null đều coi là hoàn thành.",
|
|
60
|
+
"Completed Value": "Giá trị hoàn thành",
|
|
61
|
+
"Value of status field that means 'done'": "Giá trị của trường trạng thái nghĩa là 'đã xong'",
|
|
62
|
+
"Override default": "Ghi đè giá trị mặc định",
|
|
63
|
+
"Request Body Schema (JSON Schema)": "Schema body request (JSON Schema)",
|
|
64
|
+
"Response Schema (JSON Schema)": "Schema response (JSON Schema)",
|
|
65
|
+
"Additional Headers": "Headers bổ sung",
|
|
66
|
+
"Add Header": "Thêm Header",
|
|
67
|
+
"Header name": "Tên header",
|
|
68
|
+
"Value": "Giá trị",
|
|
69
|
+
"Enabled": "Bật",
|
|
70
|
+
"Yes": "Có",
|
|
71
|
+
"No": "Không",
|
|
72
|
+
"Action": "Hành động",
|
|
73
|
+
"Edit": "Sửa",
|
|
74
|
+
"Delete": "Xóa",
|
|
75
|
+
"Deleted": "Đã xóa",
|
|
76
|
+
"Save": "Lưu",
|
|
77
|
+
"Saved": "Đã lưu",
|
|
78
|
+
"Cancel": "Hủy",
|
|
79
|
+
"Close": "Đóng",
|
|
80
|
+
"Add Pipeline": "Thêm Pipeline",
|
|
81
|
+
"Edit Pipeline": "Sửa Pipeline",
|
|
82
|
+
"New Pipeline": "Pipeline mới",
|
|
83
|
+
"Pipeline Name": "Tên Pipeline",
|
|
84
|
+
"What this pipeline does": "Pipeline này làm gì",
|
|
85
|
+
"Pipeline Steps": "Các bước Pipeline",
|
|
86
|
+
"step(s)": "bước",
|
|
87
|
+
"steps": "bước",
|
|
88
|
+
"Add Step": "Thêm bước",
|
|
89
|
+
"Add First Step": "Thêm bước đầu tiên",
|
|
90
|
+
"No steps yet": "Chưa có bước nào",
|
|
91
|
+
"Step": "Bước",
|
|
92
|
+
"Step Name": "Tên bước",
|
|
93
|
+
"(unnamed)": "(chưa đặt tên)",
|
|
94
|
+
"Endpoint": "Endpoint",
|
|
95
|
+
"Select endpoint": "Chọn endpoint",
|
|
96
|
+
"Output Alias": "Alias đầu ra",
|
|
97
|
+
"Other steps reference this as": "Các bước khác tham chiếu như sau",
|
|
98
|
+
"On Error": "Khi lỗi",
|
|
99
|
+
"Fail": "Dừng",
|
|
100
|
+
"Skip": "Bỏ qua",
|
|
101
|
+
"Retry": "Thử lại",
|
|
102
|
+
"Move step up": "Di chuyển bước lên",
|
|
103
|
+
"Move step down": "Di chuyển bước xuống",
|
|
104
|
+
"Remove step?": "Xóa bước này?",
|
|
105
|
+
"Step can be skipped on error": "Bước này có thể bỏ qua khi lỗi",
|
|
106
|
+
"Has condition": "Có điều kiện",
|
|
107
|
+
"Input Mapping (JSON)": "Ánh xạ đầu vào (JSON)",
|
|
108
|
+
"Map endpoint input fields. Use $input.field, $step[alias].response.field, $files, or literal values.": "Ánh xạ các trường đầu vào của endpoint. Dùng $input.field, $step[alias].response.field, $files, hoặc giá trị trực tiếp.",
|
|
109
|
+
"Condition (optional JSON)": "Điều kiện (JSON, tùy chọn)",
|
|
110
|
+
"Only run this step if the condition matches.": "Chỉ chạy bước này nếu điều kiện khớp.",
|
|
111
|
+
"Input Schema": "Schema đầu vào",
|
|
112
|
+
"Input Schema (JSON Schema)": "Schema đầu vào (JSON Schema)",
|
|
113
|
+
"Defines what input this pipeline accepts. Used by AI tool schema.": "Định nghĩa đầu vào mà pipeline này nhận. Dùng cho schema công cụ AI.",
|
|
114
|
+
"Output Mapping (JSON)": "Ánh xạ đầu ra (JSON)",
|
|
115
|
+
"Map final step results to pipeline output. If empty, all step results are returned.": "Ánh xạ kết quả các bước cuối thành đầu ra của pipeline. Nếu để trống, tất cả kết quả các bước sẽ được trả về.",
|
|
116
|
+
"Advanced: Input Schema & Output Mapping": "Nâng cao: Schema đầu vào & Ánh xạ đầu ra",
|
|
117
|
+
"AI Tool": "Công cụ AI",
|
|
118
|
+
"Registered as": "Đăng ký dưới tên",
|
|
119
|
+
"Active": "Đang hoạt động",
|
|
120
|
+
"Inactive": "Không hoạt động",
|
|
121
|
+
"Steps": "Các bước",
|
|
122
|
+
"Test": "Kiểm thử",
|
|
123
|
+
"Test Playground": "Khu vực kiểm thử",
|
|
124
|
+
"Input JSON": "JSON đầu vào",
|
|
125
|
+
"Invalid JSON input": "JSON đầu vào không hợp lệ",
|
|
126
|
+
"Run test": "Chạy kiểm thử",
|
|
127
|
+
"Test job started": "Đã khởi chạy công việc kiểm thử",
|
|
128
|
+
"Result": "Kết quả",
|
|
129
|
+
"Run a test to see job output": "Chạy kiểm thử để xem kết quả công việc",
|
|
130
|
+
"Pipeline error": "Lỗi pipeline",
|
|
131
|
+
"Pipeline did not return a job ID": "Pipeline không trả về Job ID",
|
|
132
|
+
"Failed to run pipeline test": "Chạy kiểm thử pipeline thất bại",
|
|
133
|
+
"Failed to refresh test job": "Làm mới công việc kiểm thử thất bại",
|
|
134
|
+
"Job": "Công việc",
|
|
135
|
+
"Job Details": "Chi tiết công việc",
|
|
136
|
+
"Unknown": "Không xác định",
|
|
137
|
+
"Status": "Trạng thái",
|
|
138
|
+
"Current Step": "Bước hiện tại",
|
|
139
|
+
"Started": "Bắt đầu",
|
|
140
|
+
"Completed": "Hoàn thành",
|
|
141
|
+
"Error": "Lỗi",
|
|
142
|
+
"Input": "Dữ liệu đầu vào",
|
|
143
|
+
"Step Results": "Kết quả từng bước",
|
|
144
|
+
"No step results yet": "Chưa có kết quả bước nào",
|
|
145
|
+
"Final Result": "Kết quả cuối cùng",
|
|
146
|
+
"(not yet available)": "(chưa có)",
|
|
147
|
+
"External Task IDs": "ID tác vụ ngoài",
|
|
148
|
+
"View": "Xem",
|
|
149
|
+
"Refresh": "Làm mới",
|
|
150
|
+
"Filter by status": "Lọc theo trạng thái",
|
|
151
|
+
"Filter by pipeline": "Lọc theo pipeline",
|
|
152
|
+
"Pipeline": "Pipeline",
|
|
153
|
+
"ID": "ID",
|
|
154
|
+
"Name": "Tên",
|
|
155
|
+
"Method": "Phương thức",
|
|
156
|
+
"Execution": "Thực thi",
|
|
157
|
+
"File": "File",
|
|
158
|
+
"Done": "Xong",
|
|
159
|
+
"Pending": "Đang chờ",
|
|
160
|
+
"Running": "Đang chạy",
|
|
161
|
+
"Failed": "Thất bại",
|
|
162
|
+
"Timeout": "Hết thời gian",
|
|
163
|
+
"All steps must have a name": "Tất cả các bước phải có tên",
|
|
164
|
+
"must have an endpoint": "phải có endpoint",
|
|
165
|
+
"Step output aliases must be unique": "Alias đầu ra của các bước phải khác nhau",
|
|
166
|
+
"Delete this endpoint?": "Xóa endpoint này?",
|
|
167
|
+
"Delete this pipeline?": "Xóa pipeline này?",
|
|
168
|
+
"skip on error": "bỏ qua khi lỗi",
|
|
169
|
+
"conditional": "có điều kiện",
|
|
170
|
+
"Invalid JSON": "JSON không hợp lệ"
|
|
171
|
+
}
|
package/src/locale/zh-CN.json
CHANGED
|
@@ -1 +1,171 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"Document Understanding": "文档理解",
|
|
3
|
+
"Document Understanding - Pipeline Orchestrator": "文档理解 - 流水线编排器",
|
|
4
|
+
"Service Connection": "服务连接",
|
|
5
|
+
"Service Config": "服务配置",
|
|
6
|
+
"Endpoints": "接口",
|
|
7
|
+
"Pipelines": "流水线",
|
|
8
|
+
"Jobs history": "任务历史",
|
|
9
|
+
"Configure the connection to your external document processing service": "配置与外部文档处理服务的连接",
|
|
10
|
+
"Base URL": "基础 URL",
|
|
11
|
+
"Base URL is required": "基础 URL 为必填项",
|
|
12
|
+
"The root URL of your document processing API": "文档处理 API 的根 URL",
|
|
13
|
+
"Authentication Type": "认证类型",
|
|
14
|
+
"None": "无",
|
|
15
|
+
"API Key": "API 密钥",
|
|
16
|
+
"Bearer Token": "Bearer 令牌",
|
|
17
|
+
"Custom Header": "自定义请求头",
|
|
18
|
+
"Custom Header Name": "自定义请求头名称",
|
|
19
|
+
"Enter key or token": "请输入密钥或令牌",
|
|
20
|
+
"Request Timeout (ms)": "请求超时(毫秒)",
|
|
21
|
+
"Default Retries": "默认重试次数",
|
|
22
|
+
"Poll Interval (ms)": "轮询间隔(毫秒)",
|
|
23
|
+
"Poll Timeout (ms)": "轮询超时(毫秒)",
|
|
24
|
+
"Webhook Secret": "Webhook 密钥",
|
|
25
|
+
"Used to verify HMAC-SHA256 signatures on incoming webhook callbacks": "用于校验 Webhook 回调的 HMAC-SHA256 签名",
|
|
26
|
+
"Optional: secret for webhook signature verification": "可选:用于 Webhook 签名校验的密钥",
|
|
27
|
+
"Save Configuration": "保存配置",
|
|
28
|
+
"Configuration saved successfully": "配置保存成功",
|
|
29
|
+
"Failed to save config": "配置保存失败",
|
|
30
|
+
"Add Endpoint": "添加接口",
|
|
31
|
+
"Edit Endpoint": "编辑接口",
|
|
32
|
+
"Basic": "基础",
|
|
33
|
+
"File Input": "文件输入",
|
|
34
|
+
"Async Config": "异步配置",
|
|
35
|
+
"Schema": "结构定义",
|
|
36
|
+
"Custom Headers": "自定义请求头",
|
|
37
|
+
"Unique Name": "唯一名称",
|
|
38
|
+
"Subpath": "子路径",
|
|
39
|
+
"Description": "描述",
|
|
40
|
+
"What this endpoint does": "该接口的作用",
|
|
41
|
+
"HTTP Method": "HTTP 方法",
|
|
42
|
+
"Execution Mode": "执行模式",
|
|
43
|
+
"Synchronous": "同步",
|
|
44
|
+
"Polling": "轮询",
|
|
45
|
+
"Webhook": "Webhook",
|
|
46
|
+
"File Input Mode": "文件输入模式",
|
|
47
|
+
"Multipart Upload": "Multipart 上传",
|
|
48
|
+
"Base64 in JSON": "JSON 中的 Base64",
|
|
49
|
+
"File Field Name": "文件字段名",
|
|
50
|
+
"Max Files": "最大文件数",
|
|
51
|
+
"Task ID Field": "任务 ID 字段",
|
|
52
|
+
"Field in response containing the async task ID": "响应中包含异步任务 ID 的字段",
|
|
53
|
+
"Poll Result Subpath": "轮询结果子路径",
|
|
54
|
+
"URL to poll for result. Use {taskId} as placeholder.": "用于轮询结果的 URL,使用 {taskId} 作为占位符。",
|
|
55
|
+
"Required for polling mode": "轮询模式下为必填项",
|
|
56
|
+
"Result Field": "结果字段",
|
|
57
|
+
"Field in poll response containing the actual result": "轮询响应中包含实际结果的字段",
|
|
58
|
+
"Status Field (optional)": "状态字段(可选)",
|
|
59
|
+
"Field to check completion status. If empty, any non-null result = complete.": "用于判断完成状态的字段。若为空,任何非空结果即视为完成。",
|
|
60
|
+
"Completed Value": "完成值",
|
|
61
|
+
"Value of status field that means 'done'": "状态字段中表示“已完成”的值",
|
|
62
|
+
"Override default": "覆盖默认值",
|
|
63
|
+
"Request Body Schema (JSON Schema)": "请求体结构(JSON Schema)",
|
|
64
|
+
"Response Schema (JSON Schema)": "响应结构(JSON Schema)",
|
|
65
|
+
"Additional Headers": "附加请求头",
|
|
66
|
+
"Add Header": "添加请求头",
|
|
67
|
+
"Header name": "请求头名称",
|
|
68
|
+
"Value": "值",
|
|
69
|
+
"Enabled": "已启用",
|
|
70
|
+
"Yes": "是",
|
|
71
|
+
"No": "否",
|
|
72
|
+
"Action": "操作",
|
|
73
|
+
"Edit": "编辑",
|
|
74
|
+
"Delete": "删除",
|
|
75
|
+
"Deleted": "已删除",
|
|
76
|
+
"Save": "保存",
|
|
77
|
+
"Saved": "已保存",
|
|
78
|
+
"Cancel": "取消",
|
|
79
|
+
"Close": "关闭",
|
|
80
|
+
"Add Pipeline": "添加流水线",
|
|
81
|
+
"Edit Pipeline": "编辑流水线",
|
|
82
|
+
"New Pipeline": "新建流水线",
|
|
83
|
+
"Pipeline Name": "流水线名称",
|
|
84
|
+
"What this pipeline does": "该流水线的作用",
|
|
85
|
+
"Pipeline Steps": "流水线步骤",
|
|
86
|
+
"step(s)": "个步骤",
|
|
87
|
+
"steps": "个步骤",
|
|
88
|
+
"Add Step": "添加步骤",
|
|
89
|
+
"Add First Step": "添加第一个步骤",
|
|
90
|
+
"No steps yet": "暂无步骤",
|
|
91
|
+
"Step": "步骤",
|
|
92
|
+
"Step Name": "步骤名称",
|
|
93
|
+
"(unnamed)": "(未命名)",
|
|
94
|
+
"Endpoint": "接口",
|
|
95
|
+
"Select endpoint": "请选择接口",
|
|
96
|
+
"Output Alias": "输出别名",
|
|
97
|
+
"Other steps reference this as": "其他步骤引用方式",
|
|
98
|
+
"On Error": "出错时",
|
|
99
|
+
"Fail": "失败",
|
|
100
|
+
"Skip": "跳过",
|
|
101
|
+
"Retry": "重试",
|
|
102
|
+
"Move step up": "上移步骤",
|
|
103
|
+
"Move step down": "下移步骤",
|
|
104
|
+
"Remove step?": "移除该步骤?",
|
|
105
|
+
"Step can be skipped on error": "该步骤出错时可跳过",
|
|
106
|
+
"Has condition": "存在条件",
|
|
107
|
+
"Input Mapping (JSON)": "输入映射(JSON)",
|
|
108
|
+
"Map endpoint input fields. Use $input.field, $step[alias].response.field, $files, or literal values.": "映射接口输入字段。可使用 $input.field、$step[alias].response.field、$files 或字面值。",
|
|
109
|
+
"Condition (optional JSON)": "条件(可选 JSON)",
|
|
110
|
+
"Only run this step if the condition matches.": "仅在条件匹配时执行该步骤。",
|
|
111
|
+
"Input Schema": "输入结构",
|
|
112
|
+
"Input Schema (JSON Schema)": "输入结构(JSON Schema)",
|
|
113
|
+
"Defines what input this pipeline accepts. Used by AI tool schema.": "定义该流水线接受的输入,供 AI 工具结构使用。",
|
|
114
|
+
"Output Mapping (JSON)": "输出映射(JSON)",
|
|
115
|
+
"Map final step results to pipeline output. If empty, all step results are returned.": "将最终步骤结果映射为流水线输出。若为空,则返回所有步骤结果。",
|
|
116
|
+
"Advanced: Input Schema & Output Mapping": "高级:输入结构与输出映射",
|
|
117
|
+
"AI Tool": "AI 工具",
|
|
118
|
+
"Registered as": "注册为",
|
|
119
|
+
"Active": "已激活",
|
|
120
|
+
"Inactive": "未激活",
|
|
121
|
+
"Steps": "步骤",
|
|
122
|
+
"Test": "测试",
|
|
123
|
+
"Test Playground": "测试沙箱",
|
|
124
|
+
"Input JSON": "输入 JSON",
|
|
125
|
+
"Invalid JSON input": "输入的 JSON 无效",
|
|
126
|
+
"Run test": "运行测试",
|
|
127
|
+
"Test job started": "测试任务已启动",
|
|
128
|
+
"Result": "结果",
|
|
129
|
+
"Run a test to see job output": "运行测试以查看任务输出",
|
|
130
|
+
"Pipeline error": "流水线错误",
|
|
131
|
+
"Pipeline did not return a job ID": "流水线未返回任务 ID",
|
|
132
|
+
"Failed to run pipeline test": "运行流水线测试失败",
|
|
133
|
+
"Failed to refresh test job": "刷新测试任务失败",
|
|
134
|
+
"Job": "任务",
|
|
135
|
+
"Job Details": "任务详情",
|
|
136
|
+
"Unknown": "未知",
|
|
137
|
+
"Status": "状态",
|
|
138
|
+
"Current Step": "当前步骤",
|
|
139
|
+
"Started": "开始时间",
|
|
140
|
+
"Completed": "完成时间",
|
|
141
|
+
"Error": "错误",
|
|
142
|
+
"Input": "输入",
|
|
143
|
+
"Step Results": "步骤结果",
|
|
144
|
+
"No step results yet": "暂无步骤结果",
|
|
145
|
+
"Final Result": "最终结果",
|
|
146
|
+
"(not yet available)": "(暂不可用)",
|
|
147
|
+
"External Task IDs": "外部任务 ID",
|
|
148
|
+
"View": "查看",
|
|
149
|
+
"Refresh": "刷新",
|
|
150
|
+
"Filter by status": "按状态筛选",
|
|
151
|
+
"Filter by pipeline": "按流水线筛选",
|
|
152
|
+
"Pipeline": "流水线",
|
|
153
|
+
"ID": "ID",
|
|
154
|
+
"Name": "名称",
|
|
155
|
+
"Method": "方法",
|
|
156
|
+
"Execution": "执行",
|
|
157
|
+
"File": "文件",
|
|
158
|
+
"Done": "已完成",
|
|
159
|
+
"Pending": "等待中",
|
|
160
|
+
"Running": "运行中",
|
|
161
|
+
"Failed": "失败",
|
|
162
|
+
"Timeout": "超时",
|
|
163
|
+
"All steps must have a name": "所有步骤都必须有名称",
|
|
164
|
+
"must have an endpoint": "必须指定接口",
|
|
165
|
+
"Step output aliases must be unique": "步骤输出别名必须唯一",
|
|
166
|
+
"Delete this endpoint?": "删除该接口?",
|
|
167
|
+
"Delete this pipeline?": "删除该流水线?",
|
|
168
|
+
"skip on error": "出错时跳过",
|
|
169
|
+
"conditional": "带条件",
|
|
170
|
+
"Invalid JSON": "JSON 无效"
|
|
171
|
+
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { DocumentUnderstandingService } from '../services/DocumentUnderstandingService';
|
|
2
2
|
|
|
3
|
+
// Repository.findOne() resolves to a Sequelize model whose attributes are prototype
|
|
4
|
+
// getters, so `{ ...model }` yields an empty object. Mirror that here so the mock
|
|
5
|
+
// cannot pass code that spreads the model directly.
|
|
6
|
+
function modelLike<T extends object>(attributes: T): T {
|
|
7
|
+
const proto: Record<string, unknown> = { toJSON: () => ({ ...attributes }) };
|
|
8
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
9
|
+
Object.defineProperty(proto, key, { get: () => value, enumerable: true });
|
|
10
|
+
}
|
|
11
|
+
return Object.create(proto) as T;
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
describe('DocumentUnderstandingService configuration exposure', () => {
|
|
4
15
|
const config = {
|
|
5
16
|
id: 1,
|
|
@@ -15,7 +26,7 @@ describe('DocumentUnderstandingService configuration exposure', () => {
|
|
|
15
26
|
|
|
16
27
|
it('does not expose stored secrets to a browser caller', async () => {
|
|
17
28
|
const db = {
|
|
18
|
-
getRepository: () => ({ findOne: vi.fn().mockResolvedValue(config) }),
|
|
29
|
+
getRepository: () => ({ findOne: vi.fn().mockResolvedValue(modelLike(config)) }),
|
|
19
30
|
};
|
|
20
31
|
const service = new DocumentUnderstandingService({ logger: {} } as never, db as never);
|
|
21
32
|
|
|
@@ -36,7 +47,7 @@ describe('DocumentUnderstandingService configuration exposure', () => {
|
|
|
36
47
|
it('keeps existing secrets when an update omits them', async () => {
|
|
37
48
|
const update = vi.fn().mockResolvedValue(undefined);
|
|
38
49
|
const db = {
|
|
39
|
-
getRepository: () => ({ findOne: vi.fn().mockResolvedValue(config), update }),
|
|
50
|
+
getRepository: () => ({ findOne: vi.fn().mockResolvedValue(modelLike(config)), update }),
|
|
40
51
|
};
|
|
41
52
|
const service = new DocumentUnderstandingService({ logger: {} } as never, db as never);
|
|
42
53
|
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { mkdirSync, rmSync, writeFileSync } from 'fs';
|
|
2
|
-
import { resolve } from 'path';
|
|
3
|
-
import axios from 'axios';
|
|
4
|
-
import { AsyncJobManager } from '../services/AsyncJobManager';
|
|
5
|
-
import { ExternalApiClient } from '../services/ExternalApiClient';
|
|
6
|
-
import { PipelineExecutor, resolveUploadFilePath } from '../services/PipelineExecutor';
|
|
7
|
-
|
|
8
|
-
describe('PipelineExecutor upload path resolution', () => {
|
|
9
|
-
const uploadsRoot = resolve(process.cwd(), 'storage', 'uploads');
|
|
10
|
-
const samplePath = resolve(uploadsRoot, 'du-test', 'sample.txt');
|
|
11
|
-
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
mkdirSync(resolve(uploadsRoot, 'du-test'), { recursive: true });
|
|
14
|
-
writeFileSync(samplePath, 'sample');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
afterEach(() => {
|
|
18
|
-
rmSync(resolve(uploadsRoot, 'du-test'), { recursive: true, force: true });
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('resolves upload-relative paths inside the upload root', () => {
|
|
22
|
-
expect(resolveUploadFilePath('uploads/du-test/sample.txt')).toBe(samplePath);
|
|
23
|
-
expect(resolveUploadFilePath('/uploads/du-test/sample.txt')).toBe(samplePath);
|
|
24
|
-
expect(resolveUploadFilePath('storage/uploads/du-test/sample.txt')).toBe(samplePath);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('rejects traversal and absolute filesystem paths', () => {
|
|
28
|
-
expect(resolveUploadFilePath('uploads/../package.json')).toBeNull();
|
|
29
|
-
expect(resolveUploadFilePath('storage/uploads/../../package.json')).toBeNull();
|
|
30
|
-
expect(resolveUploadFilePath(resolve(process.cwd(), 'package.json'))).toBeNull();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('maps upload URLs by pathname only', () => {
|
|
34
|
-
expect(resolveUploadFilePath('https://example.com/uploads/du-test/sample.txt?token=secret')).toBe(samplePath);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('does not resolve arbitrary remote URLs as upload files', () => {
|
|
38
|
-
expect(resolveUploadFilePath('https://evil.example/private.pdf')).toBeNull();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('PipelineExecutor remote file handling', () => {
|
|
43
|
-
it('does not fetch arbitrary remote URLs', async () => {
|
|
44
|
-
const getSpy = vi.spyOn(axios, 'get');
|
|
45
|
-
const executor = new PipelineExecutor(
|
|
46
|
-
{ getRepository: vi.fn() } as never,
|
|
47
|
-
{} as ExternalApiClient,
|
|
48
|
-
{} as AsyncJobManager,
|
|
49
|
-
{ error: vi.fn(), warn: vi.fn() },
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
await expect((executor as any).resolveFile('https://evil.example/private.pdf')).resolves.toBeNull();
|
|
53
|
-
expect(getSpy).not.toHaveBeenCalled();
|
|
54
|
-
});
|
|
55
|
-
});
|
|
1
|
+
import { mkdirSync, rmSync, writeFileSync } from 'fs';
|
|
2
|
+
import { resolve } from 'path';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import { AsyncJobManager } from '../services/AsyncJobManager';
|
|
5
|
+
import { ExternalApiClient } from '../services/ExternalApiClient';
|
|
6
|
+
import { PipelineExecutor, resolveUploadFilePath } from '../services/PipelineExecutor';
|
|
7
|
+
|
|
8
|
+
describe('PipelineExecutor upload path resolution', () => {
|
|
9
|
+
const uploadsRoot = resolve(process.cwd(), 'storage', 'uploads');
|
|
10
|
+
const samplePath = resolve(uploadsRoot, 'du-test', 'sample.txt');
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
mkdirSync(resolve(uploadsRoot, 'du-test'), { recursive: true });
|
|
14
|
+
writeFileSync(samplePath, 'sample');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
rmSync(resolve(uploadsRoot, 'du-test'), { recursive: true, force: true });
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('resolves upload-relative paths inside the upload root', () => {
|
|
22
|
+
expect(resolveUploadFilePath('uploads/du-test/sample.txt')).toBe(samplePath);
|
|
23
|
+
expect(resolveUploadFilePath('/uploads/du-test/sample.txt')).toBe(samplePath);
|
|
24
|
+
expect(resolveUploadFilePath('storage/uploads/du-test/sample.txt')).toBe(samplePath);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('rejects traversal and absolute filesystem paths', () => {
|
|
28
|
+
expect(resolveUploadFilePath('uploads/../package.json')).toBeNull();
|
|
29
|
+
expect(resolveUploadFilePath('storage/uploads/../../package.json')).toBeNull();
|
|
30
|
+
expect(resolveUploadFilePath(resolve(process.cwd(), 'package.json'))).toBeNull();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('maps upload URLs by pathname only', () => {
|
|
34
|
+
expect(resolveUploadFilePath('https://example.com/uploads/du-test/sample.txt?token=secret')).toBe(samplePath);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('does not resolve arbitrary remote URLs as upload files', () => {
|
|
38
|
+
expect(resolveUploadFilePath('https://evil.example/private.pdf')).toBeNull();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('PipelineExecutor remote file handling', () => {
|
|
43
|
+
it('does not fetch arbitrary remote URLs', async () => {
|
|
44
|
+
const getSpy = vi.spyOn(axios, 'get');
|
|
45
|
+
const executor = new PipelineExecutor(
|
|
46
|
+
{ getRepository: vi.fn() } as never,
|
|
47
|
+
{} as ExternalApiClient,
|
|
48
|
+
{} as AsyncJobManager,
|
|
49
|
+
{ error: vi.fn(), warn: vi.fn() },
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
await expect((executor as any).resolveFile('https://evil.example/private.pdf')).resolves.toBeNull();
|
|
53
|
+
expect(getSpy).not.toHaveBeenCalled();
|
|
54
|
+
});
|
|
55
|
+
});
|