plugin-elastic-report 0.7.0 → 0.9.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.
Files changed (70) hide show
  1. package/client-v2.d.ts +2 -2
  2. package/client-v2.js +1 -1
  3. package/client.d.ts +2 -2
  4. package/client.js +1 -1
  5. package/{ai → dist/ai}/skills/elastic-report/SKILLS.md +52 -34
  6. package/dist/client-v2/851.35e416bfb3fb565f.js +10 -0
  7. package/dist/client-v2/877.81b10beb7b7f4bd7.js +10 -0
  8. package/dist/client-v2/index.js +1 -1
  9. package/dist/externalVersion.js +2 -1
  10. package/dist/locale/en-US.json +213 -198
  11. package/dist/locale/vi-VN.json +213 -198
  12. package/dist/locale/zh-CN.json +213 -198
  13. package/dist/node_modules/@elastic/elasticsearch/package.json +1 -1
  14. package/dist/server/mcp/ElasticReportToolCatalog.js +6 -4
  15. package/dist/server/plugin.js +4 -4
  16. package/dist/server/report-block-tools.js +340 -0
  17. package/dist/server/services/ElasticReportService.js +12 -6
  18. package/dist/shared/constants.js +9 -0
  19. package/package.json +2 -3
  20. package/server.d.ts +2 -2
  21. package/server.js +1 -1
  22. package/src/ai/skills/elastic-report/SKILLS.md +52 -0
  23. package/src/client/index.tsx +34 -34
  24. package/src/client/workflow-instructions.tsx +44 -44
  25. package/src/client-v2/__tests__/elastic-report.test.tsx +879 -791
  26. package/src/client-v2/__tests__/kql-autocomplete.test.ts +178 -178
  27. package/src/client-v2/api.ts +320 -320
  28. package/src/client-v2/bus/DashboardFilterBus.ts +212 -212
  29. package/src/client-v2/components/ElasticBasicCharts.tsx +652 -652
  30. package/src/client-v2/components/ElasticFilterBar.tsx +372 -372
  31. package/src/client-v2/components/ElasticKqlInput.tsx +421 -421
  32. package/src/client-v2/components/ElasticReportBlock.tsx +306 -306
  33. package/src/client-v2/components/ElasticReportRenderer.tsx +1257 -1257
  34. package/src/client-v2/components/HighlightText.tsx +50 -50
  35. package/src/client-v2/components/ReportSelect.tsx +85 -85
  36. package/src/client-v2/index.tsx +14 -14
  37. package/src/client-v2/locale.ts +23 -23
  38. package/src/client-v2/models/ElasticFilterBarBlockModel.tsx +115 -115
  39. package/src/client-v2/models/ElasticReportBlockModel.tsx +118 -118
  40. package/src/client-v2/pages/ElasticReportManager.tsx +1453 -1453
  41. package/src/client-v2/plugin.tsx +107 -72
  42. package/src/client-v2/report-destination.tsx +126 -0
  43. package/src/client-v2/utils/kqlAutocomplete.ts +861 -861
  44. package/src/client-v2/workflow/instructions.tsx +149 -149
  45. package/src/index.ts +11 -11
  46. package/src/locale/en-US.json +213 -198
  47. package/src/locale/vi-VN.json +213 -198
  48. package/src/locale/zh-CN.json +213 -198
  49. package/src/server/__tests__/ai-blocks.integration.test.ts +292 -0
  50. package/src/server/__tests__/query-compiler.test.ts +620 -620
  51. package/src/server/__tests__/report-mcp-acl.integration.test.ts +645 -645
  52. package/src/server/acl-guard.ts +194 -194
  53. package/src/server/collections/es-report-data-views.ts +64 -64
  54. package/src/server/collections/es-reports.ts +80 -80
  55. package/src/server/index.ts +15 -15
  56. package/src/server/mcp/ElasticReportMcpServer.ts +391 -391
  57. package/src/server/mcp/ElasticReportToolCatalog.ts +667 -663
  58. package/src/server/plugin.ts +599 -599
  59. package/src/server/report-block-tools.ts +400 -0
  60. package/src/server/services/ElasticReportService.ts +494 -486
  61. package/src/server/services/ElasticsearchConnectionService.ts +728 -728
  62. package/src/server/services/ReportExportService.ts +282 -282
  63. package/src/server/services/ReportQueryCompiler.ts +1552 -1552
  64. package/src/server/workflow/ElasticReportQueryInstruction.ts +124 -124
  65. package/src/shared/constants.ts +39 -36
  66. package/src/shared/types.ts +272 -272
  67. package/dist/client-v2/851.142c93fc6d666b28.js +0 -10
  68. package/dist/client-v2/877.f4095a3dbcadf98f.js +0 -10
  69. package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv +0 -15
  70. package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv.cmd +0 -7
@@ -1,198 +1,213 @@
1
- {
2
- "Elastic Report": "Elasticsearch 报表",
3
- "Elastic report settings": "Elasticsearch 报表配置",
4
- "Select report": "选择报表",
5
- "Report": "报表",
6
- "Show interactive toolbar": "显示交互式检索工具栏",
7
- "Compact layout": "紧凑布局",
8
- "Reports": "报表管理",
9
- "Data Views": "数据视图 (Data Views)",
10
- "MCP & AI Employee": "MCP 与 AI 员工",
11
- "New Report": "新建报表",
12
- "Edit Report": "编辑报表",
13
- "New Data View": "新建数据视图",
14
- "Edit Data View": "编辑数据视图",
15
- "Title": "标题",
16
- "Description": "描述",
17
- "Data Source (Elasticsearch)": "数据源 (Elasticsearch)",
18
- "Index Pattern": "索引模式 (Index Pattern)",
19
- "Time Field": "时间字段",
20
- "Browse Indices": "查看匹配索引",
21
- "Matching Indices": "匹配的索引",
22
- "Fields": "字段数",
23
- "Refresh Fields": "刷新字段元数据",
24
- "Visualization": "可视化类型",
25
- "Table (Discover)": "数据表 (Discover)",
26
- "Bar Chart": "柱状图",
27
- "Line Chart": "折线图",
28
- "Area Chart": "面积图",
29
- "Pie Chart": "饼图",
30
- "Metric KPI": "指标卡 (KPI)",
31
- "Data View": "数据视图",
32
- "Published": "已发布",
33
- "Draft": "草稿",
34
- "Allow interactive search/filter on block": "允许在区块中交互式搜索与筛选",
35
- "Show time histogram above table": "在表格上方显示时间直方图",
36
- "KQL / Search Query": "KQL / 搜索语句",
37
- "Search KQL, e.g. status >= 500 AND service: \"api\"": "输入 KQL,例如 status >= 500 AND service: \"api\"",
38
- "Search": "检索",
39
- "Reset": "重置",
40
- "Refresh": "刷新",
41
- "Inspect DSL": "查看 DSL",
42
- "Elasticsearch Query DSL": "Elasticsearch 查询 DSL",
43
- "Add Filter": "添加筛选",
44
- "Edit Filter": "编辑筛选",
45
- "Field": "字段",
46
- "Operator": "操作符",
47
- "Value": "值",
48
- "To Value": "结束值",
49
- "Apply": "应用",
50
- "Cancel": "取消",
51
- "Save": "保存",
52
- "Delete": "删除",
53
- "Edit": "编辑",
54
- "Preview": "预览",
55
- "Run Preview": "运行预览",
56
- "Sort": "排序",
57
- "Add Sort": "添加排序",
58
- "Ascending": "升序",
59
- "Descending": "降序",
60
- "Columns": "显示列",
61
- "Auto-detect columns from documents": "自动从文档提取列",
62
- "Page Size": "每页条数",
63
- "Bucket Type": "分桶方式",
64
- "Date Histogram": "时间直方图",
65
- "Top Terms": "分组统计 (Terms)",
66
- "Bucket Field": "分组字段",
67
- "Interval": "时间间隔",
68
- "Top N": "前 N 项",
69
- "Metric": "指标聚合",
70
- "Metric Field": "指标字段",
71
- "Metric Label": "指标名称",
72
- "Last 15 minutes": "最近 15 分钟",
73
- "Last 1 hour": "最近 1 小时",
74
- "Last 24 hours": "最近 24 小时",
75
- "Last 7 days": "最近 7 天",
76
- "Last 30 days": "最近 30 天",
77
- "Last 90 days": "最近 90 天",
78
- "All time": "全部时间",
79
- "Custom range": "自定义时间范围",
80
- "From": "开始时间",
81
- "To": "结束时间",
82
- "Allowed Roles": "允许访问的角色",
83
- "Leave empty to allow all authenticated users": "留空则允许所有登录用户查看",
84
- "All roles": "全部角色",
85
- "Locked Security Filters (Server-enforced)": "服务端强制安全筛选 (不可被访客覆盖)",
86
- "Add Locked Filter": "添加强制筛选",
87
- "Locked filter": "强制筛选",
88
- "Partial results warning": "部分分片或超时告警",
89
- "Query timed out; displayed results may be incomplete.": "查询超时,当前展示的数据可能不完整。",
90
- "Failed shards": "失败分片",
91
- "Elastic Filter Bar": "Elasticsearch 仪表盘筛选栏",
92
- "Elastic filter bar settings": "Elasticsearch 筛选栏配置",
93
- "Sync Group": "同步分组 (Sync Group)",
94
- "Subscribe to dashboard filter bar": "联动同页筛选栏",
95
- "Filter Fields (comma-separated, e.g. service, region)": "下拉筛选字段 (逗号分隔,如 service, region)",
96
- "Show global KQL input": "显示全局 KQL 输入框",
97
- "Show global time range": "显示全局时间范围",
98
- "Dashboard filter": "全局筛选",
99
- "Clear dashboard filters": "清空全局筛选",
100
- "Auto refresh": "自动刷新",
101
- "Off": "关闭",
102
- "Fields Explorer": "字段探查",
103
- "Top values": "高频值分布",
104
- "Filter for value": "筛选等于该值 (+)",
105
- "Filter out value": "排除该值 (-)",
106
- "Visible Columns": "显示列调整",
107
- "Move up": "上移",
108
- "Move down": "下移",
109
- "Split Series Field": "二次分组字段 (Split Series)",
110
- "Stack Mode": "堆叠模式",
111
- "Grouped": "并列分组",
112
- "Stacked": "数值堆叠",
113
- "100% Stacked": "百分比堆叠 (100%)",
114
- "Compare previous period": "对比上一周期",
115
- "vs previous period": "较上一周期",
116
- "Field Formats": "字段显示格式",
117
- "Add Field Format": "添加格式规则",
118
- "Format": "格式",
119
- "Auto": "自动",
120
- "Duration (ms)": "耗时 (ms)",
121
- "Bytes": "字节 (Bytes)",
122
- "Percent (%)": "百分比 (%)",
123
- "Number": "千分位数字",
124
- "Status Badge": "状态徽章",
125
- "URL Link": "超链接",
126
- "Record Context Bindings": "当前记录上下文绑定",
127
- "Add Context Binding": "添加上下文绑定",
128
- "Record Field Path": "NocoBase 记录字段路径",
129
- "Allow data export on block": "允许在区块中导出数据",
130
- "Export CSV": "导出 CSV",
131
- "Export NDJSON": "导出 NDJSON",
132
- "Query Elasticsearch Report": "查询 Elasticsearch 报表",
133
- "Execute a Saved Elasticsearch Report and evaluate threshold conditions for scheduled alerts or reports.": "执行已保存的 Elasticsearch 报表并评估阈值条件,用于定时报表或告警工作流。",
134
- "Threshold Metric": "阈值评估指标",
135
- "Threshold Operator": "阈值比较符",
136
- "Threshold Value": "阈值数值",
137
- "Total Hits": "总命中数",
138
- "Metric Value": "聚合指标值",
139
- "Delta (%)": "环比变化 (%)",
140
- "Threshold Breached": "是否触发阈值",
141
- "Top Buckets": "前序分桶结果",
142
- "Sample Rows": "样本记录",
143
- "Executed At": "执行时间",
144
- "Document Details": "文档详情",
145
- "Table View": "字段表格",
146
- "JSON View": "原始 JSON",
147
- "Show data table": "查看数据表",
148
- "Show chart": "查看图表",
149
- "Select a saved Elastic Report in block settings to display data": "请在区块配置中选择已保存的 Elasticsearch 报表",
150
- "No matching documents": "没有匹配的文档",
151
- "Saved successfully": "保存成功",
152
- "Deleted successfully": "删除成功",
153
- "Copied to clipboard": "已复制到剪贴板",
154
- "Copy": "复制",
155
- "Confirm delete?": "确认删除?",
156
- "Hits": "命中数",
157
- "Next cursor page": "下一页 (游标)",
158
- "First page": "返回首页",
159
- "Dedicated MCP Endpoint": "插件专属 MCP 端点",
160
- "MCP Server Name": "MCP 服务名称",
161
- "Exposed MCP Tools": "已暴露的 MCP 工具",
162
- "AI Employee Usage": "AI 员工使用说明",
163
- "This plugin automatically registers the elastic-report MCP server (with user context) and AI Employee tools so AI agents can inspect fields, preview Elasticsearch queries, and publish Saved Reports ready to select in blocks.": "本插件会自动注册携带用户上下文的 elastic-report MCP 服务与 AI 员工工具,支持 AI 自动探查字段、预览 Elasticsearch 查询并发布可在页面区块中直接选用的报表。",
164
- "Type keywords freely or select a field below": "可直接输入关键字,或从下方选择字段引导构建查询",
165
- "Suggested Fields": "推荐字段",
166
- "Comparisons & Operators": "比较与操作符",
167
- "Suggested Values": "推荐字段值",
168
- "Combine Conditions": "组合条件",
169
- "Free-text Search": "全文自由检索",
170
- "Loading field values...": "正在加载字段高频值...",
171
- "Choose comparison (=, >=, <=...)": "选择比较符号 (=, >=, <=...)",
172
- "Filter by field value": "按该字段值筛选",
173
- "Equals (=)": "等于 (=)",
174
- "Equals or contains (: )": "等于或包含 (: )",
175
- "Greater than or equal (>=)": "大于等于 (>=)",
176
- "Less than or equal (<=)": "小于等于 (<=)",
177
- "Greater than (>)": "大于 (>)",
178
- "Less than (<)": "小于 (<)",
179
- "Match multiple values (OR)": "匹配多个值之一 (OR)",
180
- "Has any value (exists)": "字段非空 (exists)",
181
- "Exclude matching records": "排除匹配记录",
182
- "Search text across all fields (Press Enter)": "跨所有字段自由搜索 (按回车)",
183
- "Boolean true": "布尔真 (true)",
184
- "Boolean false": "布尔假 (false)",
185
- "Suggested value from data": "来自 Elasticsearch 的高频值",
186
- "Sample value from loaded rows": "来自当前表格的样本值",
187
- "Finish value group": "结束多值分组",
188
- "Add another value to group": "在分组中追加其他值 (OR)",
189
- "Exclude value in group": "在分组中排除值",
190
- "Combine another condition (both match)": "并且满足下一条件 (AND)",
191
- "Match either condition": "或者满足另一条件 (OR)",
192
- "Exclude next condition": "并且排除下一条件 (AND NOT)",
193
- "Close condition group": "闭合条件括号",
194
- "Test Connection": "测试连接",
195
- "Connection verified": "连接已验证",
196
- "Index-scoped role": "索引级受限权限",
197
- "Configure Elasticsearch 8.x TLS, CA Fingerprint, API Key, or Bearer Token in Data Source Manager": "可在数据源管理中配置 Elasticsearch 8.x 的 TLS、CA 指纹、API 密钥或 Bearer 令牌"
198
- }
1
+ {
2
+ "Add report block": "添加报表区块",
3
+ "Report block destination": "报表区块目标位置",
4
+ "Page and tab": "页面和标签页",
5
+ "Attach destination": "附加目标位置",
6
+ "Select report block destination": "请通过“报表区块目标位置”选择一个页面、标签页和报表。",
7
+ "Inspect selected Elastic Report block": "查看所选 Elastic Report 区块",
8
+ "Configure selected Elastic Report block": "配置所选 Elastic Report 区块",
9
+ "Pick one Elastic Report block": "请使用“选择区块”附加一个 Elastic Report 区块。",
10
+ "Block page unavailable": "当前页面上的所选区块不可用。",
11
+ "Block editing unavailable": "当前角色无法编辑此区块实例。",
12
+ "Invalid block changes": "请提供支持的设置及其原始值。",
13
+ "Report unavailable for this block": "请选择当前角色可访问的已发布报表。",
14
+ "Block settings changed": "区块已更改。请重新读取设置再应用更改。",
15
+ "Published report ready for blocks": "报表已发布,可在区块中选择。",
16
+ "Draft saved in Settings": "草稿已保存至 Elastic Report 设置。",
17
+ "Elastic Report": "Elasticsearch 报表",
18
+ "Elastic report settings": "Elasticsearch 报表配置",
19
+ "Select report": "选择报表",
20
+ "Report": "报表",
21
+ "Show interactive toolbar": "显示交互式检索工具栏",
22
+ "Compact layout": "紧凑布局",
23
+ "Reports": "报表管理",
24
+ "Data Views": "数据视图 (Data Views)",
25
+ "MCP & AI Employee": "MCP 与 AI 员工",
26
+ "New Report": "新建报表",
27
+ "Edit Report": "编辑报表",
28
+ "New Data View": "新建数据视图",
29
+ "Edit Data View": "编辑数据视图",
30
+ "Title": "标题",
31
+ "Description": "描述",
32
+ "Data Source (Elasticsearch)": "数据源 (Elasticsearch)",
33
+ "Index Pattern": "索引模式 (Index Pattern)",
34
+ "Time Field": "时间字段",
35
+ "Browse Indices": "查看匹配索引",
36
+ "Matching Indices": "匹配的索引",
37
+ "Fields": "字段数",
38
+ "Refresh Fields": "刷新字段元数据",
39
+ "Visualization": "可视化类型",
40
+ "Table (Discover)": "数据表 (Discover)",
41
+ "Bar Chart": "柱状图",
42
+ "Line Chart": "折线图",
43
+ "Area Chart": "面积图",
44
+ "Pie Chart": "饼图",
45
+ "Metric KPI": "指标卡 (KPI)",
46
+ "Data View": "数据视图",
47
+ "Published": "已发布",
48
+ "Draft": "草稿",
49
+ "Allow interactive search/filter on block": "允许在区块中交互式搜索与筛选",
50
+ "Show time histogram above table": "在表格上方显示时间直方图",
51
+ "KQL / Search Query": "KQL / 搜索语句",
52
+ "Search KQL, e.g. status >= 500 AND service: \"api\"": "输入 KQL,例如 status >= 500 AND service: \"api\"",
53
+ "Search": "检索",
54
+ "Reset": "重置",
55
+ "Refresh": "刷新",
56
+ "Inspect DSL": "查看 DSL",
57
+ "Elasticsearch Query DSL": "Elasticsearch 查询 DSL",
58
+ "Add Filter": "添加筛选",
59
+ "Edit Filter": "编辑筛选",
60
+ "Field": "字段",
61
+ "Operator": "操作符",
62
+ "Value": "值",
63
+ "To Value": "结束值",
64
+ "Apply": "应用",
65
+ "Cancel": "取消",
66
+ "Save": "保存",
67
+ "Delete": "删除",
68
+ "Edit": "编辑",
69
+ "Preview": "预览",
70
+ "Run Preview": "运行预览",
71
+ "Sort": "排序",
72
+ "Add Sort": "添加排序",
73
+ "Ascending": "升序",
74
+ "Descending": "降序",
75
+ "Columns": "显示列",
76
+ "Auto-detect columns from documents": "自动从文档提取列",
77
+ "Page Size": "每页条数",
78
+ "Bucket Type": "分桶方式",
79
+ "Date Histogram": "时间直方图",
80
+ "Top Terms": "分组统计 (Terms)",
81
+ "Bucket Field": "分组字段",
82
+ "Interval": "时间间隔",
83
+ "Top N": "前 N 项",
84
+ "Metric": "指标聚合",
85
+ "Metric Field": "指标字段",
86
+ "Metric Label": "指标名称",
87
+ "Last 15 minutes": "最近 15 分钟",
88
+ "Last 1 hour": "最近 1 小时",
89
+ "Last 24 hours": "最近 24 小时",
90
+ "Last 7 days": "最近 7 天",
91
+ "Last 30 days": "最近 30 天",
92
+ "Last 90 days": "最近 90 天",
93
+ "All time": "全部时间",
94
+ "Custom range": "自定义时间范围",
95
+ "From": "开始时间",
96
+ "To": "结束时间",
97
+ "Allowed Roles": "允许访问的角色",
98
+ "Leave empty to allow all authenticated users": "留空则允许所有登录用户查看",
99
+ "All roles": "全部角色",
100
+ "Locked Security Filters (Server-enforced)": "服务端强制安全筛选 (不可被访客覆盖)",
101
+ "Add Locked Filter": "添加强制筛选",
102
+ "Locked filter": "强制筛选",
103
+ "Partial results warning": "部分分片或超时告警",
104
+ "Query timed out; displayed results may be incomplete.": "查询超时,当前展示的数据可能不完整。",
105
+ "Failed shards": "失败分片",
106
+ "Elastic Filter Bar": "Elasticsearch 仪表盘筛选栏",
107
+ "Elastic filter bar settings": "Elasticsearch 筛选栏配置",
108
+ "Sync Group": "同步分组 (Sync Group)",
109
+ "Subscribe to dashboard filter bar": "联动同页筛选栏",
110
+ "Filter Fields (comma-separated, e.g. service, region)": "下拉筛选字段 (逗号分隔,如 service, region)",
111
+ "Show global KQL input": "显示全局 KQL 输入框",
112
+ "Show global time range": "显示全局时间范围",
113
+ "Dashboard filter": "全局筛选",
114
+ "Clear dashboard filters": "清空全局筛选",
115
+ "Auto refresh": "自动刷新",
116
+ "Off": "关闭",
117
+ "Fields Explorer": "字段探查",
118
+ "Top values": "高频值分布",
119
+ "Filter for value": "筛选等于该值 (+)",
120
+ "Filter out value": "排除该值 (-)",
121
+ "Visible Columns": "显示列调整",
122
+ "Move up": "上移",
123
+ "Move down": "下移",
124
+ "Split Series Field": "二次分组字段 (Split Series)",
125
+ "Stack Mode": "堆叠模式",
126
+ "Grouped": "并列分组",
127
+ "Stacked": "数值堆叠",
128
+ "100% Stacked": "百分比堆叠 (100%)",
129
+ "Compare previous period": "对比上一周期",
130
+ "vs previous period": "较上一周期",
131
+ "Field Formats": "字段显示格式",
132
+ "Add Field Format": "添加格式规则",
133
+ "Format": "格式",
134
+ "Auto": "自动",
135
+ "Duration (ms)": "耗时 (ms)",
136
+ "Bytes": "字节 (Bytes)",
137
+ "Percent (%)": "百分比 (%)",
138
+ "Number": "千分位数字",
139
+ "Status Badge": "状态徽章",
140
+ "URL Link": "超链接",
141
+ "Record Context Bindings": "当前记录上下文绑定",
142
+ "Add Context Binding": "添加上下文绑定",
143
+ "Record Field Path": "NocoBase 记录字段路径",
144
+ "Allow data export on block": "允许在区块中导出数据",
145
+ "Export CSV": "导出 CSV",
146
+ "Export NDJSON": "导出 NDJSON",
147
+ "Query Elasticsearch Report": "查询 Elasticsearch 报表",
148
+ "Execute a Saved Elasticsearch Report and evaluate threshold conditions for scheduled alerts or reports.": "执行已保存的 Elasticsearch 报表并评估阈值条件,用于定时报表或告警工作流。",
149
+ "Threshold Metric": "阈值评估指标",
150
+ "Threshold Operator": "阈值比较符",
151
+ "Threshold Value": "阈值数值",
152
+ "Total Hits": "总命中数",
153
+ "Metric Value": "聚合指标值",
154
+ "Delta (%)": "环比变化 (%)",
155
+ "Threshold Breached": "是否触发阈值",
156
+ "Top Buckets": "前序分桶结果",
157
+ "Sample Rows": "样本记录",
158
+ "Executed At": "执行时间",
159
+ "Document Details": "文档详情",
160
+ "Table View": "字段表格",
161
+ "JSON View": "原始 JSON",
162
+ "Show data table": "查看数据表",
163
+ "Show chart": "查看图表",
164
+ "Select a saved Elastic Report in block settings to display data": "请在区块配置中选择已保存的 Elasticsearch 报表",
165
+ "No matching documents": "没有匹配的文档",
166
+ "Saved successfully": "保存成功",
167
+ "Deleted successfully": "删除成功",
168
+ "Copied to clipboard": "已复制到剪贴板",
169
+ "Copy": "复制",
170
+ "Confirm delete?": "确认删除?",
171
+ "Hits": "命中数",
172
+ "Next cursor page": "下一页 (游标)",
173
+ "First page": "返回首页",
174
+ "Dedicated MCP Endpoint": "插件专属 MCP 端点",
175
+ "MCP Server Name": "MCP 服务名称",
176
+ "Exposed MCP Tools": "已暴露的 MCP 工具",
177
+ "AI Employee Usage": "AI 员工使用说明",
178
+ "This plugin automatically registers the elastic-report MCP server (with user context) and AI Employee tools so AI agents can inspect fields, preview Elasticsearch queries, and publish Saved Reports ready to select in blocks.": "本插件会自动注册携带用户上下文的 elastic-report MCP 服务与 AI 员工工具,支持 AI 自动探查字段、预览 Elasticsearch 查询并发布可在页面区块中直接选用的报表。",
179
+ "Type keywords freely or select a field below": "可直接输入关键字,或从下方选择字段引导构建查询",
180
+ "Suggested Fields": "推荐字段",
181
+ "Comparisons & Operators": "比较与操作符",
182
+ "Suggested Values": "推荐字段值",
183
+ "Combine Conditions": "组合条件",
184
+ "Free-text Search": "全文自由检索",
185
+ "Loading field values...": "正在加载字段高频值...",
186
+ "Choose comparison (=, >=, <=...)": "选择比较符号 (=, >=, <=...)",
187
+ "Filter by field value": "按该字段值筛选",
188
+ "Equals (=)": "等于 (=)",
189
+ "Equals or contains (: )": "等于或包含 (: )",
190
+ "Greater than or equal (>=)": "大于等于 (>=)",
191
+ "Less than or equal (<=)": "小于等于 (<=)",
192
+ "Greater than (>)": "大于 (>)",
193
+ "Less than (<)": "小于 (<)",
194
+ "Match multiple values (OR)": "匹配多个值之一 (OR)",
195
+ "Has any value (exists)": "字段非空 (exists)",
196
+ "Exclude matching records": "排除匹配记录",
197
+ "Search text across all fields (Press Enter)": "跨所有字段自由搜索 (按回车)",
198
+ "Boolean true": "布尔真 (true)",
199
+ "Boolean false": "布尔假 (false)",
200
+ "Suggested value from data": "来自 Elasticsearch 的高频值",
201
+ "Sample value from loaded rows": "来自当前表格的样本值",
202
+ "Finish value group": "结束多值分组",
203
+ "Add another value to group": "在分组中追加其他值 (OR)",
204
+ "Exclude value in group": "在分组中排除值",
205
+ "Combine another condition (both match)": "并且满足下一条件 (AND)",
206
+ "Match either condition": "或者满足另一条件 (OR)",
207
+ "Exclude next condition": "并且排除下一条件 (AND NOT)",
208
+ "Close condition group": "闭合条件括号",
209
+ "Test Connection": "测试连接",
210
+ "Connection verified": "连接已验证",
211
+ "Index-scoped role": "索引级受限权限",
212
+ "Configure Elasticsearch 8.x TLS, CA Fingerprint, API Key, or Bearer Token in Data Source Manager": "可在数据源管理中配置 Elasticsearch 8.x 的 TLS、CA 指纹、API 密钥或 Bearer 令牌"
213
+ }
@@ -1 +1 @@
1
- {"name":"@elastic/elasticsearch","version":"8.19.2","versionCanary":"8.19.2-canary.0","description":"The official Elasticsearch client for Node.js","main":"./index.js","types":"index.d.ts","exports":{"require":"./index.js","import":"./index.js","types":"./index.d.ts"},"scripts":{"test":"npm run build && npm run lint && tap","test:unit":"npm run build && tap","test:unit-bun":"bun run build && bunx tap","test:esm":"npm run build && cd test/esm/ && npm install && node test-import.mjs","test:coverage-100":"npm run build && tap --coverage --100","test:coverage-report":"npm run build && tap --coverage && nyc report --reporter=text-lcov > coverage.lcov","test:coverage-ui":"npm run build && tap --coverage --coverage-report=html","test:integration-build":"npm run build && node test/integration/index.js","test:integration":"npm run test:integration-build && env tap run --jobs=1 --allow-empty-coverage --allow-incomplete-coverage --reporter=junit --reporter-file=report-junit.xml generated-tests/","lint":"ts-standard src","lint:fix":"ts-standard --fix src","license-checker":"license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause;0BSD'","prebuild":"npm run clean-build && npm run lint","build":"tsc && rm lib/package.json && mv lib/src/* lib/ && rm -rf lib/src","clean-build":"rimraf ./lib && mkdir lib","prepublishOnly":"npm run build"},"keywords":["elasticsearch","elastic","kibana","mapping","REST","search","client","index"],"contributors":[{"name":"Elastic Client Library Maintainers","company":"Elastic BV"}],"license":"Apache-2.0","repository":{"type":"git","url":"https://github.com/elastic/elasticsearch-js.git"},"bugs":{"url":"https://github.com/elastic/elasticsearch-js/issues"},"homepage":"http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html","engines":{"node":">=20"},"devDependencies":{"@elastic/request-converter":"8.18.0","@sinonjs/fake-timers":"14.0.0","@types/debug":"4.1.12","@types/ms":"2.1.0","@types/node":"22.15.2","@types/sinonjs__fake-timers":"8.1.5","@types/split2":"4.2.3","@types/stoppable":"1.1.3","chai":"5.2.0","cross-zip":"4.0.1","desm":"1.3.1","into-stream":"8.0.1","js-yaml":"4.1.0","license-checker":"25.0.1","minimist":"1.2.8","ms":"2.1.3","node-abort-controller":"3.1.1","node-fetch":"2.7.0","ora":"5.4.1","proxy":"2.2.0","rimraf":"6.0.1","semver":"7.7.1","split2":"4.2.0","stoppable":"1.1.0","tap":"21.1.0","ts-node":"10.9.2","ts-standard":"12.0.2","typescript":"5.8.3","workq":"3.0.0","xmlbuilder2":"3.1.1","zx":"7.2.3"},"dependencies":{"@elastic/transport":"^8.9.6","apache-arrow":"18.x - 21.x","tslib":"^2.4.0"},"tap":{"disable-coverage":true,"files":["test/unit/{*,**/*}.test.ts"]},"_lastModified":"2026-12-01T12:13:07.452Z"}
1
+ {"name":"@elastic/elasticsearch","version":"8.19.2","versionCanary":"8.19.2-canary.0","description":"The official Elasticsearch client for Node.js","main":"./index.js","types":"index.d.ts","exports":{"require":"./index.js","import":"./index.js","types":"./index.d.ts"},"scripts":{"test":"npm run build && npm run lint && tap","test:unit":"npm run build && tap","test:unit-bun":"bun run build && bunx tap","test:esm":"npm run build && cd test/esm/ && npm install && node test-import.mjs","test:coverage-100":"npm run build && tap --coverage --100","test:coverage-report":"npm run build && tap --coverage && nyc report --reporter=text-lcov > coverage.lcov","test:coverage-ui":"npm run build && tap --coverage --coverage-report=html","test:integration-build":"npm run build && node test/integration/index.js","test:integration":"npm run test:integration-build && env tap run --jobs=1 --allow-empty-coverage --allow-incomplete-coverage --reporter=junit --reporter-file=report-junit.xml generated-tests/","lint":"ts-standard src","lint:fix":"ts-standard --fix src","license-checker":"license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause;0BSD'","prebuild":"npm run clean-build && npm run lint","build":"tsc && rm lib/package.json && mv lib/src/* lib/ && rm -rf lib/src","clean-build":"rimraf ./lib && mkdir lib","prepublishOnly":"npm run build"},"keywords":["elasticsearch","elastic","kibana","mapping","REST","search","client","index"],"contributors":[{"name":"Elastic Client Library Maintainers","company":"Elastic BV"}],"license":"Apache-2.0","repository":{"type":"git","url":"https://github.com/elastic/elasticsearch-js.git"},"bugs":{"url":"https://github.com/elastic/elasticsearch-js/issues"},"homepage":"http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html","engines":{"node":">=20"},"devDependencies":{"@elastic/request-converter":"8.18.0","@sinonjs/fake-timers":"14.0.0","@types/debug":"4.1.12","@types/ms":"2.1.0","@types/node":"22.15.2","@types/sinonjs__fake-timers":"8.1.5","@types/split2":"4.2.3","@types/stoppable":"1.1.3","chai":"5.2.0","cross-zip":"4.0.1","desm":"1.3.1","into-stream":"8.0.1","js-yaml":"4.1.0","license-checker":"25.0.1","minimist":"1.2.8","ms":"2.1.3","node-abort-controller":"3.1.1","node-fetch":"2.7.0","ora":"5.4.1","proxy":"2.2.0","rimraf":"6.0.1","semver":"7.7.1","split2":"4.2.0","stoppable":"1.1.0","tap":"21.1.0","ts-node":"10.9.2","ts-standard":"12.0.2","typescript":"5.8.3","workq":"3.0.0","xmlbuilder2":"3.1.1","zx":"7.2.3"},"dependencies":{"@elastic/transport":"^8.9.6","apache-arrow":"18.x - 21.x","tslib":"^2.4.0"},"tap":{"disable-coverage":true,"files":["test/unit/{*,**/*}.test.ts"]},"_lastModified":"2026-12-03T21:08:19.625Z"}
@@ -404,7 +404,7 @@ function createElasticReportToolCatalog(app, reportService) {
404
404
  },
405
405
  published: {
406
406
  type: "boolean",
407
- description: "Whether the report is published for selection in page blocks (default true)."
407
+ description: "Publish for selection in blocks. Defaults to true for new reports. Omit to retain the current state on update."
408
408
  },
409
409
  allowedRoles: {
410
410
  type: "array",
@@ -423,9 +423,9 @@ function createElasticReportToolCatalog(app, reportService) {
423
423
  {
424
424
  ...args.id !== void 0 ? { id: requireId(args.id, "id") } : {},
425
425
  title: typeof args.title === "string" ? args.title : "",
426
- description: typeof args.description === "string" ? args.description : null,
426
+ ...typeof args.description === "string" ? { description: args.description } : {},
427
427
  dataViewId: requireId(args.dataViewId, "dataViewId"),
428
- published: args.published !== false,
428
+ ...typeof args.published === "boolean" ? { published: args.published } : {},
429
429
  ...args.allowedRoles !== void 0 ? { allowedRoles: (0, import_acl_guard.normalizeRoleList)(args.allowedRoles) } : {},
430
430
  spec: isRecord(args.spec) ? args.spec : { visualization: "table" }
431
431
  },
@@ -433,7 +433,9 @@ function createElasticReportToolCatalog(app, reportService) {
433
433
  );
434
434
  return {
435
435
  report: saved,
436
- usageHint: "Report saved and published. Users can open any NocoBase /v/ page, click Add Block -> Elastic Report, and select this report from the dropdown."
436
+ usageHint: app.i18n.t(saved.published ? "Published report ready for blocks" : "Draft saved in Settings", {
437
+ ns: "plugin-elastic-report"
438
+ })
437
439
  };
438
440
  }
439
441
  },
@@ -35,6 +35,7 @@ var import_server = require("@nocobase/server");
35
35
  var import_constants = require("../shared/constants");
36
36
  var import_acl_guard = require("./acl-guard");
37
37
  var import_ElasticReportMcpServer = require("./mcp/ElasticReportMcpServer");
38
+ var import_report_block_tools = require("./report-block-tools");
38
39
  var import_ElasticReportToolCatalog = require("./mcp/ElasticReportToolCatalog");
39
40
  var import_ElasticsearchConnectionService = require("./services/ElasticsearchConnectionService");
40
41
  var import_ElasticReportService = require("./services/ElasticReportService");
@@ -94,7 +95,7 @@ class PluginElasticReportServer extends import_server.Plugin {
94
95
  this.exportService = new import_ReportExportService.ReportExportService(this.connectionService, this.reportService);
95
96
  this.toolsCatalog = (0, import_ElasticReportToolCatalog.createElasticReportToolCatalog)(this.app, this.reportService);
96
97
  this.mcpServer = new import_ElasticReportMcpServer.ElasticReportMcpServer({
97
- version: ((_a = this.options) == null ? void 0 : _a.version) || "0.7.0",
98
+ version: ((_a = this.options) == null ? void 0 : _a.version) || "0.8.0",
98
99
  tools: this.toolsCatalog,
99
100
  logger: this.app.logger
100
101
  });
@@ -448,7 +449,7 @@ class PluginElasticReportServer extends import_server.Plugin {
448
449
  return;
449
450
  }
450
451
  toolsManager.registerTools(
451
- this.toolsCatalog.map((tool) => ({
452
+ [...this.toolsCatalog, ...(0, import_report_block_tools.createReportBlockTools)(this.app, this.reportService)].map((tool) => ({
452
453
  scope: "CUSTOM",
453
454
  defaultPermission: tool.defaultPermission,
454
455
  execution: "backend",
@@ -504,8 +505,7 @@ class PluginElasticReportServer extends import_server.Plugin {
504
505
  await collection.model.sync();
505
506
  columns = await queryInterface.describeTable(tableName);
506
507
  }
507
- const attributes = collection.model.rawAttributes;
508
- for (const [attributeName, attribute] of Object.entries(attributes)) {
508
+ for (const [attributeName, attribute] of Object.entries(collection.model.rawAttributes)) {
509
509
  const columnName = attribute.field || attributeName;
510
510
  if (columns && columnName in columns) {
511
511
  continue;