plugin-elastic-report 0.1.1 → 0.7.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/ai/skills/elastic-report/SKILLS.md +5 -3
- package/dist/client/357.0dd385384cab5dbf.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/851.142c93fc6d666b28.js +10 -0
- package/dist/client-v2/857.a5bf9637d5fd4ef5.js +10 -0
- package/dist/client-v2/877.f4095a3dbcadf98f.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +3 -2
- package/dist/locale/en-US.json +100 -1
- package/dist/locale/vi-VN.json +100 -1
- package/dist/locale/zh-CN.json +100 -1
- package/dist/node_modules/@elastic/elasticsearch/package.json +1 -1
- package/dist/server/acl-guard.js +97 -25
- package/dist/server/collections/es-report-data-views.js +6 -0
- package/dist/server/collections/es-reports.js +6 -0
- package/dist/server/mcp/ElasticReportToolCatalog.js +232 -10
- package/dist/server/plugin.js +153 -19
- package/dist/server/services/ElasticReportService.js +125 -11
- package/dist/server/services/ElasticsearchConnectionService.js +274 -34
- package/dist/server/services/ReportExportService.js +243 -0
- package/dist/server/services/ReportQueryCompiler.js +532 -91
- package/dist/server/workflow/ElasticReportQueryInstruction.js +123 -0
- package/dist/shared/constants.js +17 -2
- package/package.json +3 -2
- package/src/client/index.tsx +16 -1
- package/src/client/workflow-instructions.tsx +44 -0
- package/src/client-v2/__tests__/elastic-report.test.tsx +519 -39
- package/src/client-v2/__tests__/kql-autocomplete.test.ts +178 -0
- package/src/client-v2/api.ts +96 -0
- package/src/client-v2/bus/DashboardFilterBus.ts +212 -0
- package/src/client-v2/components/ElasticBasicCharts.tsx +345 -92
- package/src/client-v2/components/ElasticFilterBar.tsx +372 -0
- package/src/client-v2/components/ElasticKqlInput.tsx +421 -0
- package/src/client-v2/components/ElasticReportBlock.tsx +157 -11
- package/src/client-v2/components/ElasticReportRenderer.tsx +621 -71
- package/src/client-v2/components/ReportSelect.tsx +39 -26
- package/src/client-v2/models/ElasticFilterBarBlockModel.tsx +115 -0
- package/src/client-v2/models/ElasticReportBlockModel.tsx +36 -3
- package/src/client-v2/pages/ElasticReportManager.tsx +432 -26
- package/src/client-v2/plugin.tsx +20 -0
- package/src/client-v2/utils/kqlAutocomplete.ts +861 -0
- package/src/client-v2/workflow/instructions.tsx +149 -0
- package/src/locale/en-US.json +100 -1
- package/src/locale/vi-VN.json +100 -1
- package/src/locale/zh-CN.json +100 -1
- package/src/server/__tests__/query-compiler.test.ts +390 -1
- package/src/server/__tests__/report-mcp-acl.integration.test.ts +271 -3
- package/src/server/acl-guard.ts +119 -28
- package/src/server/collections/es-report-data-views.ts +6 -0
- package/src/server/collections/es-reports.ts +6 -0
- package/src/server/mcp/ElasticReportToolCatalog.ts +255 -9
- package/src/server/plugin.ts +189 -21
- package/src/server/services/ElasticReportService.ts +165 -5
- package/src/server/services/ElasticsearchConnectionService.ts +375 -48
- package/src/server/services/ReportExportService.ts +282 -0
- package/src/server/services/ReportQueryCompiler.ts +629 -94
- package/src/server/workflow/ElasticReportQueryInstruction.ts +124 -0
- package/src/shared/constants.ts +7 -0
- package/src/shared/types.ts +98 -1
- package/dist/client-v2/851.488fdbf5bc5b6a36.js +0 -10
package/src/client-v2/plugin.tsx
CHANGED
|
@@ -9,14 +9,24 @@
|
|
|
9
9
|
|
|
10
10
|
import { Application, Plugin } from '@nocobase/client-v2';
|
|
11
11
|
import { ACL_SNIPPET, PLUGIN_NAME, SETTINGS_MENU_KEY } from '../shared/constants';
|
|
12
|
+
import { ReportSelect } from './components/ReportSelect';
|
|
13
|
+
import type { WorkflowClientRegistry } from './workflow/instructions';
|
|
12
14
|
|
|
13
15
|
export class PluginElasticReportClient extends Plugin<Record<string, never>, Application> {
|
|
14
16
|
async load() {
|
|
17
|
+
this.flowEngine.flowSettings?.registerComponents?.({
|
|
18
|
+
ElasticReportSelect: ReportSelect,
|
|
19
|
+
});
|
|
20
|
+
|
|
15
21
|
this.flowEngine.registerModelLoaders({
|
|
16
22
|
ElasticReportBlockModel: {
|
|
17
23
|
extends: 'BlockModel',
|
|
18
24
|
loader: () => import('./models/ElasticReportBlockModel'),
|
|
19
25
|
},
|
|
26
|
+
ElasticFilterBarBlockModel: {
|
|
27
|
+
extends: 'BlockModel',
|
|
28
|
+
loader: () => import('./models/ElasticFilterBarBlockModel'),
|
|
29
|
+
},
|
|
20
30
|
});
|
|
21
31
|
|
|
22
32
|
const title = this.t('Elastic Report');
|
|
@@ -46,6 +56,16 @@ export class PluginElasticReportClient extends Plugin<Record<string, never>, App
|
|
|
46
56
|
this.pluginSettingsManager.setPluginSettingsLink(pluginName, SETTINGS_MENU_KEY);
|
|
47
57
|
}
|
|
48
58
|
}
|
|
59
|
+
|
|
60
|
+
const workflow = (
|
|
61
|
+
this.app as unknown as {
|
|
62
|
+
pm?: { get?: (name: string) => WorkflowClientRegistry | undefined };
|
|
63
|
+
}
|
|
64
|
+
).pm?.get?.('workflow');
|
|
65
|
+
if (workflow && typeof workflow.registerInstruction === 'function') {
|
|
66
|
+
const { registerElasticReportWorkflowInstructions } = await import('./workflow/instructions');
|
|
67
|
+
registerElasticReportWorkflowInstructions(workflow);
|
|
68
|
+
}
|
|
49
69
|
}
|
|
50
70
|
}
|
|
51
71
|
|