@nocobase/plugin-ai 2.1.0-beta.15 → 2.1.0-beta.17
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/ai/ai-employees/atlas/index.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/ai-coding/prompt.js → ai/ai-employees/atlas/index.js} +29 -20
- package/dist/ai/ai-employees/atlas/prompt.md +84 -0
- package/dist/ai/ai-employees/dara.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/data-visualization/prompt.js → ai/ai-employees/dara.js} +21 -13
- package/dist/ai/ai-employees/dex.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/data-organizer/prompt.js → ai/ai-employees/dex.js} +15 -7
- package/dist/ai/ai-employees/ellis.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/email-assistant/prompt.js → ai/ai-employees/ellis.js} +19 -11
- package/dist/ai/ai-employees/lexi.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/translator/prompt.js → ai/ai-employees/lexi.js} +15 -7
- package/dist/ai/ai-employees/vera.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/research-analyst/prompt.js → ai/ai-employees/vera.js} +16 -8
- package/dist/ai/ai-employees/viz.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/insights-analyst/prompt.js → ai/ai-employees/viz.js} +15 -7
- package/dist/ai/skills/business-analysis-report/SKILLS.md +88 -0
- package/dist/{server/ai-employees/built-in/ai-coding/prompt.d.ts → ai/skills/business-analysis-report/tools/businessReportGenerator.d.ts} +1 -3
- package/dist/ai/skills/business-analysis-report/tools/businessReportGenerator.js +98 -0
- package/dist/ai/skills/document-search/SKILLS.md +69 -0
- package/dist/ai/tools/chartGenerator.js +15 -3
- package/dist/ai/tools/formFiller.js +13 -2
- package/dist/{server/ai-employees/built-in/data-modeling/prompt.d.ts → ai/tools/getSkill.d.ts} +1 -3
- package/dist/{server/ai-employees/built-in/data-modeling/index.js → ai/tools/getSkill.js} +39 -32
- package/dist/{server/ai-employees/built-in/data-organizer/prompt.d.ts → ai/tools/knowledge-base-retrieve.d.ts} +1 -3
- package/dist/ai/tools/knowledge-base-retrieve.js +94 -0
- package/dist/{server/ai-employees/built-in/data-visualization/prompt.d.ts → ai/tools/sub-agents/dispatch-sub-agent-task.d.ts} +1 -3
- package/dist/ai/tools/sub-agents/dispatch-sub-agent-task.js +108 -0
- package/dist/ai/tools/sub-agents/get-ai-employee.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/translator/profile.js → ai/tools/sub-agents/get-ai-employee.js} +28 -21
- package/dist/ai/tools/sub-agents/list-ai-employees.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/email-assistant/profile.js → ai/tools/sub-agents/list-ai-employees.js} +25 -21
- package/dist/ai/tools/sub-agents/shared.d.ts +33 -0
- package/dist/ai/tools/sub-agents/shared.js +169 -0
- package/dist/ai/tools/suggestions.js +15 -4
- package/dist/client/170.d98eacdc00d9d527.js +10 -0
- package/dist/client/228.b18148eb1009d2fb.js +10 -0
- package/dist/client/280.029428b83d62155f.js +10 -0
- package/dist/client/290.0888139e33c9b7cb.js +10 -0
- package/dist/client/{524.954f96ec4fc2fd7a.js → 331.d547c95410476a69.js} +1 -1
- package/dist/client/343.83f7d96664e4e038.js +10 -0
- package/dist/client/406.15c09d98faa2ccf1.js +10 -0
- package/dist/client/428.e9f38da3b0d8b498.js +10 -0
- package/dist/client/486.afbed6b132b3c0dd.js +10 -0
- package/dist/client/502.2b4a51e0a8122e52.js +10 -0
- package/dist/client/525.33a9c8ec28be4ec4.js +10 -0
- package/dist/client/559.133d286a0a0a1d93.js +10 -0
- package/dist/client/{91.90e7098b7fbd5d00.js → 561.776886c5308e3c26.js} +1 -1
- package/dist/client/580.e75f97fb883ad042.js +10 -0
- package/dist/client/597.aa363881a325b5c0.js +10 -0
- package/dist/client/604.de96f3ec4d471afd.js +10 -0
- package/dist/client/614.aa766080f6b99aab.js +10 -0
- package/dist/client/646.51313bb0d85d6366.js +10 -0
- package/dist/client/687.224e569a99cae4bb.js +10 -0
- package/dist/client/699.57c0a1acb723202a.js +10 -0
- package/dist/client/711.266b8f1c520d467a.js +10 -0
- package/dist/client/758.a9741e81911e53c3.js +10 -0
- package/dist/client/768.973ce32e15099a48.js +10 -0
- package/dist/client/792.ae8ad1fcae9fd974.js +10 -0
- package/dist/client/820.6a26239ea96c075a.js +10 -0
- package/dist/client/832.0cf69e3f43c320b2.js +10 -0
- package/dist/client/927.ff5cd05b14901ae6.js +10 -0
- package/dist/client/ai-employees/admin/SkillSettings.d.ts +7 -5
- package/dist/client/ai-employees/admin/ToolsSettings.d.ts +17 -0
- package/dist/client/ai-employees/admin/mcp/MCPSettings.d.ts +10 -0
- package/dist/client/ai-employees/admin/mcp/MCPToolsList.d.ts +19 -0
- package/dist/client/ai-employees/admin/mcp/context.d.ts +15 -0
- package/dist/client/ai-employees/admin/mcp/schemas.d.ts +1286 -0
- package/dist/client/ai-employees/built-in/utils.d.ts +1 -0
- package/dist/client/ai-employees/business-report/tools/index.d.ts +10 -0
- package/dist/client/ai-employees/business-report/ui/BusinessReportCard.d.ts +12 -0
- package/dist/client/ai-employees/business-report/ui/BusinessReportModal.d.ts +17 -0
- package/dist/client/ai-employees/business-report/ui/report-utils.d.ts +38 -0
- package/dist/client/ai-employees/chatbox/AIEmployeeSwitch.d.ts +3 -2
- package/dist/client/ai-employees/chatbox/HintMessageHeader.d.ts +10 -0
- package/dist/client/ai-employees/chatbox/ModelSwitcher.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/SearchSwitch.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/Upload.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/conversations/ConversationsList.d.ts +27 -0
- package/dist/client/ai-employees/chatbox/conversations/WorkflowTasksList.d.ts +33 -0
- package/dist/client/ai-employees/chatbox/conversations/common.d.ts +43 -0
- package/dist/client/ai-employees/chatbox/conversations/index.d.ts +9 -0
- package/dist/client/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +5 -3
- package/dist/client/ai-employees/chatbox/hooks/useWorkflowTasks.d.ts +27 -0
- package/dist/client/ai-employees/chatbox/markdown/ECharts.d.ts +1 -2
- package/dist/client/ai-employees/chatbox/markdown/Markdown.d.ts +1 -1
- package/dist/client/ai-employees/chatbox/roles.d.ts +1 -0
- package/dist/client/ai-employees/chatbox/stores/chat-box.d.ts +8 -0
- package/dist/client/ai-employees/chatbox/stores/chat-conversations.d.ts +4 -0
- package/dist/client/ai-employees/chatbox/stores/chat-messages.d.ts +8 -0
- package/dist/client/ai-employees/chatbox/stores/workflow-tasks.d.ts +45 -0
- package/dist/client/ai-employees/chatbox/utils.d.ts +17 -7
- package/dist/client/ai-employees/sub-agents/tools/index.d.ts +10 -0
- package/dist/client/ai-employees/sub-agents/ui/SubAgentDispatchCard.d.ts +21 -0
- package/dist/client/ai-employees/types.d.ts +24 -4
- package/dist/{server/ai-employees/built-in/ai-coding/document/example/js-filter → client/ai-employees/workflow-tasks/tools}/index.d.ts +2 -7
- package/dist/client/ai-employees/workflow-tasks/ui/WorkflowTaskOutputCard.d.ts +11 -0
- package/dist/client/components/ListCollapse.d.ts +28 -0
- package/dist/client/index.js +7 -7
- package/dist/client/manager/ai-manager.d.ts +4 -23
- package/dist/client/repositories/AIConfigRepository.d.ts +11 -3
- package/dist/client/workflow/nodes/employee/components/AIEmployeeSelect.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/assigness.d.ts +11 -0
- package/dist/client/workflow/nodes/employee/components/file-inputs.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/message-inputs.d.ts +12 -0
- package/dist/client/workflow/nodes/employee/components/model-options.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/skill-settings.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/structured-output.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/users-select.d.ts +15 -0
- package/dist/client/workflow/nodes/employee/components/web-search-options.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/configuration.d.ts +12 -0
- package/dist/client/workflow/nodes/employee/flow-models/feedback.d.ts +14 -0
- package/dist/client/workflow/nodes/employee/flow-models/task.d.ts +13 -0
- package/dist/client/workflow/nodes/employee/index.d.ts +7 -31
- package/dist/collections/ai-employees.js +2 -1
- package/dist/collections/ai-mcp-clients.d.ts +51 -0
- package/dist/collections/ai-mcp-clients.js +111 -0
- package/dist/externalVersion.js +17 -15
- package/dist/locale/en-US.json +141 -8
- package/dist/locale/zh-CN.json +142 -9
- package/dist/node_modules/fast-glob/out/index.js +8 -8
- package/dist/node_modules/fast-glob/package.json +1 -1
- package/dist/node_modules/flexsearch/dist/flexsearch.bundle.min.js +2 -2
- package/dist/node_modules/flexsearch/package.json +1 -1
- package/dist/node_modules/fs-extra/lib/index.js +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/nodejs_snowflake.js +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/index.js +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/index.cjs +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-conversations.d.ts +70 -0
- package/dist/server/ai-employees/ai-conversations.js +325 -0
- package/dist/server/ai-employees/ai-employee.d.ts +100 -19
- package/dist/server/ai-employees/ai-employee.js +484 -261
- package/dist/server/ai-employees/ai-knowledge-base.d.ts +28 -0
- package/dist/server/ai-employees/ai-knowledge-base.js +167 -0
- package/dist/server/ai-employees/middleware/conversation.d.ts +2 -0
- package/dist/server/ai-employees/middleware/conversation.js +38 -5
- package/dist/server/ai-employees/middleware/index.d.ts +2 -0
- package/dist/server/ai-employees/middleware/index.js +5 -1
- package/dist/server/ai-employees/middleware/skill-tools.d.ts +12 -0
- package/dist/server/ai-employees/middleware/skill-tools.js +88 -0
- package/dist/server/ai-employees/middleware/tools.js +37 -10
- package/dist/server/ai-employees/middleware/workflow-history.d.ts +22 -0
- package/dist/server/ai-employees/middleware/workflow-history.js +173 -0
- package/dist/server/ai-employees/prompts.d.ts +16 -1
- package/dist/server/ai-employees/prompts.js +37 -1
- package/dist/server/ai-employees/sub-agents/dispatcher.d.ts +36 -0
- package/dist/server/ai-employees/sub-agents/dispatcher.js +225 -0
- package/dist/server/ai-employees/sub-agents/index.d.ts +9 -0
- package/dist/server/{migrations/20250923221107-setup-build-in.js → ai-employees/sub-agents/index.js} +9 -13
- package/dist/server/ai-employees/templates/form-assistant.d.ts +2 -2
- package/dist/server/ai-employees/templates/form-assistant.js +2 -2
- package/dist/server/ai-employees/utils.js +2 -2
- package/dist/server/collections/ai-conversations.js +18 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_contacts_en.d.ts → collections/ai-mcp-clients.d.ts} +1 -4
- package/dist/server/{ai-employees/built-in/nocobase-assistant/index.js → collections/ai-mcp-clients.js} +12 -13
- package/dist/server/{ai-employees/built-in/ai-coding/document/basic/flow-resource.d.ts → collections/ai-skills.d.ts} +1 -4
- package/dist/server/{ai-employees/built-in/email-assistant/index.js → collections/ai-skills.js} +46 -23
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_opportunities_en.d.ts → collections/ai-workflow-tasks.d.ts} +1 -4
- package/dist/server/collections/ai-workflow-tasks.js +112 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_accounts_en.d.ts → collections/users-ai-workflow-tasks.d.ts} +1 -4
- package/dist/server/collections/users-ai-workflow-tasks.js +44 -0
- package/dist/server/llm-providers/anthropic.d.ts +1 -0
- package/dist/server/llm-providers/anthropic.js +2 -1
- package/dist/server/llm-providers/dashscope.d.ts +1 -0
- package/dist/server/llm-providers/deepseek.d.ts +1 -0
- package/dist/server/llm-providers/google-genai.d.ts +1 -0
- package/dist/server/llm-providers/google-genai.js +2 -1
- package/dist/server/llm-providers/kimi/provider.d.ts +1 -0
- package/dist/server/llm-providers/openai/responses.d.ts +1 -0
- package/dist/server/llm-providers/openai/responses.js +2 -1
- package/dist/server/llm-providers/provider.d.ts +1 -10
- package/dist/server/llm-providers/provider.js +3 -34
- package/dist/server/manager/ai-coding-manager.d.ts +1 -2
- package/dist/server/manager/ai-coding-manager.js +0 -41
- package/dist/server/manager/ai-context-datasource-manager.js +30 -1
- package/dist/server/manager/built-in-manager.d.ts +2 -4
- package/dist/server/manager/built-in-manager.js +8 -117
- package/dist/server/migrations/20260306000001-migrate-skill-settings-tools.js +68 -0
- package/dist/server/migrations/20260319000000-add-ai-conversations-from.d.ts +14 -0
- package/dist/server/migrations/20260319000000-add-ai-conversations-from.js +63 -0
- package/dist/server/plugin.d.ts +6 -1
- package/dist/server/plugin.js +31 -8
- package/dist/server/resource/aiConversations.js +112 -188
- package/dist/server/resource/aiEmployees.js +5 -7
- package/dist/server/resource/aiMcpClients.d.ts +11 -0
- package/dist/server/resource/aiMcpClients.js +78 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/index.d.ts → resource/aiSkills.d.ts} +3 -7
- package/dist/server/resource/aiSkills.js +71 -0
- package/dist/server/resource/aiTools.js +4 -6
- package/dist/server/resource/aiWorkflowTasks.d.ts +12 -0
- package/dist/server/resource/aiWorkflowTasks.js +290 -0
- package/dist/server/tools/docs.js +4 -3
- package/dist/server/tools/workflow-caller.js +1 -0
- package/dist/server/types/ai-chat-conversation.type.d.ts +8 -2
- package/dist/server/types/ai-message.type.d.ts +7 -0
- package/dist/server/utils.d.ts +3 -0
- package/dist/server/utils.js +28 -3
- package/dist/server/workflow/nodes/employee/files.d.ts +16 -0
- package/dist/server/workflow/nodes/employee/files.js +125 -0
- package/dist/server/workflow/nodes/employee/handler.d.ts +11 -0
- package/dist/server/workflow/nodes/employee/handler.js +107 -0
- package/dist/server/workflow/nodes/employee/index.d.ts +17 -0
- package/dist/server/workflow/nodes/employee/index.js +404 -0
- package/dist/server/workflow/nodes/employee/tools.d.ts +12 -0
- package/dist/server/workflow/nodes/employee/tools.js +133 -0
- package/dist/server/workflow/nodes/employee/types.d.ts +35 -0
- package/dist/server/workflow/nodes/employee/types.js +24 -0
- package/dist/server/workflow/utils.d.ts +14 -0
- package/dist/server/workflow/utils.js +111 -0
- package/package.json +4 -2
- package/dist/client/107.64d9efa24d6b9143.js +0 -10
- package/dist/client/124.768c8aa5d6e6b461.js +0 -10
- package/dist/client/159.d52107c7a34ce2da.js +0 -10
- package/dist/client/192.0419770b69678994.js +0 -10
- package/dist/client/204.91be8cfc54d91a59.js +0 -10
- package/dist/client/238.9f784a7cdb751999.js +0 -10
- package/dist/client/263.6e1dfb1cbb1964f5.js +0 -10
- package/dist/client/35.5ee7503d9c09daa8.js +0 -10
- package/dist/client/47.6bd245f2140efd24.js +0 -10
- package/dist/client/481.03b3d2306d409933.js +0 -10
- package/dist/client/586.6a1510cabaa84f23.js +0 -10
- package/dist/client/650.8871a07b31c307ea.js +0 -10
- package/dist/client/755.e295bbd2b2a1cc21.js +0 -10
- package/dist/client/772.d51f683c55e18dd4.js +0 -10
- package/dist/client/870.84187dcb8c89b4dc.js +0 -10
- package/dist/client/933.baab3aa75f30e020.js +0 -10
- package/dist/client/987.3aee964e7f406939.js +0 -10
- package/dist/server/ai-employees/built-in/ai-coding/document/basic/flow-resource.js +0 -256
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/index.js +0 -48
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_accounts_en.js +0 -452
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_contacts_en.js +0 -363
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_opportunities_en.js +0 -270
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_quotations_en.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_quotations_en.js +0 -219
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_tickets_en.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_tickets_en.js +0 -409
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/accounts_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/accounts_filter_ant_style.js +0 -324
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/contacts_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/contacts_filter_ant_style.js +0 -309
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/index.js +0 -50
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/leads_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/leads_filter_ant_style.js +0 -345
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/opportunities_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/opportunities_filter_ant_style.js +0 -381
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/product_categories_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/product_categories_ant_style.js +0 -545
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/tickets_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/tickets_filter_ant_style.js +0 -346
- package/dist/server/ai-employees/built-in/ai-coding/document/js-action.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-action.js +0 -102
- package/dist/server/ai-employees/built-in/ai-coding/document/js-block.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-block.js +0 -314
- package/dist/server/ai-employees/built-in/ai-coding/document/js-column.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-column.js +0 -113
- package/dist/server/ai-employees/built-in/ai-coding/document/js-field.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-field.js +0 -498
- package/dist/server/ai-employees/built-in/ai-coding/document/js-item.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-item.js +0 -184
- package/dist/server/ai-employees/built-in/ai-coding/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/ai-coding/index.js +0 -99
- package/dist/server/ai-employees/built-in/ai-coding/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/ai-coding/profile.js +0 -60
- package/dist/server/ai-employees/built-in/ai-coding/prompt_en.md +0 -110
- package/dist/server/ai-employees/built-in/data-modeling/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-modeling/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-modeling/profile.js +0 -60
- package/dist/server/ai-employees/built-in/data-modeling/prompt.js +0 -283
- package/dist/server/ai-employees/built-in/data-organizer/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-organizer/index.js +0 -63
- package/dist/server/ai-employees/built-in/data-organizer/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-organizer/profile.js +0 -60
- package/dist/server/ai-employees/built-in/data-visualization/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-visualization/index.js +0 -58
- package/dist/server/ai-employees/built-in/data-visualization/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-visualization/profile.js +0 -60
- package/dist/server/ai-employees/built-in/email-assistant/index.d.ts +0 -34
- package/dist/server/ai-employees/built-in/email-assistant/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/email-assistant/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/insights-analyst/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/insights-analyst/index.js +0 -63
- package/dist/server/ai-employees/built-in/insights-analyst/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/insights-analyst/profile.js +0 -60
- package/dist/server/ai-employees/built-in/insights-analyst/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/nocobase-assistant/index.d.ts +0 -34
- package/dist/server/ai-employees/built-in/nocobase-assistant/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/nocobase-assistant/profile.js +0 -60
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.js +0 -52
- package/dist/server/ai-employees/built-in/research-analyst/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/research-analyst/index.js +0 -63
- package/dist/server/ai-employees/built-in/research-analyst/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/research-analyst/profile.js +0 -60
- package/dist/server/ai-employees/built-in/research-analyst/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/translator/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/translator/index.js +0 -67
- package/dist/server/ai-employees/built-in/translator/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/translator/prompt.d.ts +0 -12
- /package/dist/client/ai-employees/chatbox/{Conversations.d.ts → conversations/Conversations.d.ts} +0 -0
- /package/dist/server/migrations/{20250923221107-setup-build-in.d.ts → 20260306000001-migrate-skill-settings-tools.d.ts} +0 -0
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var tickets_filter_ant_style_exports = {};
|
|
28
|
-
__export(tickets_filter_ant_style_exports, {
|
|
29
|
-
default: () => tickets_filter_ant_style_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(tickets_filter_ant_style_exports);
|
|
32
|
-
var tickets_filter_ant_style_default = {
|
|
33
|
-
name: "tickets_filter_ant_style",
|
|
34
|
-
content: String.raw`// Tickets Filter Block - Ant Design Style
|
|
35
|
-
// Configure block UID (needs to be replaced with actual UID)
|
|
36
|
-
const ticketsBlockUid = 'f88ed4e5ef3'; // Replace with actual tickets list block UID
|
|
37
|
-
|
|
38
|
-
// State management
|
|
39
|
-
let selectedFilter = 'all';
|
|
40
|
-
let isExpanded = false;
|
|
41
|
-
|
|
42
|
-
// Load icon library
|
|
43
|
-
await ctx.loadCSS('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
|
|
44
|
-
|
|
45
|
-
// Predefined filter configurations
|
|
46
|
-
const filterConfigs = [
|
|
47
|
-
{ key: 'all', label: 'All', icon: 'fa-th-large', filter: {"$and":[]} },
|
|
48
|
-
{ key: 'new', label: 'New/Open', icon: 'fa-star', filter: { status: { $in: ['new', 'open'] } } },
|
|
49
|
-
{ key: 'in_progress', label: 'Progress', icon: 'fa-spinner', filter: { status: 'in_progress' } },
|
|
50
|
-
{ key: 'pending_customer', label: 'Pend.Cust', icon: 'fa-user-clock', filter: { status: 'pending_customer' } },
|
|
51
|
-
{ key: 'pending_sales', label: 'Pend.Sales', icon: 'fa-dollar-sign', filter: { status: 'pending_sales' } },
|
|
52
|
-
{ key: 'on_hold', label: 'Hold', icon: 'fa-pause-circle', filter: { status: 'on_hold' } },
|
|
53
|
-
{ key: 'resolved', label: 'Resolved', icon: 'fa-check-circle', filter: { status: 'resolved' } },
|
|
54
|
-
{ key: 'closed', label: 'Closed', icon: 'fa-lock', filter: { status: 'closed' } },
|
|
55
|
-
{ key: 'high_priority', label: 'High Pri', icon: 'fa-exclamation-triangle', filter: { priority: { $in: ['urgent', 'high'] } } },
|
|
56
|
-
{ key: 'technical', label: 'Tech', icon: 'fa-cog', filter: { problem_type: { $in: ['technical', 'hardware', 'software'] } } },
|
|
57
|
-
{ key: 'unassigned', label: 'Unassign', icon: 'fa-user-slash', filter: { assigneeUserId: null } },
|
|
58
|
-
{ key: 'my_tickets', label: 'Mine', icon: 'fa-user', filter: { assigneeUserId: ctx.user?.id } },
|
|
59
|
-
{ key: 'today', label: 'Today', icon: 'fa-calendar-day', filter: { createdAt: { $gte: new Date(new Date().setHours(0,0,0,0)).toISOString() } } },
|
|
60
|
-
{ key: 'overdue', label: 'Overdue', icon: 'fa-clock', filter: {
|
|
61
|
-
first_responded_at: null,
|
|
62
|
-
status: { $notIn: ['closed', 'resolved'] }
|
|
63
|
-
}}
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
// Save SQL configuration
|
|
67
|
-
if (ctx.flowSettingsEnabled) {
|
|
68
|
-
const today = new Date(new Date().setHours(0,0,0,0)).toISOString();
|
|
69
|
-
|
|
70
|
-
await ctx.sql.save({
|
|
71
|
-
uid: ctx.model.uid,
|
|
72
|
-
sql: \`
|
|
73
|
-
WITH ticket_stats AS (
|
|
74
|
-
SELECT
|
|
75
|
-
COUNT(*) as total,
|
|
76
|
-
COUNT(CASE WHEN status IN ('new', 'open') THEN 1 END) as new_count,
|
|
77
|
-
COUNT(CASE WHEN status = 'in_progress' THEN 1 END) as in_progress_count,
|
|
78
|
-
COUNT(CASE WHEN status = 'pending_customer' THEN 1 END) as pending_customer_count,
|
|
79
|
-
COUNT(CASE WHEN status = 'pending_sales' THEN 1 END) as pending_sales_count,
|
|
80
|
-
COUNT(CASE WHEN status = 'on_hold' THEN 1 END) as on_hold_count,
|
|
81
|
-
COUNT(CASE WHEN status = 'resolved' THEN 1 END) as resolved_count,
|
|
82
|
-
COUNT(CASE WHEN status = 'closed' THEN 1 END) as closed_count,
|
|
83
|
-
COUNT(CASE WHEN priority IN ('urgent', 'high') THEN 1 END) as high_priority_count,
|
|
84
|
-
COUNT(CASE WHEN problem_type IN ('technical', 'hardware', 'software') THEN 1 END) as technical_count,
|
|
85
|
-
COUNT(CASE WHEN "assigneeUserId" IS NULL THEN 1 END) as unassigned_count,
|
|
86
|
-
COUNT(CASE WHEN "assigneeUserId" = \${ctx.user?.id || 0} THEN 1 END) as my_tickets_count,
|
|
87
|
-
COUNT(CASE WHEN "createdAt" >= '\${today}' THEN 1 END) as today_count,
|
|
88
|
-
COUNT(CASE WHEN first_responded_at IS NULL AND status NOT IN ('closed', 'resolved') THEN 1 END) as overdue_count
|
|
89
|
-
FROM tickets
|
|
90
|
-
)
|
|
91
|
-
SELECT * FROM ticket_stats
|
|
92
|
-
\`,
|
|
93
|
-
dataSourceKey: 'main',
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Use SQLResource
|
|
98
|
-
ctx.useResource('SQLResource');
|
|
99
|
-
ctx.resource.setDataSourceKey('main');
|
|
100
|
-
ctx.resource.setFilterByTk(ctx.model.uid);
|
|
101
|
-
|
|
102
|
-
// Query statistics data
|
|
103
|
-
await ctx.resource.refresh();
|
|
104
|
-
const stats = ctx.resource.getData()[0] || {};
|
|
105
|
-
|
|
106
|
-
// Map statistics data
|
|
107
|
-
const statMapping = {
|
|
108
|
-
'all': stats.total || 0,
|
|
109
|
-
'new': stats.new_count || 0,
|
|
110
|
-
'in_progress': stats.in_progress_count || 0,
|
|
111
|
-
'pending_customer': stats.pending_customer_count || 0,
|
|
112
|
-
'pending_sales': stats.pending_sales_count || 0,
|
|
113
|
-
'on_hold': stats.on_hold_count || 0,
|
|
114
|
-
'resolved': stats.resolved_count || 0,
|
|
115
|
-
'closed': stats.closed_count || 0,
|
|
116
|
-
'high_priority': stats.high_priority_count || 0,
|
|
117
|
-
'technical': stats.technical_count || 0,
|
|
118
|
-
'unassigned': stats.unassigned_count || 0,
|
|
119
|
-
'my_tickets': stats.my_tickets_count || 0,
|
|
120
|
-
'today': stats.today_count || 0,
|
|
121
|
-
'overdue': stats.overdue_count || 0
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
// Apply filter
|
|
125
|
-
function applyFilter(filterKey) {
|
|
126
|
-
const config = filterConfigs.find(c => c.key === filterKey);
|
|
127
|
-
if (!config) return;
|
|
128
|
-
|
|
129
|
-
try {
|
|
130
|
-
const targetModel = ctx.engine.getModel(ticketsBlockUid);
|
|
131
|
-
if (!targetModel) {
|
|
132
|
-
ctx.message.warning(\`Target block not found (UID: \${ticketsBlockUid})\`);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Clear previous filters
|
|
137
|
-
if (targetModel.resource.filters && targetModel.resource.filters[ctx.model.uid]) {
|
|
138
|
-
delete targetModel.resource.filters[ctx.model.uid];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Apply new filter
|
|
142
|
-
if (config.filter) {
|
|
143
|
-
targetModel.resource.addFilterGroup(ctx.model.uid, config.filter);
|
|
144
|
-
if (filterKey === 'all') {
|
|
145
|
-
ctx.message.info('Showing all tickets');
|
|
146
|
-
} else {
|
|
147
|
-
ctx.message.success(\`Applied filter: \${config.label}\`);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Refresh target block
|
|
152
|
-
targetModel.resource.refresh();
|
|
153
|
-
} catch (error) {
|
|
154
|
-
ctx.message.error('Filter failed: ' + error.message);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Calculate visible filters based on container width
|
|
159
|
-
function calculateVisibleFilters() {
|
|
160
|
-
const containerWidth = ctx.element.offsetWidth || 800;
|
|
161
|
-
const buttonWidth = 120;
|
|
162
|
-
const gap = 6;
|
|
163
|
-
const padding = 16;
|
|
164
|
-
const moreButtonWidth = 80;
|
|
165
|
-
|
|
166
|
-
const availableWidth = containerWidth - padding - moreButtonWidth;
|
|
167
|
-
const maxVisible = Math.floor(availableWidth / (buttonWidth + gap));
|
|
168
|
-
|
|
169
|
-
return Math.min(Math.max(3, maxVisible), filterConfigs.length);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Render function
|
|
173
|
-
function render() {
|
|
174
|
-
// Calculate how many filters to show based on container width
|
|
175
|
-
const maxVisible = calculateVisibleFilters();
|
|
176
|
-
const needsMore = filterConfigs.length > maxVisible;
|
|
177
|
-
|
|
178
|
-
// Determine filters to display
|
|
179
|
-
const displayFilters = isExpanded ? filterConfigs : filterConfigs.slice(0, maxVisible);
|
|
180
|
-
|
|
181
|
-
ctx.element.innerHTML = \`
|
|
182
|
-
<div style="padding: 8px; background: white; border-radius: 8px;">
|
|
183
|
-
<div style="display: flex; gap: 6px; flex-wrap: wrap;">
|
|
184
|
-
\${displayFilters.map(config => {
|
|
185
|
-
const count = statMapping[config.key] || 0;
|
|
186
|
-
const isActive = selectedFilter === config.key;
|
|
187
|
-
|
|
188
|
-
return \`
|
|
189
|
-
<button class="filter-btn" data-key="\${config.key}" style="
|
|
190
|
-
position: relative;
|
|
191
|
-
display: inline-flex;
|
|
192
|
-
align-items: center;
|
|
193
|
-
justify-content: center;
|
|
194
|
-
gap: 5px;
|
|
195
|
-
height: 32px;
|
|
196
|
-
padding: 0px 12px;
|
|
197
|
-
font-size: 14px;
|
|
198
|
-
font-weight: 400;
|
|
199
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
200
|
-
white-space: nowrap;
|
|
201
|
-
text-align: center;
|
|
202
|
-
border: 1px solid \${isActive ? 'transparent' : '#d9d9d9'};
|
|
203
|
-
border-radius: 6px;
|
|
204
|
-
background: \${isActive ? '#1677ff' : '#fff'};
|
|
205
|
-
color: \${isActive ? '#fff' : 'rgba(0,0,0,0.88)'};
|
|
206
|
-
box-shadow: \${isActive ? '0 2px 0 rgba(5,145,255,0.1)' : 'none'};
|
|
207
|
-
cursor: pointer;
|
|
208
|
-
transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
209
|
-
user-select: none;
|
|
210
|
-
touch-action: manipulation;
|
|
211
|
-
outline: none;
|
|
212
|
-
-webkit-appearance: button;
|
|
213
|
-
box-sizing: border-box;
|
|
214
|
-
">
|
|
215
|
-
<i class="fas \${config.icon}" style="
|
|
216
|
-
font-size: 13px;
|
|
217
|
-
opacity: \${isActive ? '1' : '0.75'};
|
|
218
|
-
"></i>
|
|
219
|
-
<span>\${config.label}</span>
|
|
220
|
-
<span style="
|
|
221
|
-
background: \${isActive ? 'rgba(255,255,255,0.25)' : '#f0f0f0'};
|
|
222
|
-
color: \${isActive ? '#fff' : 'rgba(0,0,0,0.65)'};
|
|
223
|
-
padding: 0 5px;
|
|
224
|
-
height: 18px;
|
|
225
|
-
line-height: 18px;
|
|
226
|
-
border-radius: 9px;
|
|
227
|
-
font-size: 12px;
|
|
228
|
-
font-weight: 400;
|
|
229
|
-
min-width: 20px;
|
|
230
|
-
text-align: center;
|
|
231
|
-
display: inline-block;
|
|
232
|
-
">\${count}</span>
|
|
233
|
-
</button>
|
|
234
|
-
\`;
|
|
235
|
-
}).join('')}
|
|
236
|
-
|
|
237
|
-
\${needsMore ? \`
|
|
238
|
-
<button class="filter-btn" id="toggle-more" style="
|
|
239
|
-
position: relative;
|
|
240
|
-
display: inline-flex;
|
|
241
|
-
align-items: center;
|
|
242
|
-
justify-content: center;
|
|
243
|
-
gap: 5px;
|
|
244
|
-
height: 32px;
|
|
245
|
-
padding: 0px 12px;
|
|
246
|
-
font-size: 14px;
|
|
247
|
-
font-weight: 400;
|
|
248
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
249
|
-
white-space: nowrap;
|
|
250
|
-
text-align: center;
|
|
251
|
-
border: 1px solid #d9d9d9;
|
|
252
|
-
border-radius: 6px;
|
|
253
|
-
background: #fff;
|
|
254
|
-
color: #1677ff;
|
|
255
|
-
box-shadow: none;
|
|
256
|
-
cursor: pointer;
|
|
257
|
-
transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
258
|
-
user-select: none;
|
|
259
|
-
touch-action: manipulation;
|
|
260
|
-
outline: none;
|
|
261
|
-
-webkit-appearance: button;
|
|
262
|
-
box-sizing: border-box;
|
|
263
|
-
">
|
|
264
|
-
<i class="fas fa-chevron-\${isExpanded ? 'up' : 'down'}" style="
|
|
265
|
-
font-size: 12px;
|
|
266
|
-
opacity: 0.75;
|
|
267
|
-
"></i>
|
|
268
|
-
<span>\${isExpanded ? 'Less' : 'More'}</span>
|
|
269
|
-
</button>
|
|
270
|
-
\` : ''}
|
|
271
|
-
</div>
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
<style>
|
|
275
|
-
.filter-btn:hover:not([style*="background: #1677ff"]) {
|
|
276
|
-
border-color: #4096ff !important;
|
|
277
|
-
color: #1677ff !important;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.filter-btn:active {
|
|
281
|
-
transform: scale(0.98);
|
|
282
|
-
}
|
|
283
|
-
</style>
|
|
284
|
-
\`;
|
|
285
|
-
|
|
286
|
-
// Bind events
|
|
287
|
-
bindEvents();
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// Bind events
|
|
291
|
-
function bindEvents() {
|
|
292
|
-
const container = ctx.element.querySelector('div');
|
|
293
|
-
if (container) {
|
|
294
|
-
container.addEventListener('click', (e) => {
|
|
295
|
-
const btn = e.target.closest('.filter-btn');
|
|
296
|
-
if (btn && !btn.id) {
|
|
297
|
-
const key = btn.dataset.key;
|
|
298
|
-
selectedFilter = selectedFilter === key ? 'all' : key;
|
|
299
|
-
applyFilter(selectedFilter);
|
|
300
|
-
render();
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// Expand/collapse more
|
|
304
|
-
if (e.target.closest('#toggle-more')) {
|
|
305
|
-
isExpanded = !isExpanded;
|
|
306
|
-
render();
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// Handle window resize
|
|
313
|
-
let resizeTimeout;
|
|
314
|
-
window.addEventListener('resize', () => {
|
|
315
|
-
clearTimeout(resizeTimeout);
|
|
316
|
-
resizeTimeout = setTimeout(() => {
|
|
317
|
-
render();
|
|
318
|
-
}, 250);
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
// Listen for data refresh
|
|
322
|
-
ctx.resource.on('refresh', () => {
|
|
323
|
-
const newStats = ctx.resource.getData()[0] || {};
|
|
324
|
-
|
|
325
|
-
// Update statistics data
|
|
326
|
-
Object.assign(stats, newStats);
|
|
327
|
-
|
|
328
|
-
// Update mapping
|
|
329
|
-
statMapping['all'] = newStats.total || 0;
|
|
330
|
-
statMapping['new'] = newStats.new_count || 0;
|
|
331
|
-
statMapping['in_progress'] = newStats.in_progress_count || 0;
|
|
332
|
-
statMapping['pending_customer'] = newStats.pending_customer_count || 0;
|
|
333
|
-
statMapping['pending_sales'] = newStats.pending_sales_count || 0;
|
|
334
|
-
statMapping['on_hold'] = newStats.on_hold_count || 0;
|
|
335
|
-
statMapping['resolved'] = newStats.resolved_count || 0;
|
|
336
|
-
statMapping['closed'] = newStats.closed_count || 0;
|
|
337
|
-
statMapping['high_priority'] = newStats.high_priority_count || 0;
|
|
338
|
-
statMapping['technical'] = newStats.technical_count || 0;
|
|
339
|
-
statMapping['unassigned'] = newStats.unassigned_count || 0;
|
|
340
|
-
statMapping['my_tickets'] = newStats.my_tickets_count || 0;
|
|
341
|
-
statMapping['today'] = newStats.today_count || 0;
|
|
342
|
-
statMapping['overdue'] = newStats.overdue_count || 0;
|
|
343
|
-
|
|
344
|
-
render();
|
|
345
|
-
});`
|
|
346
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
name: string;
|
|
11
|
-
content: string;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var js_action_exports = {};
|
|
28
|
-
__export(js_action_exports, {
|
|
29
|
-
default: () => js_action_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(js_action_exports);
|
|
32
|
-
var js_action_default = {
|
|
33
|
-
name: "js-action-model",
|
|
34
|
-
content: String.raw`# JSActionModel
|
|
35
|
-
|
|
36
|
-
JSActionModel 提供了在按钮点击时执行自定义 JavaScript 的能力,适用于 collection 操作和 record 操作(单行操作)。脚本会在沙箱中运行,默认暴露 Flow 上下文,可调用资源、消息提示、弹窗等 API。
|
|
37
|
-
|
|
38
|
-
## JSCollectionActionModel
|
|
39
|
-
|
|
40
|
-
\`\`\`javascript
|
|
41
|
-
const rows = ctx.resource?.getSelectedRows?.() || [];
|
|
42
|
-
if (!rows.length) {
|
|
43
|
-
(ctx.message?.warning ?? console.warn)('请至少勾选一条记录');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const ids = rows.map((item) => item.id).join(', ');
|
|
47
|
-
if (ctx.viewer?.drawer) {
|
|
48
|
-
await ctx.viewer.drawer({
|
|
49
|
-
width: '40%',
|
|
50
|
-
content: '<div style="padding:16px;font:14px/1.6 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;">'
|
|
51
|
-
+ '<h3 style="margin:0 0 12px;">批量操作</h3>'
|
|
52
|
-
+ '<div>勾选的 ID:' + ids + '</div>'
|
|
53
|
-
+ '<div style="color:#999;margin-top:12px;">实际项目中可以在这里调用 ctx.api 或 ctx.resource 执行批量更新。</div>'
|
|
54
|
-
+ '</div>',
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
(ctx.message?.success ?? console.log)('演示完成,共选中 ' + rows.length + ' 条');
|
|
58
|
-
\`\`\`
|
|
59
|
-
|
|
60
|
-
常用上下文:
|
|
61
|
-
|
|
62
|
-
- \`ctx.resource\`:当前区块的 \`MultiRecordResource\`,可调用 \`getSelectedRows()\`、\`refresh()\` 等方法。
|
|
63
|
-
- \`ctx.collection\` / \`ctx.dataSource\`:当前集合、数据源实例,可读取字段信息或拼接请求。
|
|
64
|
-
- \`ctx.message\` / \`ctx.modal\` / \`ctx.viewer\`:Ant Design 的提示、弹窗、抽屉等能力。
|
|
65
|
-
- \`ctx.api\`:已经注入的 APIClient,可发起自定义请求。
|
|
66
|
-
- 其他通用能力:\`ctx.runjs\`、\`ctx.t\`、\`ctx.logger\` 等。
|
|
67
|
-
|
|
68
|
-
典型场景:批量处理、导出选中、快速标记状态等。示例演示了在表格顶部放置批量按钮,读取选中行并弹出自定义抽屉。
|
|
69
|
-
|
|
70
|
-
## JSRecordActionModel
|
|
71
|
-
|
|
72
|
-
\`\`\`javascript
|
|
73
|
-
if (!ctx.record) {
|
|
74
|
-
(ctx.message?.error ?? console.error)('未读取到当前记录');
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (ctx.viewer?.drawer) {
|
|
78
|
-
await ctx.viewer.drawer({
|
|
79
|
-
width: '40%',
|
|
80
|
-
content: '<div style="padding:16px;font:14px/1.6 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;">'
|
|
81
|
-
+ '<h3 style="margin:0 0 12px;">记录详情</h3>'
|
|
82
|
-
+ '<div>ID:' + ctx.record.id + '</div>'
|
|
83
|
-
+ '<div>标题:' + ctx.record.title + '</div>'
|
|
84
|
-
+ '<div>负责人:' + ctx.record.owner + '</div>'
|
|
85
|
-
+ '<div>状态:' + ctx.record.status + '</div>'
|
|
86
|
-
+ '</div>',
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
(ctx.message?.success ?? console.log)('已查看记录 ' + ctx.record.title);
|
|
90
|
-
\`\`\`
|
|
91
|
-
|
|
92
|
-
常用上下文:
|
|
93
|
-
|
|
94
|
-
- \`ctx.record\`:当前行数据;\`ctx.filterByTk\`:主键值。
|
|
95
|
-
- \`ctx.collection\` / \`ctx.resource\`:区块所在集合及资源,单记录场景通常是 \`SingleRecordResource\`。
|
|
96
|
-
- \`ctx.message\` / \`ctx.viewer\` / \`ctx.modal\`:用于反馈结果或打开浮层。
|
|
97
|
-
- \`ctx.api\`:在行内直接发起接口请求(如触发审批、调用 webhook 等)。
|
|
98
|
-
|
|
99
|
-
典型场景:行内查看详情、触发外部请求、快速跳转。示例展示了行内“查看详情”按钮,通过 \`ctx.viewer.drawer\` 打开自定义抽屉。
|
|
100
|
-
|
|
101
|
-
> 提示:脚本运行在安全环境,不建议直接操作 DOM 以外的全局对象;`
|
|
102
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
name: string;
|
|
11
|
-
content: string;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|