@nocobase/plugin-ai 2.3.0-alpha.1 → 2.3.0-beta.10
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/docs/nocobase/ai-dev/watermark-plugin.md +2 -0
- package/dist/ai/docs/nocobase/ai-employees/block/ai-chat-box.md +133 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/documents.md +1 -1
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/index.md +11 -7
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/settings.md +12 -8
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/rag.md +43 -13
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/vector-database.md +3 -3
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/knowledge/create-document.md +1 -1
- package/dist/ai/docs/nocobase/api/app/env.md +2 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/create.md +4 -3
- package/dist/ai/docs/nocobase/building-tips/ai-fill-js-block-form.md +1092 -0
- package/dist/ai/docs/nocobase/data-sources/calendar/calendar-collection.md +100 -3
- package/dist/ai/docs/nocobase/data-sources/collection-comment/index.md +92 -39
- package/dist/ai/docs/nocobase/data-sources/collection-sql/index.md +150 -29
- package/dist/ai/docs/nocobase/data-sources/collection-tree/index.md +93 -5
- package/dist/ai/docs/nocobase/data-sources/collection-view/index.md +226 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/china-region.md +122 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/collection-select.md +105 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/json.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/nano-id.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/snowflake-id.md +108 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/sort.md +3 -19
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/uuid.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/associations/index.md +44 -8
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/color.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/email.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/icon.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/input.md +112 -8
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/integer.md +103 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/number.md +103 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/password.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/percent.md +104 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/phone.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/textarea.md +99 -8
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/url.md +103 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/checkbox-group.md +105 -3
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/checkbox.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/china-region.md +108 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/multiple-select.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/radio-group.md +106 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/select.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/date.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/datetime-without-tz.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/datetime.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/index.md +53 -47
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/time.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/unix-timestamp.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/circle.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/line.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/point.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/polygon.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/index.md +62 -16
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/markdown.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/rich-text.md +105 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/created-at.md +105 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/created-by.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/space.md +100 -6
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/table-oid.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/updated-at.md +104 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/updated-by.md +104 -6
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/validation.md +68 -58
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection.md +32 -13
- package/dist/ai/docs/nocobase/data-sources/data-modeling/index.md +41 -33
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mariadb/index.md +114 -6
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mssql/index.md +117 -6
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mysql/index.md +103 -6
- package/dist/ai/docs/nocobase/data-sources/data-source-external-nocobase/index.md +75 -73
- package/dist/ai/docs/nocobase/data-sources/data-source-external-oracle/index.md +129 -11
- package/dist/ai/docs/nocobase/data-sources/data-source-external-postgres/index.md +110 -6
- package/dist/ai/docs/nocobase/data-sources/data-source-kingbase/index.md +75 -49
- package/dist/ai/docs/nocobase/data-sources/data-source-main/general-collection.md +116 -15
- package/dist/ai/docs/nocobase/data-sources/data-source-main/index.md +92 -62
- package/dist/ai/docs/nocobase/data-sources/data-source-main/inheritance-collection.md +97 -10
- package/dist/ai/docs/nocobase/data-sources/data-source-manager/external-database.md +97 -58
- package/dist/ai/docs/nocobase/data-sources/data-source-manager/index.md +32 -24
- package/dist/ai/docs/nocobase/data-sources/data-source-rest-api/index.md +115 -153
- package/dist/ai/docs/nocobase/data-sources/external/clickhouse.md +124 -0
- package/dist/ai/docs/nocobase/data-sources/external/doris.md +130 -0
- package/dist/ai/docs/nocobase/data-sources/external/index.md +140 -0
- package/dist/ai/docs/nocobase/data-sources/external/kingbase.md +129 -0
- package/dist/ai/docs/nocobase/data-sources/external/mariadb.md +126 -0
- package/dist/ai/docs/nocobase/data-sources/external/mssql.md +129 -0
- package/dist/ai/docs/nocobase/data-sources/external/mysql.md +115 -0
- package/dist/ai/docs/nocobase/data-sources/external/nocobase.md +159 -0
- package/dist/ai/docs/nocobase/data-sources/external/oceanbase.md +126 -0
- package/dist/ai/docs/nocobase/data-sources/external/oracle.md +158 -0
- package/dist/ai/docs/nocobase/data-sources/external/postgresql.md +122 -0
- package/dist/ai/docs/nocobase/data-sources/external/rest-api.md +245 -0
- package/dist/ai/docs/nocobase/data-sources/field-attachment-url/index.md +100 -12
- package/dist/ai/docs/nocobase/data-sources/field-encryption/index.md +48 -47
- package/dist/ai/docs/nocobase/data-sources/field-formula/index.md +99 -5
- package/dist/ai/docs/nocobase/data-sources/field-markdown-vditor/index.md +105 -5
- package/dist/ai/docs/nocobase/data-sources/field-sequence/index.md +102 -5
- package/dist/ai/docs/nocobase/data-sources/field-signature/index.md +18 -16
- package/dist/ai/docs/nocobase/data-sources/field-sort/index.md +76 -73
- package/dist/ai/docs/nocobase/data-sources/file-manager/field-attachment.md +101 -7
- package/dist/ai/docs/nocobase/data-sources/file-manager/file-collection.md +101 -14
- package/dist/ai/docs/nocobase/data-sources/index.md +49 -33
- package/dist/ai/docs/nocobase/data-sources/main/index.md +130 -0
- package/dist/ai/docs/nocobase/data-sources/main/kingbase.md +147 -0
- package/dist/ai/docs/nocobase/data-sources/main/mariadb.md +59 -0
- package/dist/ai/docs/nocobase/data-sources/main/mysql.md +59 -0
- package/dist/ai/docs/nocobase/data-sources/main/oceanbase.md +62 -0
- package/dist/ai/docs/nocobase/data-sources/main/postgresql.md +61 -0
- package/dist/ai/docs/nocobase/file-manager/file-preview/index.md +44 -3
- package/dist/ai/docs/nocobase/file-manager/stable-url.md +1 -1
- package/dist/ai/docs/nocobase/file-manager/storage/aliyun-oss.md +100 -3
- package/dist/ai/docs/nocobase/file-manager/storage/index.md +76 -26
- package/dist/ai/docs/nocobase/file-manager/storage/local.md +4 -2
- package/dist/ai/docs/nocobase/file-manager/storage/s3-pro.md +58 -7
- package/dist/ai/docs/nocobase/get-started/installation/docker-nginx.mdx +4 -1
- package/dist/ai/docs/nocobase/get-started/installation/docker.mdx +2 -0
- package/dist/ai/docs/nocobase/get-started/installation/env.md +13 -1
- package/dist/ai/docs/nocobase/nocobase-cli/production/reverse-proxy/caddy.md +28 -5
- package/dist/ai/docs/nocobase/nocobase-cli/production/reverse-proxy/nginx.md +25 -0
- package/dist/ai/docs/nocobase/ops-management/migration-manager/built-in-tables.md +1 -2
- package/dist/ai/docs/nocobase/plugin-development/build.md +10 -4
- package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +1 -1
- package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-action.md +2 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-block.md +2 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-field.md +2 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/fullstack-plugin.md +2 -0
- package/dist/ai/docs/nocobase/plugin-development/client/examples/settings-page.md +2 -0
- package/dist/ai/docs/nocobase/plugin-development/common/i18n.md +3 -3
- package/dist/ai/docs/nocobase/plugin-development/server/cache.md +1 -1
- package/dist/ai/docs/nocobase/plugin-development/server/collections.md +0 -6
- package/dist/ai/docs/nocobase/plugin-development/server/command.md +2 -2
- package/dist/ai/docs/nocobase/plugin-development/server/context.md +2 -2
- package/dist/ai/docs/nocobase/plugin-development/server/i18n.md +4 -4
- package/dist/ai/docs/nocobase/plugin-development/write-your-first-plugin.md +91 -43
- package/dist/ai/docs/nocobase/runjs/context/ai.md +194 -4
- package/dist/ai/docs/nocobase/security/guide.md +17 -2
- package/dist/ai/docs/nocobase/users-permissions/sync/index.md +8 -1
- package/dist/ai/docs/nocobase/users-permissions/sync/sources/dingtalk.md +138 -0
- package/dist/ai/docs/nocobase/users-permissions/sync/sources/ldap.md +87 -0
- package/dist/ai/docs/nocobase/workflow/nodes/javascript.md +21 -1
- package/dist/ai/tools/executeFrontendTool.d.ts +10 -0
- package/dist/ai/tools/executeFrontendTool.js +86 -0
- package/dist/ai/tools/getSkill.js +1 -1
- package/dist/ai/tools/knowledge-base-retrieve.js +3 -1
- package/dist/ai/tools/loadFrontendTool.d.ts +10 -0
- package/dist/ai/tools/loadFrontendTool.js +99 -0
- package/dist/client/244.aeb24ce76c510b34.js +10 -0
- package/dist/client/{525.203778500aca5d05.js → 525.94dd4136c1361477.js} +1 -1
- package/dist/client/681.6ffbc9329b9ac242.js +10 -0
- package/dist/client/705.1d735e63c25f66a8.js +10 -0
- package/dist/client/index.d.ts +1 -3
- package/dist/client/index.js +8 -8
- package/dist/client-v2/244.ee9ec45eac0eb99f.js +10 -0
- package/dist/client-v2/420.a5b929a5e7f330be.js +10 -0
- package/dist/client-v2/681.6890caa389564ff7.js +10 -0
- package/dist/client-v2/705.00c101bef403fb44.js +10 -0
- package/dist/client-v2/ai-employees/AIEmployeeShortcut.d.ts +2 -0
- package/dist/client-v2/ai-employees/AddContextButton.d.ts +2 -0
- package/dist/client-v2/ai-employees/chatbox/components/AIEmployeeSwitcher.d.ts +1 -0
- package/dist/client-v2/ai-employees/chatbox/components/ChatBoxUnreadBadge.d.ts +17 -0
- package/dist/client-v2/ai-employees/chatbox/components/Conversations.d.ts +9 -1
- package/dist/client-v2/ai-employees/chatbox/components/MessageRenderers.d.ts +1 -1
- package/dist/client-v2/ai-employees/chatbox/components/Messages.d.ts +5 -1
- package/dist/client-v2/ai-employees/chatbox/components/ModelSwitcher.d.ts +4 -0
- package/dist/client-v2/ai-employees/chatbox/components/Sender.d.ts +33 -1
- package/dist/client-v2/ai-employees/chatbox/components/index.d.ts +1 -0
- package/dist/client-v2/ai-employees/chatbox/hooks/reasoning-stream.d.ts +10 -0
- package/dist/client-v2/ai-employees/chatbox/hooks/useChat.d.ts +8 -5
- package/dist/client-v2/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +3 -2
- package/dist/client-v2/ai-employees/chatbox/hooks/useChatBoxEffect.d.ts +2 -1
- package/dist/client-v2/ai-employees/chatbox/hooks/useChatConversationActions.d.ts +3 -2
- package/dist/client-v2/ai-employees/chatbox/hooks/useChatMessageActions.d.ts +4 -2
- package/dist/client-v2/ai-employees/chatbox/hooks/useToolCallActions.d.ts +3 -1
- package/dist/client-v2/ai-employees/chatbox/hooks/useUploadFiles.d.ts +13 -3
- package/dist/client-v2/ai-employees/chatbox/hooks/useWorkflowTasks.d.ts +3 -2
- package/dist/client-v2/ai-employees/chatbox/index.d.ts +17 -0
- package/dist/client-v2/ai-employees/chatbox/roles.d.ts +2 -153
- package/dist/client-v2/ai-employees/chatbox/stores/chat-box.d.ts +46 -33
- package/dist/client-v2/ai-employees/chatbox/stores/chat-conversations.d.ts +7 -7
- package/dist/client-v2/ai-employees/chatbox/stores/chat-messages.d.ts +23 -18
- package/dist/client-v2/ai-employees/chatbox/stores/chat-sender.d.ts +43 -0
- package/dist/client-v2/ai-employees/chatbox/stores/chat-tool-call.d.ts +6 -5
- package/dist/client-v2/ai-employees/chatbox/stores/chat-tools.d.ts +11 -5
- package/dist/client-v2/ai-employees/chatbox/stores/mounted-chat-boxes.d.ts +20 -0
- package/dist/client-v2/ai-employees/chatbox/stores/runtime.d.ts +43 -0
- package/dist/client-v2/ai-employees/chatbox/stores/workflow-tasks.d.ts +22 -10
- package/dist/client-v2/ai-employees/chatbox/upload.d.ts +19 -0
- package/dist/client-v2/ai-employees/chatbox/utils.d.ts +28 -4
- package/dist/client-v2/ai-employees/frontend-tools.d.ts +11 -0
- package/dist/client-v2/ai-employees/tools/SuggestionsOptionsCard.d.ts +1 -1
- package/dist/client-v2/ai-employees/tools/WorkflowTaskOutputCard.d.ts +1 -1
- package/dist/client-v2/ai-employees/types.d.ts +30 -0
- package/dist/client-v2/block/ai-chat-box/AIChatBoxBlockModel.d.ts +21 -0
- package/dist/client-v2/block/ai-chat-box/AIChatBoxCoreModel.d.ts +13 -0
- package/dist/client-v2/{ai-employees/chatbox/components/DebugPanel.d.ts → block/ai-chat-box/components/AIChatBoxCoreView.d.ts} +1 -1
- package/dist/client-v2/block/ai-chat-box/components/AIChatBoxView.d.ts +12 -0
- package/dist/client-v2/block/ai-chat-box/index.d.ts +14 -0
- package/dist/client-v2/block/ai-chat-box/settings.d.ts +12 -0
- package/dist/client-v2/block/ai-chat-box/sub-models.d.ts +26 -0
- package/dist/client-v2/block/ai-chat-box/types.d.ts +38 -0
- package/dist/client-v2/block/ai-chat-box/utils.d.ts +26 -0
- package/dist/client-v2/index.d.ts +3 -5
- package/dist/client-v2/index.js +3 -3
- package/dist/client-v2/llm-providers/forms.d.ts +2 -0
- package/dist/client-v2/llm-providers/index.d.ts +1 -0
- package/dist/client-v2/llm-services/model-select.d.ts +33 -0
- package/dist/client-v2/llm-services/utils.d.ts +1 -0
- package/dist/client-v2/manager/ai-manager.d.ts +10 -3
- package/dist/client-v2/manager/frontend-tool-registry.d.ts +30 -0
- package/dist/client-v2/models/ai-employees/AIEmployeeActionModel.d.ts +4 -1
- package/dist/client-v2/models/ai-employees/AIEmployeeShortcutModel.d.ts +8 -0
- package/dist/client-v2/pages/EmployeesPage.d.ts +12 -0
- package/dist/client-v2/pages/LLMServicesPage.d.ts +9 -4
- package/dist/client-v2/repositories/AIConfigRepository.d.ts +2 -0
- package/dist/client-v2/runjs/registerAIEmployeeRunJSFacade.d.ts +1 -0
- package/dist/client-v2/workflow/types.d.ts +1 -0
- package/dist/collections/ai-employees.d.ts +1 -0
- package/dist/collections/ai-employees.js +1 -0
- package/dist/common/ai-employee-validation.d.ts +17 -0
- package/dist/common/ai-employee-validation.js +67 -0
- package/dist/common/error-codes.d.ts +14 -0
- package/dist/common/error-codes.js +51 -0
- package/dist/common/frontend-tools.d.ts +26 -0
- package/dist/common/frontend-tools.js +57 -0
- package/dist/common/llm-service-models.d.ts +16 -0
- package/dist/common/llm-service-models.js +84 -0
- package/dist/externalVersion.js +19 -17
- package/dist/locale/de-DE.json +2 -1
- package/dist/locale/en-US.json +87 -5
- package/dist/locale/es-ES.json +2 -1
- package/dist/locale/fr-FR.json +2 -1
- package/dist/locale/hu-HU.json +2 -1
- package/dist/locale/id-ID.json +2 -1
- package/dist/locale/it-IT.json +2 -1
- package/dist/locale/ja-JP.json +2 -1
- package/dist/locale/ko-KR.json +2 -1
- package/dist/locale/nl-NL.json +2 -1
- package/dist/locale/pt-BR.json +2 -1
- package/dist/locale/ru-RU.json +2 -1
- package/dist/locale/tr-TR.json +2 -1
- package/dist/locale/uk-UA.json +2 -1
- package/dist/locale/vi-VN.json +2 -1
- package/dist/locale/zh-CN.json +87 -5
- package/dist/locale/zh-TW.json +2 -1
- package/dist/node_modules/@langchain/mistralai/package.json +1 -1
- package/dist/node_modules/@langchain/xai/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/package.json +1 -1
- package/dist/node_modules/just-bash/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-conversations.d.ts +4 -1
- package/dist/server/ai-employees/ai-conversations.js +2 -0
- package/dist/server/ai-employees/ai-employee.d.ts +32 -2
- package/dist/server/ai-employees/ai-employee.js +367 -79
- package/dist/server/ai-employees/ai-knowledge-base.d.ts +21 -1
- package/dist/server/ai-employees/ai-knowledge-base.js +87 -12
- package/dist/server/ai-employees/middleware/conversation.js +28 -22
- package/dist/server/ai-employees/middleware/index.d.ts +1 -0
- package/dist/server/ai-employees/middleware/index.js +2 -0
- package/dist/server/ai-employees/middleware/tool-result-integrity.d.ts +22 -0
- package/dist/server/ai-employees/middleware/tool-result-integrity.js +211 -0
- package/dist/server/ai-employees/reasoning-stream-state.d.ts +23 -0
- package/dist/server/ai-employees/reasoning-stream-state.js +63 -0
- package/dist/server/collections/ai-conversations.js +5 -0
- package/dist/server/document-loader/constants.js +1 -1
- package/dist/server/features/knowledge-base.d.ts +2 -0
- package/dist/server/frontend-tools.d.ts +25 -0
- package/dist/server/frontend-tools.js +171 -0
- package/dist/server/llm-providers/common/reasoning.js +18 -10
- package/dist/server/llm-providers/deepseek/index.d.ts +10 -0
- package/dist/server/llm-providers/deepseek/index.js +32 -0
- package/dist/server/llm-providers/deepseek/provider.d.ts +57 -0
- package/dist/server/llm-providers/deepseek/provider.js +320 -0
- package/dist/server/llm-providers/deepseek/reasoning.d.ts +83 -0
- package/dist/server/llm-providers/deepseek/reasoning.js +285 -0
- package/dist/server/llm-providers/mistral.d.ts +1 -1
- package/dist/server/llm-providers/provider.d.ts +1 -0
- package/dist/server/llm-providers/provider.js +3 -0
- package/dist/server/llm-providers/shengsuanyun.d.ts +29 -0
- package/dist/server/llm-providers/shengsuanyun.js +114 -0
- package/dist/server/manager/ai-feature-manager.js +1 -1
- package/dist/server/manager/ai-manager.d.ts +3 -0
- package/dist/server/manager/ai-manager.js +7 -2
- package/dist/server/manager/work-context-handler.js +10 -3
- package/dist/server/migrations/20260501000000-ai-employee-knowledge-base-retrieval-strategy.d.ts +14 -0
- package/dist/server/migrations/20260501000000-ai-employee-knowledge-base-retrieval-strategy.js +49 -0
- package/dist/server/plugin.d.ts +1 -0
- package/dist/server/plugin.js +31 -0
- package/dist/server/resource/aiConversations.d.ts +2 -0
- package/dist/server/resource/aiConversations.js +33 -3
- package/dist/server/resource/aiEmployees.d.ts +2 -0
- package/dist/server/resource/aiEmployees.js +96 -0
- package/dist/server/resource/aiWorkflowTasks.js +9 -1
- package/dist/server/resource/llmServices.d.ts +11 -0
- package/dist/server/resource/llmServices.js +85 -0
- package/dist/server/types/ai-message.type.d.ts +4 -0
- package/dist/server/types/knowledge-base.type.d.ts +8 -3
- package/dist/server/workflow/nodes/employee/files.d.ts +1 -1
- package/dist/server/workflow/nodes/employee/files.js +48 -1
- package/dist/server/workflow/nodes/employee/index.js +7 -2
- package/dist/server/workflow/nodes/employee/types.d.ts +1 -0
- package/dist/swagger/common.d.ts +143 -0
- package/dist/swagger/common.js +144 -0
- package/dist/swagger/employees.d.ts +301 -0
- package/dist/swagger/employees.js +131 -0
- package/dist/swagger/index.d.ts +1617 -0
- package/dist/swagger/index.js +62 -0
- package/dist/swagger/llm.d.ts +563 -0
- package/dist/swagger/llm.js +255 -0
- package/dist/swagger/schemas.d.ts +757 -0
- package/dist/swagger/schemas.js +392 -0
- package/package.json +2 -2
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/vector-store.md +0 -24
- package/dist/ai/docs/nocobase/data-sources/development/index.md +0 -6
- package/dist/client/372.40eb52905e3f3049.js +0 -10
- package/dist/client/681.399948c18d753667.js +0 -10
- package/dist/client/705.380279da896021fb.js +0 -10
- package/dist/client-v2/372.8cc3fde09c9bec77.js +0 -10
- package/dist/client-v2/406.341be51205c674e0.js +0 -10
- package/dist/client-v2/681.082f4f1c7b841983.js +0 -10
- package/dist/client-v2/705.1d10027ff8cfdf79.js +0 -10
- package/dist/client-v2/ai-employees/chatbox/stores/create-selectors.d.ts +0 -46
- package/dist/client-v2/ai-employees/chatbox/utils/normalizeTriggerTaskOptions.d.ts +0 -19
- package/dist/client-v2/debug-logger.d.ts +0 -52
- package/dist/server/llm-providers/deepseek.d.ts +0 -40
- package/dist/server/llm-providers/deepseek.js +0 -174
|
@@ -12,7 +12,7 @@ Building on the File Manager plugin, this adds support for S3 protocol-compatibl
|
|
|
12
12
|
|
|
13
13
|
1. Client-side upload: The file upload process does not go through the NocoBase server, but directly connects to the file storage service, providing a more efficient and faster upload experience.
|
|
14
14
|
|
|
15
|
-
2. Private access:
|
|
15
|
+
2. Private access: Signed URLs with an expiration are used by default. Unsigned URLs can also be generated for public buckets.
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
## Use Cases
|
|
@@ -39,6 +39,57 @@ Building on the File Manager plugin, this adds support for S3 protocol-compatibl
|
|
|
39
39
|
|
|
40
40
|

|
|
41
41
|
|
|
42
|
+
## URL Configuration
|
|
43
|
+
|
|
44
|
+
In addition to the File Manager's common NocoBase URL, Original URL, and Allow public access options, S3 Pro lets you configure upload and access URL formats separately and choose whether to use signed URLs. See [Storage Engine Overview](./index.md#file-urls-and-access-control) for the common options.
|
|
45
|
+
|
|
46
|
+
These options control different stages:
|
|
47
|
+
|
|
48
|
+
- NocoBase URL / Original URL controls which address the file record returns
|
|
49
|
+
- Allow public access controls whether file record view permissions are checked when a NocoBase URL is accessed
|
|
50
|
+
- Do not use signed URL controls whether the object storage service validates a URL signature
|
|
51
|
+
|
|
52
|
+
These settings can be combined independently. The recommended default is NocoBase URL, Allow public access unchecked, and signed URLs enabled.
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
### How to choose
|
|
57
|
+
|
|
58
|
+
| Use case | File URL | Allow public access | Do not use signed URL |
|
|
59
|
+
| --- | --- | --- | --- |
|
|
60
|
+
| Files must follow role and data permissions while the bucket remains private | NocoBase URL | Unchecked | Unchecked |
|
|
61
|
+
| A public NocoBase file address is required while the bucket remains private | NocoBase URL | Checked | Unchecked |
|
|
62
|
+
| An external service needs temporary access to the storage address | Original URL | Not applicable | Unchecked; configure Access URL expiration |
|
|
63
|
+
| A public bucket or CDN requires an unsigned original address | Original URL | Not applicable | Checked |
|
|
64
|
+
|
|
65
|
+
### Upload URL format
|
|
66
|
+
|
|
67
|
+
Upload URL format controls the S3 URL used by the client when uploading files. Select the format supported by your storage service. The configuration form displays an example based on the current Endpoint, Bucket, and path:
|
|
68
|
+
|
|
69
|
+
- Bucket as subdomain: `https://bucket-name.s3.example.com/path/to/object`
|
|
70
|
+
- Bucket as subpath: `https://s3.example.com/bucket-name/path/to/object`
|
|
71
|
+
- Ignore bucket: `https://upload.example.com/path/to/object`
|
|
72
|
+
|
|
73
|
+
### Access URL format
|
|
74
|
+
|
|
75
|
+
Access URL format controls whether the Bucket appears in the domain, in the path, or not at all when S3 Pro generates a file access address. It provides the same three formats as Upload URL format, but can be configured separately—for example, uploads can use an S3 Endpoint while access uses a CDN domain that does not include the Bucket.
|
|
76
|
+
|
|
77
|
+
This option affects Original URLs and the storage address that a NocoBase URL ultimately redirects to, but it does not change the NocoBase URL format itself.
|
|
78
|
+
|
|
79
|
+
### Do not use signed URL
|
|
80
|
+
|
|
81
|
+
S3 Pro uses signed URLs by default. A generated Original URL includes signature parameters, for example:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
https://bucket-name.s3.example.com/path/to/object?X-Amz-Signature=xxxx
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The signed URL remains valid for the configured Access URL expiration, and the bucket can remain private. When NocoBase URL is used, NocoBase generates or redirects to a signed address after the permission check succeeds.
|
|
88
|
+
|
|
89
|
+
When Do not use signed URL is checked, S3 Pro generates an address without signature parameters. The bucket and uploaded objects must then allow public read access, and Access URL expiration no longer takes effect.
|
|
90
|
+
|
|
91
|
+
Do not use signed URL only controls whether the storage service validates a signature; it does not change NocoBase file record permissions. If NocoBase URL is selected and Allow public access is unchecked, the request must still pass the NocoBase permission check first.
|
|
92
|
+
|
|
42
93
|
|
|
43
94
|
|
|
44
95
|
## Service Provider Configuration
|
|
@@ -146,9 +197,9 @@ Building on the File Manager plugin, this adds support for S3 protocol-compatibl
|
|
|
146
197
|

|
|
147
198
|
|
|
148
199
|
|
|
149
|
-
#### Public Access (Optional)
|
|
200
|
+
#### Unsigned Public Access (Optional)
|
|
150
201
|
|
|
151
|
-
|
|
202
|
+
Configure this only when unsigned URLs are required, because the Bucket and uploaded objects must allow public read access. If you only need to share a public NocoBase URL, check Allow public access and keep signed URLs enabled; the Bucket does not need to be public.
|
|
152
203
|
|
|
153
204
|
1. Go to the Permissions panel, scroll down to Object Ownership, click edit, and enable ACLs.
|
|
154
205
|
|
|
@@ -162,7 +213,7 @@ This is an optional configuration. Configure it when you need to make uploaded f
|
|
|
162
213
|

|
|
163
214
|
|
|
164
215
|
|
|
165
|
-
3. Check
|
|
216
|
+
3. Check Do not use signed URL in NocoBase.
|
|
166
217
|
|
|
167
218
|
|
|
168
219
|
#### Thumbnail Configuration (Optional)
|
|
@@ -193,7 +244,7 @@ This configuration is optional and is used to optimize image preview size or eff
|
|
|
193
244
|
5. In the NocoBase configuration, there are several points to note:
|
|
194
245
|
1. `Thumbnail rule`: Fill in image processing-related parameters, for example, `?width=100`. For details, refer to the [AWS documentation](https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/use-supported-query-param-edits.html).
|
|
195
246
|
2. `Access endpoint`: Fill in the value of Outputs -> ApiEndpoint after deployment.
|
|
196
|
-
3.
|
|
247
|
+
3. Access URL format: Select **Ignore bucket** because the bucket name is already included in the configuration and is not needed in the access URL.
|
|
197
248
|
|
|
198
249
|
|
|
199
250
|

|
|
@@ -312,7 +363,7 @@ This configuration is optional and should only be used when you need to optimize
|
|
|
312
363
|
|
|
313
364
|
1. Fill in the `Thumbnail rule` related parameters. For specific parameter settings, refer to [Image Processing Parameters](https://www.alibabacloud.com/help/en/object-storage-service/latest/process-images).
|
|
314
365
|
|
|
315
|
-
2.
|
|
366
|
+
2. Upload URL format and Access URL format can use the same setting.
|
|
316
367
|
|
|
317
368
|
#### Configuration Example
|
|
318
369
|
|
|
@@ -357,7 +408,7 @@ This configuration is optional and should only be used when you need to optimize
|
|
|
357
408
|
- **AccessKey ID** and **AccessKey Secret** are the values saved in the previous step.
|
|
358
409
|
- **Region**: A self-hosted MinIO does not have the concept of a Region, so it can be configured as "auto".
|
|
359
410
|
- **Endpoint**: Fill in the domain name or IP address of your deployment.
|
|
360
|
-
-
|
|
411
|
+
- Set Access URL format to Bucket as subpath.
|
|
361
412
|
|
|
362
413
|
#### Configuration Example
|
|
363
414
|
|
|
@@ -96,8 +96,11 @@ services:
|
|
|
96
96
|
- `./storage` must be mounted into both the `app` and `nginx` containers so they can share proxy config, static assets, and uploaded files
|
|
97
97
|
- The `nginx` container should wait until `nocobase.conf` is generated, then link it to `/etc/nginx/conf.d/default.conf` with `ln -sf`
|
|
98
98
|
- The generated config forwards both the `/files/` route under `APP_PUBLIC_PATH` and the root-level `/files/` route to NocoBase for authenticated file previews and downloads
|
|
99
|
+
- Before Nginx returns a legacy `/storage/uploads/` file through `alias`, the generated config uses `auth_request` to ask NocoBase to verify the login state; anonymous access returns `401` by default
|
|
99
100
|
- If you use an external Nginx container, let the `nginx` container handle the host port mapping. For testing, you can start with `13000:80`; in production, you usually expose the host `80` and `443` ports directly, while the `app` service does not need to expose its port to the host
|
|
100
101
|
|
|
102
|
+
If an existing program depends on anonymous access to `/storage/uploads/`, add `LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true` to `app.environment` and restart the application container. Do not remove or rewrite the `auth_request` in the generated config; the auth endpoint uses this variable to decide whether anonymous access is allowed. This variable does not change record-level permissions for `/files/`.
|
|
103
|
+
|
|
101
104
|
## If you use a local host Nginx
|
|
102
105
|
|
|
103
106
|
If your Nginx is installed directly on the host instead of running in a Docker container, it is better to use a separate `docker-compose.yml`. In this setup, the `app` service must expose a host port directly, and the proxy-related environment variables should use host-side values.
|
|
@@ -171,7 +174,7 @@ sudo systemctl reload nginx
|
|
|
171
174
|
|
|
172
175
|
If your host Nginx does not use the `conf.d` directory, replace the link target with your own config path. Usually it is safer to keep `nocobase.conf` as a file included from the `http {}` context instead of copying its content manually.
|
|
173
176
|
|
|
174
|
-
If you maintain Nginx yourself instead of using the generated config, make sure `/files/` and the corresponding route under `APP_PUBLIC_PATH` are forwarded to NocoBase before the SPA fallback rules. See [Nginx Reverse Proxy](../../nocobase-cli/production/reverse-proxy/nginx.md) for a complete example.
|
|
177
|
+
If you maintain Nginx yourself instead of using the generated config, make sure `/files/` and the corresponding route under `APP_PUBLIC_PATH` are forwarded to NocoBase before the SPA fallback rules. When serving `/storage/uploads/` through `alias`, you must also configure `auth_request` so the static directory cannot bypass the application login check. See [Nginx Reverse Proxy](../../nocobase-cli/production/reverse-proxy/nginx.md) for a complete example.
|
|
175
178
|
|
|
176
179
|
## Related links
|
|
177
180
|
|
|
@@ -660,6 +660,8 @@ If you also want to enable HTTPS, configure `443` and the certificate on the hos
|
|
|
660
660
|
|
|
661
661
|
The `location /` block in this root-path configuration also proxies `/api/`, `/ws`, and `/files/`. If you split static assets from application routes, make sure `/files/` is still forwarded to NocoBase and is not handled as a static directory.
|
|
662
662
|
|
|
663
|
+
Before returning a legacy `/storage/uploads/` file, the built-in Nginx asks NocoBase to verify the login state; anonymous access returns `401` by default. If a program already depended on anonymous access to these legacy URLs before an upgrade, add `LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true` to `app.environment` and restart the container. Keep forwarding this path from the host Nginx to the container. Do not expose the host upload directory directly with another `alias`, because that would bypass the check.
|
|
664
|
+
|
|
663
665
|
### Subpath deployment
|
|
664
666
|
|
|
665
667
|
If you want to deploy the app under a subpath, such as `https://your_domain.com/nocobase/`, configure the `APP_PUBLIC_PATH` environment variable first:
|
|
@@ -107,6 +107,18 @@ NocoBase uses cookies to maintain login state and to authorize [stable file URLs
|
|
|
107
107
|
Prefer serving the pages and the API from the same origin through a reverse proxy and leaving `API_BASE_URL` empty.
|
|
108
108
|
:::
|
|
109
109
|
|
|
110
|
+
### LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS
|
|
111
|
+
|
|
112
|
+
Controls whether legacy local file URLs under `/storage/uploads/` allow anonymous access. The default is `false`, so only signed-in users can access them.
|
|
113
|
+
|
|
114
|
+
If an existing integration depends on public access through these URLs, explicitly enable compatibility mode:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Restart the application after changing this variable. It affects only legacy `/storage/uploads/` URLs and does not change record-level permissions for `/files/`. Public access may expose uploaded files, so enable it only after confirming that the files are safe to publish.
|
|
121
|
+
|
|
110
122
|
### CORS_ORIGIN_WHITELIST
|
|
111
123
|
|
|
112
124
|
Whitelist of origins allowed to access the API cross-origin with credentials (cookies). Multiple origins are separated by commas. Empty by default.
|
|
@@ -392,7 +404,7 @@ SERVER_REQUEST_WHITELIST=api.example.com,*.trusted.com,10.0.0.0/8,127.0.0.1
|
|
|
392
404
|
|
|
393
405
|
**When not set**: All `http` / `https` outbound requests are allowed to keep existing behavior. However, if the target is a loopback, private, link-local, or metadata address, or if a domain resolves to one of these addresses, the server logs a warning.
|
|
394
406
|
|
|
395
|
-
**When set**:
|
|
407
|
+
**When set**: The initial request and every redirect destination must match a whitelist entry; non-matching requests will raise an error before the next request is sent. Future versions may gradually tighten the default behavior. If your deployment needs to access internal services, configure an explicit whitelist in advance.
|
|
396
408
|
|
|
397
409
|
Supported formats:
|
|
398
410
|
|
|
@@ -135,7 +135,7 @@ Taking `test2` as an example, key directories related to Caddy usually include:
|
|
|
135
135
|
In other words, handwritten configuration usually needs to cover at least the following types of entries:
|
|
136
136
|
|
|
137
137
|
- `v`: Redirect `/v` to `/v/`
|
|
138
|
-
- `uploads`: Expose upload directory
|
|
138
|
+
- `uploads`: Expose the upload directory after NocoBase authentication
|
|
139
139
|
- `dist`: Expose the front-end build product directory
|
|
140
140
|
- `oauth well-known`: Handle OAuth discovery paths
|
|
141
141
|
- `openid well-known`: Handle OpenID discovery paths
|
|
@@ -164,10 +164,31 @@ c.local.nocobase.com {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
handle_path /storage/uploads/* {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
route {
|
|
168
|
+
request_header -X-NocoBase-Auth-Set-Cookie
|
|
169
|
+
forward_auth host.docker.internal:56575 {
|
|
170
|
+
uri /api/auth:checkLegacyFileAccess
|
|
171
|
+
header_up X-App {query.__appName}
|
|
172
|
+
copy_headers Set-Cookie>X-NocoBase-Auth-Set-Cookie
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@refreshedAuth header X-NocoBase-Auth-Set-Cookie *
|
|
176
|
+
header @refreshedAuth Set-Cookie {header.X-NocoBase-Auth-Set-Cookie}
|
|
177
|
+
header Cache-Control "private, no-store"
|
|
178
|
+
header Content-Security-Policy sandbox
|
|
179
|
+
header X-Content-Type-Options nosniff
|
|
180
|
+
header Content-Disposition inline
|
|
181
|
+
|
|
182
|
+
@activeUploadedContent path_regexp activeUploadedContent (?i)\.(?:htm|html|pdf|svg|svgz|xht|xhtml|xml|xsl|xslt)$
|
|
183
|
+
header @activeUploadedContent Content-Disposition attachment
|
|
184
|
+
@download query download=1
|
|
185
|
+
header @download Content-Disposition attachment
|
|
186
|
+
@markdown path_regexp markdown (?i)\.md$
|
|
187
|
+
header @markdown Content-Type text/markdown
|
|
188
|
+
|
|
189
|
+
root * NB_CLI_ROOT/test2/storage/uploads
|
|
190
|
+
file_server
|
|
191
|
+
}
|
|
171
192
|
}
|
|
172
193
|
|
|
173
194
|
handle_path /dist/* {
|
|
@@ -258,6 +279,8 @@ This is usually less likely to miss details related to `/files/`, WebSockets, st
|
|
|
258
279
|
|
|
259
280
|
:::warning Note
|
|
260
281
|
|
|
282
|
+
URLs under `/storage/uploads/` are legacy local file URLs and must pass NocoBase sign-in authentication by default. Do not expose the upload directory with `file_server` alone, because that bypasses access control. The example above uses `forward_auth` to call the NocoBase auth endpoint before Caddy sends the file. Set `LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true` and restart the application only when anonymous access is explicitly required for compatibility.
|
|
283
|
+
|
|
261
284
|
`/files/` is an application route that must pass through NocoBase authorization. Do not handle it as a static directory or let it fall through to the SPA fallback. Forward it to the NocoBase backend and place the rule before `handle_path /*` and other front-end fallback rules.
|
|
262
285
|
|
|
263
286
|
If `APP_PUBLIC_PATH=/nocobase/` is configured, also forward `/nocobase/files/*`. Keep the root-level `/files/*` rule for compatibility with existing file URLs.
|
|
@@ -111,6 +111,7 @@ in:
|
|
|
111
111
|
- `NB_CLI_ROOT/test2/storage/...` The following are the application's own static resources and upload directories
|
|
112
112
|
- `app.conf` can be changed, but the NocoBase managed block must be retained
|
|
113
113
|
- `index-v1.html` and `index-v2.html` will automatically rewrite resource addresses according to the current env subpath, active client version, and `CDN_BASE_URL`
|
|
114
|
+
- `maps-http.conf` and `uploads-location.conf` protect legacy `/storage/uploads/` URLs together: the former resolves the sub-application parameter, and the latter runs an `auth_request` login check before Nginx returns a local file
|
|
114
115
|
|
|
115
116
|
:::warning note
|
|
116
117
|
|
|
@@ -154,6 +155,11 @@ location / {
|
|
|
154
155
|
For a CLI-hosted application like `test2`, a structure closer to a real deployment would usually look like this:
|
|
155
156
|
|
|
156
157
|
```nginx
|
|
158
|
+
map $request_uri $legacy_file_app {
|
|
159
|
+
default "";
|
|
160
|
+
~[?&]__appName=(?<legacy_file_app_name>[A-Za-z0-9_-]+)(?:&|$) $legacy_file_app_name;
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
server {
|
|
158
164
|
listen 80;
|
|
159
165
|
server_name c.local.nocobase.com;
|
|
@@ -165,6 +171,19 @@ server {
|
|
|
165
171
|
include NB_CLI_ROOT/.nocobase/proxy/nginx/snippets/mime-types.conf;
|
|
166
172
|
include NB_CLI_ROOT/.nocobase/proxy/nginx/snippets/gzip.conf;
|
|
167
173
|
|
|
174
|
+
location = /_nocobase_legacy_file_auth {
|
|
175
|
+
internal;
|
|
176
|
+
proxy_pass http://127.0.0.1:56575/api/auth:checkLegacyFileAccess;
|
|
177
|
+
proxy_pass_request_body off;
|
|
178
|
+
proxy_set_header Content-Length "";
|
|
179
|
+
proxy_set_header Cookie $http_cookie;
|
|
180
|
+
proxy_set_header Authorization $http_authorization;
|
|
181
|
+
proxy_set_header X-App $legacy_file_app;
|
|
182
|
+
proxy_set_header X-Original-URI $request_uri;
|
|
183
|
+
proxy_set_header Host $final_host;
|
|
184
|
+
proxy_set_header X-Forwarded-Proto $upstream_x_forwarded_proto;
|
|
185
|
+
}
|
|
186
|
+
|
|
168
187
|
location /storage/uploads/ {
|
|
169
188
|
alias NB_CLI_ROOT/test2/storage/uploads/;
|
|
170
189
|
include NB_CLI_ROOT/.nocobase/proxy/nginx/snippets/uploads-location.conf;
|
|
@@ -216,6 +235,8 @@ server {
|
|
|
216
235
|
}
|
|
217
236
|
```
|
|
218
237
|
|
|
238
|
+
The `map` directive must be placed in Nginx's `http {}` context, not inside `server {}` or `location {}`. It identifies a sub-application from the `__appName` query parameter in a legacy file URL. The `/api/` segment in `proxy_pass` must match the application's actual `API_BASE_PATH`; when `APP_PUBLIC_PATH` is configured, use the same prefix for both the upload location and auth endpoint.
|
|
239
|
+
|
|
219
240
|
There are two key points here:
|
|
220
241
|
|
|
221
242
|
- `NB_CLI_ROOT/.nocobase/proxy/nginx/...` The following are agent auxiliary files maintained by CLI
|
|
@@ -243,6 +264,10 @@ This is usually less likely to miss details related to `/files/`, WebSockets, st
|
|
|
243
264
|
|
|
244
265
|
If `APP_PUBLIC_PATH=/nocobase/` is configured, also forward `/nocobase/files/`. Keep the root-level `/files/` rule for compatibility with existing file URLs.
|
|
245
266
|
|
|
267
|
+
Legacy `/storage/uploads/` URLs also require sign-in by default. When serving files directly with `alias`, run an `auth_request` to NocoBase's `auth:checkLegacyFileAccess` endpoint first. Configuring only the static directory bypasses the login check. The `uploads-location.conf` snippet in the example already contains the `auth_request` directive; if you do not use the CLI snippets, add the equivalent logic to the upload location yourself.
|
|
268
|
+
|
|
269
|
+
If an existing integration must access legacy URLs anonymously, set `LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true` for the NocoBase application and restart it. The auth endpoint evaluates this setting, so do not regenerate or remove the Nginx `auth_request` configuration. The switch affects only `/storage/uploads/` and does not change record-level permissions for `/files/`.
|
|
270
|
+
|
|
246
271
|
:::
|
|
247
272
|
|
|
248
273
|
## How to handle HTTPS
|
|
@@ -336,9 +336,8 @@ The “Data type” column comes from built-in classification. System base data
|
|
|
336
336
|
| Table | Description | Data type | Default migration strategy | Version control | Backup/restore |
|
|
337
337
|
| --- | --- | --- | --- | --- | --- |
|
|
338
338
|
| `aiKnowledgeBaseDocs` | Document chunks and index metadata stored in knowledge bases | Business runtime data | Schema-only | Not included | Backed up |
|
|
339
|
-
| `aiKnowledgeBase` | Knowledge-base type, external ID, and base information | Business runtime data | Schema-only | Not included | Backed up |
|
|
339
|
+
| `aiKnowledgeBase` | Knowledge-base type, external ID, vector database, LLM service, embedding model, and base information | Business runtime data | Schema-only | Not included | Backed up |
|
|
340
340
|
| `aiVectorDatabases` | Vector database service and connection configuration | Business runtime data | Schema-only | Not included | Backed up |
|
|
341
|
-
| `aiVectorStoreConfig` | Relationship between vector database connections and embedding models | Business runtime data | Schema-only | Not included | Backed up |
|
|
342
341
|
|
|
343
342
|
### Environment variables
|
|
344
343
|
|
|
@@ -6,7 +6,7 @@ keywords: "plugin build,plugin package,yarn build,tar,build.config.ts,Rsbuild,ts
|
|
|
6
6
|
|
|
7
7
|
# Build and Package
|
|
8
8
|
|
|
9
|
-
After plugin development is complete, you need to go through two steps — build (compile source code) and package (generate `.
|
|
9
|
+
After plugin development is complete, you need to go through two steps — build (compile source code) and package (generate `.tgz`) — before distributing it to other NocoBase applications.
|
|
10
10
|
|
|
11
11
|
## Build Plugin
|
|
12
12
|
|
|
@@ -26,13 +26,13 @@ If the plugin is created in a source code repository, the first build will trigg
|
|
|
26
26
|
|
|
27
27
|
## Package Plugin
|
|
28
28
|
|
|
29
|
-
Packaging compresses the build artifacts into a `.
|
|
29
|
+
Packaging compresses the build artifacts into a `.tgz` file for easy upload to other environments:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
yarn nocobase tar @my-project/plugin-hello
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
The package file is output to `storage/tar/@my-project/plugin-hello.
|
|
35
|
+
The package file is output to `storage/tar/` by default, named `<package-name>-<version>.tgz` — for example, `storage/tar/@my-project/plugin-hello-0.1.0.tgz`.
|
|
36
36
|
|
|
37
37
|
You can also combine build and package into one step using the `--tar` flag:
|
|
38
38
|
|
|
@@ -42,7 +42,13 @@ yarn build @my-project/plugin-hello --tar
|
|
|
42
42
|
|
|
43
43
|
## Upload to Other NocoBase Applications
|
|
44
44
|
|
|
45
|
-
Upload and extract the `.
|
|
45
|
+
Upload and extract the `.tgz` file to the target application's `./storage/plugins` directory. For detailed steps, see [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx).
|
|
46
|
+
|
|
47
|
+
If the target application was created with the NocoBase CLI (`nb init`), you can also import it directly with `nb plugin import` instead of extracting it manually:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
nb plugin import /your/path/plugin-hello-0.1.0.tgz
|
|
51
|
+
```
|
|
46
52
|
|
|
47
53
|
### Enable a Plugin by Default
|
|
48
54
|
|
|
@@ -12,7 +12,7 @@ This page collects common pitfalls when developing client plugins. If you run in
|
|
|
12
12
|
|
|
13
13
|
### Plugin not visible in the Plugin Manager after creation
|
|
14
14
|
|
|
15
|
-
Make sure you ran `yarn pm create` instead of manually creating the directory. `yarn pm create`
|
|
15
|
+
Make sure you ran `yarn pm create` instead of manually creating the directory. Besides generating files, `yarn pm create` updates `tsconfig.paths.json` and runs `yarn postinstall`, which links the plugin into `node_modules` and regenerates the client plugin index so the application can discover it. A manually created directory skips that step — run `yarn nocobase upgrade` to rescan and register it in the `applicationPlugins` table.
|
|
16
16
|
|
|
17
17
|
### No changes on the page after enabling a plugin
|
|
18
18
|
|
|
@@ -49,6 +49,8 @@ yarn pm create @my-project/plugin-simple-action
|
|
|
49
49
|
|
|
50
50
|
For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
|
|
51
51
|
|
|
52
|
+
Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
|
|
53
|
+
|
|
52
54
|
## Step 2: Create Action Models
|
|
53
55
|
|
|
54
56
|
Each action needs to declare the scenario it appears in via the `static scene` property:
|
|
@@ -51,6 +51,8 @@ yarn pm create @my-project/plugin-simple-block
|
|
|
51
51
|
|
|
52
52
|
This will generate a basic file structure under `packages/plugins/@my-project/plugin-simple-block`. For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
|
|
53
53
|
|
|
54
|
+
Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
|
|
55
|
+
|
|
54
56
|
## Step 2: Create the Block Model
|
|
55
57
|
|
|
56
58
|
Create `src/client-v2/models/SimpleBlockModel.tsx`. This is the core of the entire plugin -- defining how the block renders and how it's configured.
|
|
@@ -52,6 +52,8 @@ yarn pm create @my-project/plugin-field-simple
|
|
|
52
52
|
|
|
53
53
|
For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
|
|
54
54
|
|
|
55
|
+
Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
|
|
56
|
+
|
|
55
57
|
## Step 2: Create the Field Model
|
|
56
58
|
|
|
57
59
|
Create `src/client-v2/models/DisplaySimpleFieldModel.tsx`. This is the core of the plugin -- defining how the field renders and which field interface it binds to.
|
|
@@ -55,6 +55,8 @@ yarn pm create @my-project/plugin-custom-table-block-resource
|
|
|
55
55
|
|
|
56
56
|
For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
|
|
57
57
|
|
|
58
|
+
Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
|
|
59
|
+
|
|
58
60
|
## Step 2: Define the Data Table (Server-Side)
|
|
59
61
|
|
|
60
62
|
Create `src/server/collections/todoItems.ts`. NocoBase will automatically load collection definitions from this directory:
|
|
@@ -52,6 +52,8 @@ yarn pm create @my-project/plugin-settings-page
|
|
|
52
52
|
|
|
53
53
|
This will generate a basic file structure under `packages/plugins/@my-project/plugin-settings-page`, including `src/client-v2/`, `src/server/`, `src/locale/`, and other directories. For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
|
|
54
54
|
|
|
55
|
+
Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
|
|
56
|
+
|
|
55
57
|
## Step 2: Register the Settings Page
|
|
56
58
|
|
|
57
59
|
Edit `src/client-v2/plugin.tsx`. In `load()`, use `this.pluginSettingsManager` to register the settings page. This is done in two steps -- first register the menu entry with `addMenuItem()`, then register the actual page with `addPageTabItem()`:
|
|
@@ -61,11 +61,11 @@ export class PluginSampleI18nServer extends Plugin {
|
|
|
61
61
|
},
|
|
62
62
|
],
|
|
63
63
|
});
|
|
64
|
-
await this.app.changeLanguage(answer1);
|
|
64
|
+
await this.app.i18n.changeLanguage(answer1);
|
|
65
65
|
const answer2 = await input({
|
|
66
|
-
message: app.i18n.t('Enter your name'),
|
|
66
|
+
message: this.app.i18n.t('Enter your name'),
|
|
67
67
|
});
|
|
68
|
-
console.log(app.i18n.t(`Your name is {{name}}`, { name: answer2 }));
|
|
68
|
+
console.log(this.app.i18n.t(`Your name is {{name}}`, { name: answer2 }));
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -212,7 +212,7 @@ export default class PluginCacheDemo extends Plugin {
|
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
// Create cache using newly registered store
|
|
215
|
-
const redisCache = await this.app.createCache({
|
|
215
|
+
const redisCache = await this.app.cacheManager.createCache({
|
|
216
216
|
name: 'redisCache',
|
|
217
217
|
store: 'redis',
|
|
218
218
|
prefix: 'app:',
|
|
@@ -197,12 +197,6 @@ When a plugin is first activated, the system will automatically synchronize Coll
|
|
|
197
197
|
yarn nocobase upgrade
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
If exceptions or dirty data occur during synchronization, you can rebuild the table structure by reinstalling the application:
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
yarn nocobase install -f
|
|
204
|
-
```
|
|
205
|
-
|
|
206
200
|
If you need to migrate existing data during plugin upgrades -- such as renaming fields, splitting tables, backfilling default values, etc. -- you should handle it through [Migration](./migration.md) scripts rather than manually modifying the database.
|
|
207
201
|
|
|
208
202
|
## Making a Collection Appear in the UI Data Table List
|
|
@@ -30,7 +30,7 @@ export default function (app: Application) {
|
|
|
30
30
|
app
|
|
31
31
|
.command('echo')
|
|
32
32
|
.option('-v, --version')
|
|
33
|
-
.action(async (
|
|
33
|
+
.action(async (options) => {
|
|
34
34
|
console.log('Hello World!');
|
|
35
35
|
if (options.version) {
|
|
36
36
|
console.log('Current version:', await app.version.get());
|
|
@@ -68,7 +68,7 @@ export default class PluginHelloServer extends Plugin {
|
|
|
68
68
|
app
|
|
69
69
|
.command('echo')
|
|
70
70
|
.option('-v, --version')
|
|
71
|
-
.action(async (
|
|
71
|
+
.action(async (options) => {
|
|
72
72
|
console.log('Hello World!');
|
|
73
73
|
if (options.version) {
|
|
74
74
|
console.log('Current version:', await app.version.get());
|
|
@@ -56,7 +56,7 @@ resourceManager.use(async (ctx) => {
|
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
58
|
resourceManager.use(async (ctx) => {
|
|
59
|
-
await ctx.cache.set('key', 'value',
|
|
59
|
+
await ctx.cache.set('key', 'value', 60 * 1000); // Cache for 60 seconds (TTL is in milliseconds)
|
|
60
60
|
const val = await ctx.cache.get('key');
|
|
61
61
|
ctx.body = val;
|
|
62
62
|
});
|
|
@@ -113,7 +113,7 @@ resourceManager.use(async (ctx) => {
|
|
|
113
113
|
|
|
114
114
|
```ts
|
|
115
115
|
resourceManager.use(async (ctx) => {
|
|
116
|
-
const canEdit =
|
|
116
|
+
const canEdit = ctx.can({ resource: 'posts', action: 'edit' });
|
|
117
117
|
if (!canEdit) {
|
|
118
118
|
ctx.throw(403, 'Forbidden');
|
|
119
119
|
}
|
|
@@ -68,13 +68,13 @@ export class PluginSampleI18nServer extends Plugin {
|
|
|
68
68
|
]
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
await this.app.changeLanguage(answer1);
|
|
71
|
+
await this.app.i18n.changeLanguage(answer1);
|
|
72
72
|
|
|
73
73
|
const answer2 = await input({
|
|
74
|
-
message: app.i18n.t('Enter your name')
|
|
74
|
+
message: this.app.i18n.t('Enter your name')
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
console.log(app.i18n.t('Your name is {{name}}', { name: answer2 }));
|
|
77
|
+
console.log(this.app.i18n.t('Your name is {{name}}', { name: answer2 }));
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -129,7 +129,7 @@ export class PluginSampleI18nServer extends Plugin {
|
|
|
129
129
|
load() {
|
|
130
130
|
this.app.use(async (ctx, next) => {
|
|
131
131
|
if (ctx.path === '/api/plugin-i18n') {
|
|
132
|
-
ctx.body = this.
|
|
132
|
+
ctx.body = this.t('Hello');
|
|
133
133
|
}
|
|
134
134
|
await next();
|
|
135
135
|
});
|