plugin-document-understanding 1.0.0
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/README.md +366 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/components/EndpointsTab.d.ts +2 -0
- package/dist/client/components/JobsTab.d.ts +2 -0
- package/dist/client/components/PipelinesTab.d.ts +2 -0
- package/dist/client/components/PluginSettings.d.ts +2 -0
- package/dist/client/components/ServiceConfigTab.d.ts +2 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/locale.d.ts +10 -0
- package/dist/client/models/index.d.ts +11 -0
- package/dist/client/plugin.d.ts +5 -0
- package/dist/externalVersion.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +121 -0
- package/dist/locale/vi-VN.json +121 -0
- package/dist/locale/zh-CN.json +1 -0
- package/dist/server/actions.d.ts +16 -0
- package/dist/server/actions.js +109 -0
- package/dist/server/collections/config.d.ts +2 -0
- package/dist/server/collections/config.js +39 -0
- package/dist/server/collections/endpoints.d.ts +2 -0
- package/dist/server/collections/endpoints.js +47 -0
- package/dist/server/collections/jobs.d.ts +2 -0
- package/dist/server/collections/jobs.js +49 -0
- package/dist/server/collections/pipeline-steps.d.ts +2 -0
- package/dist/server/collections/pipeline-steps.js +47 -0
- package/dist/server/collections/pipelines.d.ts +2 -0
- package/dist/server/collections/pipelines.js +39 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/plugin.d.ts +15 -0
- package/dist/server/plugin.js +102 -0
- package/dist/server/services/AsyncJobManager.d.ts +23 -0
- package/dist/server/services/AsyncJobManager.js +117 -0
- package/dist/server/services/DocumentUnderstandingService.d.ts +32 -0
- package/dist/server/services/DocumentUnderstandingService.js +189 -0
- package/dist/server/services/ExternalApiClient.d.ts +26 -0
- package/dist/server/services/ExternalApiClient.js +128 -0
- package/dist/server/services/PipelineExecutor.d.ts +23 -0
- package/dist/server/services/PipelineExecutor.js +252 -0
- package/dist/server/tools/document-understanding-tool.d.ts +8 -0
- package/dist/server/tools/document-understanding-tool.js +105 -0
- package/dist/server/types.d.ts +68 -0
- package/dist/server/types.js +15 -0
- package/package.json +16 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Document Understanding": "Document Understanding",
|
|
3
|
+
"Document Understanding - Pipeline Orchestrator": "Document Understanding - Pipeline Orchestrator",
|
|
4
|
+
"Service Connection": "Service Connection",
|
|
5
|
+
"Service Config": "Service Config",
|
|
6
|
+
"Endpoints": "Endpoints",
|
|
7
|
+
"Pipelines": "Pipelines",
|
|
8
|
+
"Jobs history": "Jobs history",
|
|
9
|
+
"Base URL": "Base URL",
|
|
10
|
+
"Authentication Type": "Authentication Type",
|
|
11
|
+
"Auth Type": "Auth Type",
|
|
12
|
+
"None": "None",
|
|
13
|
+
"API Key": "API Key",
|
|
14
|
+
"Bearer Token": "Bearer Token",
|
|
15
|
+
"Custom Header": "Custom Header",
|
|
16
|
+
"Custom Header Name": "Custom Header Name",
|
|
17
|
+
"API Key / Token": "API Key / Token",
|
|
18
|
+
"Request Timeout (ms)": "Request Timeout (ms)",
|
|
19
|
+
"Default Retries": "Default Retries",
|
|
20
|
+
"Poll Interval (ms)": "Poll Interval (ms)",
|
|
21
|
+
"Poll Timeout (ms)": "Poll Timeout (ms)",
|
|
22
|
+
"Webhook Secret": "Webhook Secret",
|
|
23
|
+
"Save Configuration": "Save Configuration",
|
|
24
|
+
"Configuration saved successfully": "Configuration saved successfully",
|
|
25
|
+
"Failed to save config": "Failed to save config",
|
|
26
|
+
"Add Endpoint": "Add Endpoint",
|
|
27
|
+
"Edit Endpoint": "Edit Endpoint",
|
|
28
|
+
"Basic": "Basic",
|
|
29
|
+
"File Input": "File Input",
|
|
30
|
+
"Async Config": "Async Config",
|
|
31
|
+
"Schema": "Schema",
|
|
32
|
+
"Custom Headers": "Custom Headers",
|
|
33
|
+
"Unique Name": "Unique Name",
|
|
34
|
+
"Subpath": "Subpath",
|
|
35
|
+
"HTTP Method": "HTTP Method",
|
|
36
|
+
"Execution Mode": "Execution Mode",
|
|
37
|
+
"Synchronous": "Synchronous",
|
|
38
|
+
"Polling": "Polling",
|
|
39
|
+
"Webhook": "Webhook",
|
|
40
|
+
"File Input Mode": "File Input Mode",
|
|
41
|
+
"Multipart Upload": "Multipart Upload",
|
|
42
|
+
"Base64 in JSON": "Base64 in JSON",
|
|
43
|
+
"Max Files": "Max Files",
|
|
44
|
+
"Task ID Field": "Task ID Field",
|
|
45
|
+
"Poll Result Subpath": "Poll Result Subpath",
|
|
46
|
+
"Result Field": "Result Field",
|
|
47
|
+
"Status Field": "Status Field",
|
|
48
|
+
"Completed Value": "Completed Value",
|
|
49
|
+
"Poll Task ID Field": "Poll Task ID Field",
|
|
50
|
+
"Poll Result Field": "Poll Result Field",
|
|
51
|
+
"Poll Status Field": "Poll Status Field",
|
|
52
|
+
"Poll Completed Value": "Poll Completed Value",
|
|
53
|
+
"Request Body Schema (JSON Schema)": "Request Body Schema (JSON Schema)",
|
|
54
|
+
"Response Schema (JSON Schema)": "Response Schema (JSON Schema)",
|
|
55
|
+
"Additional Headers": "Additional Headers",
|
|
56
|
+
"Add Header": "Add Header",
|
|
57
|
+
"Enabled": "Enabled",
|
|
58
|
+
"Action": "Action",
|
|
59
|
+
"Edit": "Edit",
|
|
60
|
+
"Delete": "Delete",
|
|
61
|
+
"Deleted": "Deleted",
|
|
62
|
+
"Saved": "Saved",
|
|
63
|
+
"Add Pipeline": "Add Pipeline",
|
|
64
|
+
"Edit Pipeline": "Edit Pipeline",
|
|
65
|
+
"New Pipeline": "New Pipeline",
|
|
66
|
+
"Pipeline Name": "Pipeline Name",
|
|
67
|
+
"Description": "Description",
|
|
68
|
+
"Pipeline Steps": "Pipeline Steps",
|
|
69
|
+
"Add Step": "Add Step",
|
|
70
|
+
"Add First Step": "Add First Step",
|
|
71
|
+
"No steps yet": "No steps yet",
|
|
72
|
+
"Step Name": "Step Name",
|
|
73
|
+
"Endpoint": "Endpoint",
|
|
74
|
+
"Output Alias": "Output Alias",
|
|
75
|
+
"On Error": "On Error",
|
|
76
|
+
"Fail": "Fail",
|
|
77
|
+
"Skip": "Skip",
|
|
78
|
+
"Retry": "Retry",
|
|
79
|
+
"Input Mapping (JSON)": "Input Mapping (JSON)",
|
|
80
|
+
"Condition (optional JSON)": "Condition (optional JSON)",
|
|
81
|
+
"Input Schema (JSON Schema)": "Input Schema (JSON Schema)",
|
|
82
|
+
"Output Mapping (JSON)": "Output Mapping (JSON)",
|
|
83
|
+
"Advanced: Input Schema & Output Mapping": "Advanced: Input Schema & Output Mapping",
|
|
84
|
+
"AI Tool": "AI Tool",
|
|
85
|
+
"Active": "Active",
|
|
86
|
+
"Inactive": "Inactive",
|
|
87
|
+
"Steps": "Steps",
|
|
88
|
+
"Job Details": "Job Details",
|
|
89
|
+
"Status": "Status",
|
|
90
|
+
"Current Step": "Current Step",
|
|
91
|
+
"Started": "Started",
|
|
92
|
+
"Completed": "Completed",
|
|
93
|
+
"Error": "Error",
|
|
94
|
+
"Input": "Input",
|
|
95
|
+
"Step Results": "Step Results",
|
|
96
|
+
"Final Result": "Final Result",
|
|
97
|
+
"External Task IDs": "External Task IDs",
|
|
98
|
+
"View": "View",
|
|
99
|
+
"Refresh": "Refresh",
|
|
100
|
+
"Filter by status": "Filter by status",
|
|
101
|
+
"Filter by pipeline": "Filter by pipeline",
|
|
102
|
+
"Pipeline": "Pipeline",
|
|
103
|
+
"ID": "ID",
|
|
104
|
+
"Name": "Name",
|
|
105
|
+
"Method": "Method",
|
|
106
|
+
"Execution": "Execution",
|
|
107
|
+
"File": "File",
|
|
108
|
+
"Done": "Done",
|
|
109
|
+
"Pending": "Pending",
|
|
110
|
+
"Running": "Running",
|
|
111
|
+
"Failed": "Failed",
|
|
112
|
+
"Timeout": "Timeout",
|
|
113
|
+
"All steps must have a name": "All steps must have a name",
|
|
114
|
+
"Step output aliases must be unique": "Step output aliases must be unique",
|
|
115
|
+
"Delete this endpoint?": "Delete this endpoint?",
|
|
116
|
+
"Delete this pipeline?": "Delete this pipeline?",
|
|
117
|
+
"Remove step?": "Remove step?",
|
|
118
|
+
"skip on error": "skip on error",
|
|
119
|
+
"conditional": "conditional",
|
|
120
|
+
"Invalid JSON": "Invalid JSON"
|
|
121
|
+
}
|
|
@@ -0,0 +1,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
|
+
"Base URL": "URL gốc",
|
|
10
|
+
"Authentication Type": "Loại xác thực",
|
|
11
|
+
"Auth Type": "Loại xác thực",
|
|
12
|
+
"None": "Không",
|
|
13
|
+
"API Key": "Khóa API",
|
|
14
|
+
"Bearer Token": "Token Bearer",
|
|
15
|
+
"Custom Header": "Header tùy chỉnh",
|
|
16
|
+
"Custom Header Name": "Tên Header tùy chỉnh",
|
|
17
|
+
"API Key / Token": "Khóa API / Token",
|
|
18
|
+
"Request Timeout (ms)": "Timeout request (ms)",
|
|
19
|
+
"Default Retries": "Số lần thử lại mặc định",
|
|
20
|
+
"Poll Interval (ms)": "Khoảng thời gian poll (ms)",
|
|
21
|
+
"Poll Timeout (ms)": "Timeout poll (ms)",
|
|
22
|
+
"Webhook Secret": "Mã bí mật Webhook",
|
|
23
|
+
"Save Configuration": "Lưu cấu hình",
|
|
24
|
+
"Configuration saved successfully": "Đã lưu cấu hình thành công",
|
|
25
|
+
"Failed to save config": "Lưu cấu hình thất bại",
|
|
26
|
+
"Add Endpoint": "Thêm Endpoint",
|
|
27
|
+
"Edit Endpoint": "Sửa Endpoint",
|
|
28
|
+
"Basic": "Cơ bản",
|
|
29
|
+
"File Input": "File đầu vào",
|
|
30
|
+
"Async Config": "Cấu hình bất đồng bộ",
|
|
31
|
+
"Schema": "Schema",
|
|
32
|
+
"Custom Headers": "Headers tùy chỉnh",
|
|
33
|
+
"Unique Name": "Tên duy nhất",
|
|
34
|
+
"Subpath": "Đường dẫn con",
|
|
35
|
+
"HTTP Method": "Phương thức HTTP",
|
|
36
|
+
"Execution Mode": "Chế độ thực thi",
|
|
37
|
+
"Synchronous": "Đồng bộ",
|
|
38
|
+
"Polling": "Polling",
|
|
39
|
+
"Webhook": "Webhook",
|
|
40
|
+
"File Input Mode": "Chế độ nhập file",
|
|
41
|
+
"Multipart Upload": "Upload Multipart",
|
|
42
|
+
"Base64 in JSON": "Base64 trong JSON",
|
|
43
|
+
"Max Files": "Số file tối đa",
|
|
44
|
+
"Task ID Field": "Trường Task ID",
|
|
45
|
+
"Poll Result Subpath": "Đường dẫn poll kết quả",
|
|
46
|
+
"Result Field": "Trường kết quả",
|
|
47
|
+
"Status Field": "Trường trạng thái",
|
|
48
|
+
"Completed Value": "Giá trị hoàn thành",
|
|
49
|
+
"Poll Task ID Field": "Trường Task ID khi poll",
|
|
50
|
+
"Poll Result Field": "Trường kết quả khi poll",
|
|
51
|
+
"Poll Status Field": "Trường trạng thái khi poll",
|
|
52
|
+
"Poll Completed Value": "Giá trị hoàn thành khi poll",
|
|
53
|
+
"Request Body Schema (JSON Schema)": "Schema body request (JSON Schema)",
|
|
54
|
+
"Response Schema (JSON Schema)": "Schema response (JSON Schema)",
|
|
55
|
+
"Additional Headers": "Headers bổ sung",
|
|
56
|
+
"Add Header": "Thêm Header",
|
|
57
|
+
"Enabled": "Bật",
|
|
58
|
+
"Action": "Hành động",
|
|
59
|
+
"Edit": "Sửa",
|
|
60
|
+
"Delete": "Xóa",
|
|
61
|
+
"Deleted": "Đã xóa",
|
|
62
|
+
"Saved": "Đã lưu",
|
|
63
|
+
"Add Pipeline": "Thêm Pipeline",
|
|
64
|
+
"Edit Pipeline": "Sửa Pipeline",
|
|
65
|
+
"New Pipeline": "Pipeline mới",
|
|
66
|
+
"Pipeline Name": "Tên Pipeline",
|
|
67
|
+
"Description": "Mô tả",
|
|
68
|
+
"Pipeline Steps": "Các bước Pipeline",
|
|
69
|
+
"Add Step": "Thêm bước",
|
|
70
|
+
"Add First Step": "Thêm bước đầu tiên",
|
|
71
|
+
"No steps yet": "Chưa có bước nào",
|
|
72
|
+
"Step Name": "Tên bước",
|
|
73
|
+
"Endpoint": "Endpoint",
|
|
74
|
+
"Output Alias": "Alias đầu ra",
|
|
75
|
+
"On Error": "Khi lỗi",
|
|
76
|
+
"Fail": "Dừng",
|
|
77
|
+
"Skip": "Bỏ qua",
|
|
78
|
+
"Retry": "Thử lại",
|
|
79
|
+
"Input Mapping (JSON)": "Ánh xạ đầu vào (JSON)",
|
|
80
|
+
"Condition (optional JSON)": "Điều kiện (JSON, tùy chọn)",
|
|
81
|
+
"Input Schema (JSON Schema)": "Schema đầu vào (JSON Schema)",
|
|
82
|
+
"Output Mapping (JSON)": "Ánh xạ đầu ra (JSON)",
|
|
83
|
+
"Advanced: Input Schema & Output Mapping": "Nâng cao: Schema đầu vào & Ánh xạ đầu ra",
|
|
84
|
+
"AI Tool": "Công cụ AI",
|
|
85
|
+
"Active": "Đang hoạt động",
|
|
86
|
+
"Inactive": "Không hoạt động",
|
|
87
|
+
"Steps": "Các bước",
|
|
88
|
+
"Job Details": "Chi tiết công việc",
|
|
89
|
+
"Status": "Trạng thái",
|
|
90
|
+
"Current Step": "Bước hiện tại",
|
|
91
|
+
"Started": "Bắt đầu",
|
|
92
|
+
"Completed": "Hoàn thành",
|
|
93
|
+
"Error": "Lỗi",
|
|
94
|
+
"Input": "Dữ liệu đầu vào",
|
|
95
|
+
"Step Results": "Kết quả từng bước",
|
|
96
|
+
"Final Result": "Kết quả cuối cùng",
|
|
97
|
+
"External Task IDs": "ID tác vụ ngoài",
|
|
98
|
+
"View": "Xem",
|
|
99
|
+
"Refresh": "Làm mới",
|
|
100
|
+
"Filter by status": "Lọc theo trạng thái",
|
|
101
|
+
"Filter by pipeline": "Lọc theo pipeline",
|
|
102
|
+
"Pipeline": "Pipeline",
|
|
103
|
+
"ID": "ID",
|
|
104
|
+
"Name": "Tên",
|
|
105
|
+
"Method": "Phương thức",
|
|
106
|
+
"Execution": "Thực thi",
|
|
107
|
+
"File": "File",
|
|
108
|
+
"Done": "Xong",
|
|
109
|
+
"Pending": "Đang chờ",
|
|
110
|
+
"Running": "Đang chạy",
|
|
111
|
+
"Failed": "Thất bại",
|
|
112
|
+
"Timeout": "Hết thời gian",
|
|
113
|
+
"All steps must have a name": "Tất cả các bước phải có tên",
|
|
114
|
+
"Step output aliases must be unique": "Alias đầu ra của các bước phải khác nhau",
|
|
115
|
+
"Delete this endpoint?": "Xóa endpoint này?",
|
|
116
|
+
"Delete this pipeline?": "Xóa pipeline này?",
|
|
117
|
+
"Remove step?": "Xóa bước này?",
|
|
118
|
+
"skip on error": "bỏ qua khi lỗi",
|
|
119
|
+
"conditional": "có điều kiện",
|
|
120
|
+
"Invalid JSON": "JSON không hợp lệ"
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const defineActions: (plugin: any) => {
|
|
2
|
+
getConfig(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
3
|
+
updateConfig(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
4
|
+
listEndpoints(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
5
|
+
createEndpoint(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
6
|
+
updateEndpoint(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
7
|
+
deleteEndpoint(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
8
|
+
listPipelines(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
9
|
+
createPipeline(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
10
|
+
updatePipeline(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
11
|
+
deletePipeline(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
12
|
+
executePipeline(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
13
|
+
getJobStatus(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
14
|
+
listJobs(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
15
|
+
webhookCallback(ctx: Context, next: () => Promise<any>): Promise<void>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var actions_exports = {};
|
|
19
|
+
__export(actions_exports, {
|
|
20
|
+
defineActions: () => defineActions
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(actions_exports);
|
|
23
|
+
const defineActions = (plugin) => {
|
|
24
|
+
const service = plugin.service;
|
|
25
|
+
return {
|
|
26
|
+
async getConfig(ctx, next) {
|
|
27
|
+
ctx.body = await service.getConfig();
|
|
28
|
+
await next();
|
|
29
|
+
},
|
|
30
|
+
async updateConfig(ctx, next) {
|
|
31
|
+
const { values } = ctx.action.params;
|
|
32
|
+
await service.updateConfig(values);
|
|
33
|
+
ctx.body = await service.getConfig();
|
|
34
|
+
await next();
|
|
35
|
+
},
|
|
36
|
+
async listEndpoints(ctx, next) {
|
|
37
|
+
ctx.body = await service.listEndpoints();
|
|
38
|
+
await next();
|
|
39
|
+
},
|
|
40
|
+
async createEndpoint(ctx, next) {
|
|
41
|
+
const { values } = ctx.action.params;
|
|
42
|
+
ctx.body = await service.createEndpoint(values);
|
|
43
|
+
await next();
|
|
44
|
+
},
|
|
45
|
+
async updateEndpoint(ctx, next) {
|
|
46
|
+
const { filterByTk, values } = ctx.action.params;
|
|
47
|
+
await service.updateEndpoint(Number(filterByTk), values);
|
|
48
|
+
ctx.body = { message: "ok" };
|
|
49
|
+
await next();
|
|
50
|
+
},
|
|
51
|
+
async deleteEndpoint(ctx, next) {
|
|
52
|
+
const { filterByTk } = ctx.action.params;
|
|
53
|
+
await service.deleteEndpoint(Number(filterByTk));
|
|
54
|
+
ctx.body = { message: "ok" };
|
|
55
|
+
await next();
|
|
56
|
+
},
|
|
57
|
+
async listPipelines(ctx, next) {
|
|
58
|
+
ctx.body = await service.listPipelines();
|
|
59
|
+
await next();
|
|
60
|
+
},
|
|
61
|
+
async createPipeline(ctx, next) {
|
|
62
|
+
const { values } = ctx.action.params;
|
|
63
|
+
ctx.body = await service.createPipeline(values);
|
|
64
|
+
await next();
|
|
65
|
+
},
|
|
66
|
+
async updatePipeline(ctx, next) {
|
|
67
|
+
const { filterByTk, values } = ctx.action.params;
|
|
68
|
+
await service.updatePipeline(Number(filterByTk), values);
|
|
69
|
+
ctx.body = { message: "ok" };
|
|
70
|
+
await next();
|
|
71
|
+
},
|
|
72
|
+
async deletePipeline(ctx, next) {
|
|
73
|
+
const { filterByTk } = ctx.action.params;
|
|
74
|
+
await service.deletePipeline(Number(filterByTk));
|
|
75
|
+
ctx.body = { message: "ok" };
|
|
76
|
+
await next();
|
|
77
|
+
},
|
|
78
|
+
async executePipeline(ctx, next) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
const { values } = ctx.action.params;
|
|
81
|
+
const pipelineId = values == null ? void 0 : values.pipelineId;
|
|
82
|
+
const input = (values == null ? void 0 : values.input) || {};
|
|
83
|
+
const userId = (_b = (_a = ctx.state) == null ? void 0 : _a.currentUser) == null ? void 0 : _b.id;
|
|
84
|
+
ctx.body = await service.executePipeline(pipelineId, input, [], userId);
|
|
85
|
+
await next();
|
|
86
|
+
},
|
|
87
|
+
async getJobStatus(ctx, next) {
|
|
88
|
+
const { filterByTk } = ctx.action.params;
|
|
89
|
+
ctx.body = await service.getJobStatus(Number(filterByTk));
|
|
90
|
+
await next();
|
|
91
|
+
},
|
|
92
|
+
async listJobs(ctx, next) {
|
|
93
|
+
const { filter } = ctx.action.params;
|
|
94
|
+
ctx.body = await service.listJobs(filter);
|
|
95
|
+
await next();
|
|
96
|
+
},
|
|
97
|
+
async webhookCallback(ctx, next) {
|
|
98
|
+
const signature = ctx.request.headers["x-webhook-signature"];
|
|
99
|
+
const { values } = ctx.action.params;
|
|
100
|
+
await service.handleWebhook(values || ctx.request.body, signature);
|
|
101
|
+
ctx.body = { received: true };
|
|
102
|
+
await next();
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
107
|
+
0 && (module.exports = {
|
|
108
|
+
defineActions
|
|
109
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var config_exports = {};
|
|
19
|
+
__export(config_exports, {
|
|
20
|
+
default: () => config_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(config_exports);
|
|
23
|
+
var config_default = {
|
|
24
|
+
name: "doc_understanding_config",
|
|
25
|
+
title: "Document Understanding Config",
|
|
26
|
+
// Model name can be explicitly generated by NocoBase, but we define collection fields.
|
|
27
|
+
fields: [
|
|
28
|
+
{ type: "string", name: "baseUrl", length: 500 },
|
|
29
|
+
{ type: "string", name: "authType", length: 20 },
|
|
30
|
+
// 'api_key' | 'bearer' | 'custom_header' | 'none'
|
|
31
|
+
{ type: "string", name: "authKey", length: 500 },
|
|
32
|
+
{ type: "string", name: "authHeaderName", length: 100 },
|
|
33
|
+
{ type: "integer", name: "defaultTimeout", defaultValue: 3e4 },
|
|
34
|
+
{ type: "integer", name: "defaultRetries", defaultValue: 2 },
|
|
35
|
+
{ type: "integer", name: "pollInterval", defaultValue: 5e3 },
|
|
36
|
+
{ type: "integer", name: "pollTimeout", defaultValue: 3e5 },
|
|
37
|
+
{ type: "string", name: "webhookSecret", length: 500 }
|
|
38
|
+
]
|
|
39
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var endpoints_exports = {};
|
|
19
|
+
__export(endpoints_exports, {
|
|
20
|
+
default: () => endpoints_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(endpoints_exports);
|
|
23
|
+
var endpoints_default = {
|
|
24
|
+
name: "doc_understanding_endpoints",
|
|
25
|
+
title: "Document Endpoints",
|
|
26
|
+
fields: [
|
|
27
|
+
{ type: "string", name: "name", unique: true, length: 100 },
|
|
28
|
+
{ type: "string", name: "subpath", length: 500 },
|
|
29
|
+
{ type: "string", name: "method", length: 10 },
|
|
30
|
+
{ type: "text", name: "description" },
|
|
31
|
+
{ type: "json", name: "requestBodySchema" },
|
|
32
|
+
{ type: "json", name: "responseSchema" },
|
|
33
|
+
{ type: "string", name: "fileInputMode", length: 20 },
|
|
34
|
+
{ type: "integer", name: "maxFiles", defaultValue: 1 },
|
|
35
|
+
{ type: "string", name: "executionMode", length: 20 },
|
|
36
|
+
{ type: "string", name: "pollResultSubpath", length: 500 },
|
|
37
|
+
{ type: "string", name: "pollTaskIdField", length: 100, defaultValue: "task_id" },
|
|
38
|
+
{ type: "string", name: "pollResultField", length: 100 },
|
|
39
|
+
{ type: "integer", name: "pollInterval" },
|
|
40
|
+
{ type: "integer", name: "pollTimeout" },
|
|
41
|
+
{ type: "string", name: "pollStatusField", length: 100 },
|
|
42
|
+
{ type: "string", name: "pollCompletedValue", length: 100, defaultValue: "completed" },
|
|
43
|
+
{ type: "json", name: "customHeaders" },
|
|
44
|
+
{ type: "boolean", name: "enabled", defaultValue: true },
|
|
45
|
+
{ type: "sort", name: "sortOrder" }
|
|
46
|
+
]
|
|
47
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var jobs_exports = {};
|
|
19
|
+
__export(jobs_exports, {
|
|
20
|
+
default: () => jobs_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(jobs_exports);
|
|
23
|
+
var jobs_default = {
|
|
24
|
+
name: "doc_understanding_jobs",
|
|
25
|
+
title: "Document Pipeline Jobs",
|
|
26
|
+
fields: [
|
|
27
|
+
{
|
|
28
|
+
type: "belongsTo",
|
|
29
|
+
name: "pipeline",
|
|
30
|
+
target: "doc_understanding_pipelines",
|
|
31
|
+
foreignKey: "pipelineId"
|
|
32
|
+
},
|
|
33
|
+
{ type: "string", name: "status", length: 20, defaultValue: "pending" },
|
|
34
|
+
{ type: "json", name: "input" },
|
|
35
|
+
{ type: "integer", name: "currentStep" },
|
|
36
|
+
{ type: "json", name: "stepResults" },
|
|
37
|
+
{ type: "json", name: "finalResult" },
|
|
38
|
+
{ type: "text", name: "error" },
|
|
39
|
+
{ type: "json", name: "externalTaskIds" },
|
|
40
|
+
{ type: "date", name: "startedAt" },
|
|
41
|
+
{ type: "date", name: "completedAt" },
|
|
42
|
+
{
|
|
43
|
+
type: "belongsTo",
|
|
44
|
+
name: "createdBy",
|
|
45
|
+
target: "users",
|
|
46
|
+
foreignKey: "createdById"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var pipeline_steps_exports = {};
|
|
19
|
+
__export(pipeline_steps_exports, {
|
|
20
|
+
default: () => pipeline_steps_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pipeline_steps_exports);
|
|
23
|
+
var pipeline_steps_default = {
|
|
24
|
+
name: "doc_understanding_pipeline_steps",
|
|
25
|
+
title: "Pipeline Steps",
|
|
26
|
+
fields: [
|
|
27
|
+
{
|
|
28
|
+
type: "belongsTo",
|
|
29
|
+
name: "pipeline",
|
|
30
|
+
target: "doc_understanding_pipelines",
|
|
31
|
+
foreignKey: "pipelineId"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "belongsTo",
|
|
35
|
+
name: "endpoint",
|
|
36
|
+
target: "doc_understanding_endpoints",
|
|
37
|
+
foreignKey: "endpointId"
|
|
38
|
+
},
|
|
39
|
+
{ type: "integer", name: "stepOrder" },
|
|
40
|
+
{ type: "string", name: "name", length: 100 },
|
|
41
|
+
{ type: "json", name: "inputMapping" },
|
|
42
|
+
{ type: "string", name: "outputAlias", length: 100 },
|
|
43
|
+
{ type: "json", name: "condition" },
|
|
44
|
+
{ type: "string", name: "onError", length: 20, defaultValue: "fail" },
|
|
45
|
+
{ type: "integer", name: "retryCount", defaultValue: 0 }
|
|
46
|
+
]
|
|
47
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var pipelines_exports = {};
|
|
19
|
+
__export(pipelines_exports, {
|
|
20
|
+
default: () => pipelines_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pipelines_exports);
|
|
23
|
+
var pipelines_default = {
|
|
24
|
+
name: "doc_understanding_pipelines",
|
|
25
|
+
title: "Document Pipelines",
|
|
26
|
+
fields: [
|
|
27
|
+
{ type: "string", name: "name", unique: true, length: 200 },
|
|
28
|
+
{ type: "text", name: "description" },
|
|
29
|
+
{ type: "json", name: "inputSchema" },
|
|
30
|
+
{ type: "json", name: "outputMapping" },
|
|
31
|
+
{ type: "boolean", name: "enabled", defaultValue: true },
|
|
32
|
+
{
|
|
33
|
+
type: "hasMany",
|
|
34
|
+
name: "steps",
|
|
35
|
+
target: "doc_understanding_pipeline_steps",
|
|
36
|
+
foreignKey: "pipelineId"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './plugin';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var server_exports = {};
|
|
29
|
+
__export(server_exports, {
|
|
30
|
+
default: () => import_plugin.default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(server_exports);
|
|
33
|
+
var import_plugin = __toESM(require("./plugin"));
|