@_tc/template-core 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.skills/tc-component-usage-skills/SKILL.md +46 -121
- package/.skills/tc-component-usage-skills/reference/component-api.md +31 -25
- package/.skills/tc-component-usage-skills/reference/examples.md +30 -12
- package/.skills/tc-component-usage-skills/reference/patterns.md +45 -27
- package/.skills/tc-component-usage-skills/reference/template-core-frontend.md +27 -9
- package/.skills/tc-generator/SKILL.md +51 -69
- package/.skills/tc-generator/reference/example.md +150 -99
- package/.skills/tc-generator/reference/model-schema.md +4 -4
- package/.skills/tc-generator/reference/project-template/backend/business.module.ts +9 -0
- package/.skills/tc-generator/reference/project-template/backend/product.controller.ts +71 -0
- package/.skills/tc-generator/reference/project-template/backend/product.service.ts +58 -0
- package/.skills/tc-generator/reference/project-template/backend/product.types.ts +15 -0
- package/.skills/tc-generator/reference/project-template/index.js +32 -13
- package/.skills/tc-generator/reference/project-template/package.json +20 -3
- package/.skills/tc-generator/reference/project-template/scripts/build-backend.mjs +12 -0
- package/.skills/tc-generator/reference/project-template/scripts/build-frontend.mjs +7 -0
- package/.skills/tc-generator/reference/project-template/scripts/build-ssr.mjs +7 -0
- package/.skills/tc-generator/reference/project-template/ssr/apps/hello/hello.entry.tsx +39 -0
- package/.skills/tc-generator/reference/project-template/tsconfig.json +14 -0
- package/.skills/tc-generator/reference/runtime-extensions.md +132 -89
- package/AGENT_README.md +61 -154
- package/CHANGE.md +4 -12
- package/README.md +235 -358
- package/cjs/app/ai/agent/agent-scanner.service.js +1 -0
- package/cjs/app/ai/agent/agent.module.js +1 -0
- package/cjs/app/ai/ai-config.module.js +1 -0
- package/cjs/app/ai/ai-config.service.js +1 -0
- package/cjs/app/ai/ai.controller.js +1 -0
- package/cjs/app/ai/ai.module.js +1 -0
- package/cjs/app/ai/declaration-paths.js +1 -0
- package/cjs/app/ai/eval/assertions.js +1 -0
- package/cjs/app/ai/guardrail/guardrail.module.js +1 -0
- package/cjs/app/ai/guardrail/guardrail.service.js +1 -0
- package/cjs/app/ai/guardrail/internal/load-guardrail-config.js +1 -0
- package/cjs/app/ai/mcp/internal/load-mcp-config.js +1 -0
- package/cjs/app/ai/mcp/mcp-registry.service.js +2 -0
- package/cjs/app/ai/mcp/mcp.client.js +4 -0
- package/cjs/app/ai/mcp/mcp.loader.js +1 -0
- package/cjs/app/ai/mcp/mcp.module.js +1 -0
- package/cjs/app/ai/mcp/mcp.types.js +1 -0
- package/cjs/app/ai/memory/checkpoint.service.js +1 -0
- package/cjs/app/ai/memory/internal/load-memory-config.js +1 -0
- package/cjs/app/ai/memory/memory.module.js +1 -0
- package/cjs/app/ai/memory/thread.service.js +1 -0
- package/cjs/app/ai/rag/chunker.js +2 -0
- package/cjs/app/ai/rag/internal/load-embedding-config.js +1 -0
- package/cjs/app/ai/rag/internal/load-rag-config.js +1 -0
- package/cjs/app/ai/rag/rag.interface.js +1 -0
- package/cjs/app/ai/rag/rag.module.js +1 -0
- package/cjs/app/ai/rag/retriever.service.js +1 -0
- package/cjs/app/ai/retention/conversation-retention.service.js +1 -0
- package/cjs/app/ai/retention/retention-policy.js +1 -0
- package/cjs/app/ai/runtime/ai-runtime-startup.validator.js +1 -0
- package/cjs/app/ai/runtime/internal/agent-run-context.js +1 -0
- package/cjs/app/ai/runtime/internal/compact-tool-result.js +1 -0
- package/cjs/app/ai/runtime/internal/context-compaction.service.js +4 -0
- package/cjs/app/ai/runtime/internal/load-llm-config.js +1 -0
- package/cjs/app/ai/runtime/internal/load-runtime-config.js +1 -0
- package/cjs/app/ai/runtime/internal/request-budget.js +1 -0
- package/cjs/app/ai/runtime/internal/run-event-queue.js +1 -0
- package/cjs/app/ai/runtime/langchain/langchain-planner.service.js +1 -0
- package/cjs/app/ai/runtime/langchain/skill-tool.adapter.js +1 -0
- package/cjs/app/ai/runtime/langgraph/agent.graph.js +1 -0
- package/cjs/app/ai/runtime/langgraph/agent.state.js +1 -0
- package/cjs/app/ai/runtime/langgraph/langgraph-orchestrator.service.js +1 -0
- package/cjs/app/ai/runtime/runtime.module.js +1 -0
- package/cjs/app/ai/runtime/thread-execution-coordinator.js +1 -0
- package/cjs/app/ai/skill/skill-scanner.service.js +1 -0
- package/cjs/app/ai/skill/skill.module.js +1 -0
- package/cjs/app/ai/store/internal/archive-id.js +1 -0
- package/cjs/app/ai/store/internal/load-store-config.js +1 -0
- package/cjs/app/ai/store/internal/load-thread-state-store.js +1 -0
- package/cjs/app/ai/store/reference/file-memory.store.js +1 -0
- package/cjs/app/ai/store/reference/file-trace.store.js +1 -0
- package/cjs/app/ai/store/reference/file-vector.store.js +1 -0
- package/cjs/app/ai/store/reference/qdrant-vector.store.js +1 -0
- package/cjs/app/ai/store/store.interface.js +1 -0
- package/cjs/app/ai/store/store.module.js +1 -0
- package/cjs/app/ai/tool/builtin/index.js +1 -0
- package/cjs/app/ai/tool/builtin/invoke-agent.tool.js +1 -0
- package/cjs/app/ai/tool/builtin/retrieve.tool.js +1 -0
- package/cjs/app/ai/tool/executor.service.js +1 -0
- package/cjs/app/ai/tool/tool-registry.service.js +1 -0
- package/cjs/app/ai/tool/tool.module.js +1 -0
- package/cjs/app/ai/trace/trace.service.js +1 -0
- package/cjs/app/csr/controller.js +1 -0
- package/cjs/app/extends/$fetch.js +1 -1
- package/cjs/app/extends/crypto.js +1 -1
- package/cjs/app/extends/db.js +4 -4
- package/cjs/app/extends/logger.js +1 -1
- package/cjs/app/frontend-development.js +1 -0
- package/cjs/app/html/browser-options.js +1 -0
- package/cjs/app/http/body-parser.middleware.js +1 -0
- package/cjs/app/http/compression.middleware.js +1 -0
- package/cjs/app/http/context.js +1 -0
- package/cjs/app/http/controller.js +1 -0
- package/cjs/app/http/error-response.js +1 -0
- package/cjs/app/http/errors.js +1 -0
- package/cjs/app/http/exception-filter.js +1 -0
- package/cjs/app/http/request-data.js +1 -0
- package/cjs/app/http/request-schema.pipe.js +1 -0
- package/cjs/app/http/response.interceptor.js +1 -0
- package/cjs/app/http/response.js +1 -0
- package/cjs/app/http/security.guard.js +1 -0
- package/cjs/app/project/controller.js +1 -0
- package/cjs/app/project/service.js +1 -0
- package/cjs/app/providers/csr.js +1 -0
- package/cjs/app/providers/foundation.js +1 -0
- package/cjs/app/ssr/artifacts.js +1 -0
- package/cjs/app/ssr/controller.js +1 -0
- package/cjs/app/ssr/html.js +14 -6
- package/cjs/app/ssr/manifest.js +2 -2
- package/cjs/app/ssr/session.js +1 -0
- package/cjs/app/ssr/stream.js +1 -0
- package/cjs/app/ssr/streaming-request-cache.js +1 -0
- package/cjs/app/static-assets.middleware.js +1 -0
- package/cjs/app/template-core.module.js +1 -0
- package/cjs/bundler/buildBE.js +1 -1
- package/cjs/bundler/buildFE.js +1 -1
- package/cjs/bundler/buildSSR.js +1 -1
- package/cjs/bundler/dev-session.js +1 -0
- package/cjs/bundler/dev.js +1 -1
- package/cjs/bundler/feSharedConfig.js +1 -1
- package/cjs/bundler/index.js +1 -1
- package/cjs/bundler/prod.js +1 -1
- package/cjs/bundler/ssrClientManifest.js +1 -1
- package/cjs/bundler/ssrEntries.js +1 -1
- package/cjs/bundler/state.js +1 -1
- package/cjs/bundler/utils.js +3 -3
- package/cjs/index.js +1 -1
- package/cjs/package.json +1 -0
- package/cjs/packages/common/index.js +1 -1
- package/cjs/packages/core/bootstrap.js +1 -0
- package/cjs/packages/core/config-service.js +1 -0
- package/cjs/packages/core/duplicate-route-checking-adapter.js +1 -0
- package/cjs/packages/core/index.js +1 -1
- package/cjs/packages/core/legacy-factory-diagnostics.js +1 -0
- package/cjs/packages/core/loader/model.js +1 -1
- package/cjs/packages/core/paths.js +1 -1
- package/cjs/packages/core/resource-lifecycle.js +1 -0
- package/cjs/packages/core/startup.js +1 -0
- package/cjs/packages/core/tokens.js +1 -0
- package/cjs/packages/utils/runFileFn.js +1 -1
- package/cjs/scripts/vite-build/build.js +2 -1
- package/esm/app/ai/agent/agent-scanner.service.js +91 -0
- package/esm/app/ai/agent/agent.module.js +11 -0
- package/esm/app/ai/ai-config.module.js +17 -0
- package/esm/app/ai/ai-config.service.js +38 -0
- package/esm/app/ai/ai.controller.js +162 -0
- package/esm/app/ai/ai.module.js +48 -0
- package/esm/app/ai/contracts/index.js +0 -0
- package/esm/app/ai/declaration-paths.js +28 -0
- package/esm/app/ai/eval/assertions.js +49 -0
- package/esm/app/ai/guardrail/guardrail.interface.js +0 -0
- package/esm/app/ai/guardrail/guardrail.module.js +11 -0
- package/esm/app/ai/guardrail/guardrail.service.js +35 -0
- package/esm/app/ai/guardrail/internal/load-guardrail-config.js +17 -0
- package/esm/app/ai/mcp/internal/load-mcp-config.js +50 -0
- package/esm/app/ai/mcp/mcp-registry.service.js +25 -0
- package/esm/app/ai/mcp/mcp.client.js +199 -0
- package/esm/app/ai/mcp/mcp.loader.js +63 -0
- package/esm/app/ai/mcp/mcp.module.js +30 -0
- package/esm/app/ai/mcp/mcp.types.js +4 -0
- package/esm/app/ai/memory/checkpoint.service.js +89 -0
- package/esm/app/ai/memory/internal/load-memory-config.js +15 -0
- package/esm/app/ai/memory/memory.module.js +14 -0
- package/esm/app/ai/memory/thread.service.js +80 -0
- package/esm/app/ai/rag/chunker.js +23 -0
- package/esm/app/ai/rag/internal/load-embedding-config.js +44 -0
- package/esm/app/ai/rag/internal/load-rag-config.js +35 -0
- package/esm/app/ai/rag/rag.interface.js +4 -0
- package/esm/app/ai/rag/rag.module.js +21 -0
- package/esm/app/ai/rag/retriever.service.js +79 -0
- package/esm/app/ai/retention/conversation-retention.service.js +66 -0
- package/esm/app/ai/retention/retention-policy.js +14 -0
- package/esm/app/ai/runtime/ai-runtime-startup.validator.js +32 -0
- package/esm/app/ai/runtime/internal/agent-run-context.js +5 -0
- package/esm/app/ai/runtime/internal/compact-tool-result.js +94 -0
- package/esm/app/ai/runtime/internal/context-compaction.service.js +352 -0
- package/esm/app/ai/runtime/internal/load-llm-config.js +52 -0
- package/esm/app/ai/runtime/internal/load-runtime-config.js +12 -0
- package/esm/app/ai/runtime/internal/request-budget.js +152 -0
- package/esm/app/ai/runtime/internal/run-event-queue.js +23 -0
- package/esm/app/ai/runtime/langchain/langchain-planner.service.js +195 -0
- package/esm/app/ai/runtime/langchain/skill-tool.adapter.js +29 -0
- package/esm/app/ai/runtime/langgraph/agent.graph.js +157 -0
- package/esm/app/ai/runtime/langgraph/agent.state.js +37 -0
- package/esm/app/ai/runtime/langgraph/langgraph-orchestrator.service.js +356 -0
- package/esm/app/ai/runtime/runtime.module.js +44 -0
- package/esm/app/ai/runtime/thread-execution-coordinator.js +27 -0
- package/esm/app/ai/skill/skill-scanner.service.js +71 -0
- package/esm/app/ai/skill/skill.interface.js +0 -0
- package/esm/app/ai/skill/skill.module.js +11 -0
- package/esm/app/ai/store/internal/archive-id.js +11 -0
- package/esm/app/ai/store/internal/load-store-config.js +27 -0
- package/esm/app/ai/store/internal/load-thread-state-store.js +17 -0
- package/esm/app/ai/store/reference/file-memory.store.js +279 -0
- package/esm/app/ai/store/reference/file-trace.store.js +44 -0
- package/esm/app/ai/store/reference/file-vector.store.js +41 -0
- package/esm/app/ai/store/reference/qdrant-vector.store.js +65 -0
- package/esm/app/ai/store/store.interface.js +4 -0
- package/esm/app/ai/store/store.module.js +40 -0
- package/esm/app/ai/tool/builtin/index.js +6 -0
- package/esm/app/ai/tool/builtin/invoke-agent.tool.js +86 -0
- package/esm/app/ai/tool/builtin/retrieve.tool.js +31 -0
- package/esm/app/ai/tool/executor.service.js +78 -0
- package/esm/app/ai/tool/tool-registry.service.js +33 -0
- package/esm/app/ai/tool/tool.interface.js +0 -0
- package/esm/app/ai/tool/tool.module.js +14 -0
- package/esm/app/ai/trace/trace.service.js +93 -0
- package/esm/app/csr/controller.js +136 -0
- package/esm/app/extends/$fetch.js +6 -6
- package/esm/app/extends/crypto.js +4 -3
- package/esm/app/extends/db.js +65 -65
- package/esm/app/extends/logger.js +73 -12
- package/esm/app/frontend-development.js +24 -0
- package/esm/app/html/browser-options.js +7 -0
- package/esm/app/http/body-parser.middleware.js +53 -0
- package/esm/app/http/compression.middleware.js +13 -0
- package/esm/app/http/context.js +21 -0
- package/esm/app/http/controller.js +9 -0
- package/esm/app/http/error-response.js +36 -0
- package/esm/app/http/errors.js +24 -0
- package/esm/app/http/exception-filter.js +52 -0
- package/esm/app/http/request-data.js +17 -0
- package/esm/app/http/request-schema.pipe.js +40 -0
- package/esm/app/http/response.interceptor.js +26 -0
- package/esm/app/http/response.js +23 -0
- package/esm/app/http/security.guard.js +51 -0
- package/esm/app/project/controller.js +81 -0
- package/esm/app/project/service.js +35 -0
- package/esm/app/providers/csr.js +65 -0
- package/esm/app/providers/foundation.js +158 -0
- package/esm/app/ssr/artifacts.js +66 -0
- package/esm/app/ssr/controller.js +120 -0
- package/esm/app/ssr/html.js +55 -46
- package/esm/app/ssr/manifest.js +24 -10
- package/esm/app/ssr/session.js +91 -0
- package/esm/app/ssr/stream.js +50 -0
- package/esm/app/ssr/streaming-request-cache.js +30 -0
- package/esm/app/ssr/types.js +0 -0
- package/esm/app/static-assets.middleware.js +68 -0
- package/esm/app/template-core.module.js +92 -0
- package/esm/bundler/buildBE.js +1 -0
- package/esm/bundler/buildFE.js +11 -11
- package/esm/bundler/buildSSR.js +60 -62
- package/esm/bundler/dev-session.js +145 -0
- package/esm/bundler/dev.js +8 -9
- package/esm/bundler/feSharedConfig.js +66 -36
- package/esm/bundler/index.js +2 -1
- package/esm/bundler/prod.js +7 -11
- package/esm/bundler/ssrClientManifest.js +5 -5
- package/esm/bundler/ssrEntries.js +5 -5
- package/esm/bundler/state.js +5 -7
- package/esm/bundler/utils.js +170 -148
- package/esm/index.js +29 -12
- package/esm/package.json +1 -0
- package/esm/packages/common/index.js +9 -9
- package/esm/packages/core/bootstrap.js +82 -0
- package/esm/packages/core/config-service.js +46 -0
- package/esm/packages/core/duplicate-route-checking-adapter.js +106 -0
- package/esm/packages/core/index.js +7 -60
- package/esm/packages/core/legacy-factory-diagnostics.js +74 -0
- package/esm/packages/core/loader/model.js +6 -1
- package/esm/packages/core/paths.js +5 -11
- package/esm/packages/core/resource-lifecycle.js +83 -0
- package/esm/packages/core/startup.js +233 -0
- package/esm/packages/core/tokens.js +4 -0
- package/esm/packages/utils/runFileFn.js +19 -35
- package/esm/scripts/vite-build/build.js +29 -22
- package/fe/frontend/apps/dash/Dashboard.js +3 -3
- package/fe/frontend/apps/ui-components/UiComponentsPreview.d.ts +2 -0
- package/fe/frontend/apps/ui-components/UiComponentsPreview.js +182 -0
- package/fe/frontend/apps/ui-components/index.d.ts +1 -2
- package/fe/frontend/apps/ui-components/index.js +2 -8
- package/fe/frontend/apps/ui-components/ui-components.entry.js +3 -2
- package/fe/frontend/src/common/fetchErrorShow.js +1 -1
- package/fe/frontend/src/common/importComponent.js +1 -1
- package/fe/frontend/src/common/language.d.ts +1 -1
- package/fe/frontend/src/common/language.js +2 -2
- package/fe/frontend/src/common/request.d.ts +2 -0
- package/fe/frontend/src/common/request.js +14 -3
- package/fe/frontend/src/common/schemaForm.js +2 -2
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +1 -1
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.js +3 -3
- package/fe/frontend/src/components/BasePage/HeaderView.js +1 -2
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.d.ts +1 -1
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.js +7 -7
- package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.js +14 -8
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.js +3 -3
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.js +4 -4
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.js +2 -2
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/PreviewImage.d.ts +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/PreviewImage.js +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.js +7 -7
- package/fe/frontend/src/defaultPages/SchemaPage/index.js +2 -2
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +2 -2
- package/fe/frontend/src/hooks/useText.d.ts +1 -1
- package/fe/frontend/src/hooks/useText.js +2 -2
- package/fe/frontend/src/index.d.ts +4 -4
- package/fe/frontend/src/index.js +4 -4
- package/fe/frontend/src/language/resources.d.ts +1 -1
- package/fe/frontend/src/main.css +1 -1
- package/fe/frontend/src/stores/apiFreezer.d.ts +1 -1
- package/fe/frontend/src/stores/apiFreezer.js +2 -2
- package/fe/frontend/src/stores/mode.js +1 -2
- package/fe/frontend/src/stores/schemaStore.d.ts +2 -2
- package/fe/frontend/src/stores/schemaStore.js +1 -2
- package/fe/frontend/src/typing/scalability.d.ts +2 -2
- package/fe/models/types/data/button.d.ts +1 -1
- package/fe/models/types/data/component.d.ts +1 -1
- package/fe/models/types/data/schema.d.ts +1 -1
- package/fe/models/types/data/search.d.ts +1 -1
- package/fe/packages/common/index.js +4 -4
- package/fe/packages/react/core/Button/Button.js +88 -0
- package/fe/packages/react/core/Button/SubmitButton.d.ts +8 -0
- package/fe/packages/react/core/Button/SubmitButton.js +31 -0
- package/fe/packages/react/core/Button/index.js +3 -0
- package/fe/packages/react/core/Card/Card.js +31 -0
- package/fe/packages/react/core/Card/index.js +2 -0
- package/fe/packages/react/core/Checkbox/Checkbox.js +52 -0
- package/fe/packages/react/core/Checkbox/index.js +2 -0
- package/fe/packages/react/core/Label/Label.js +58 -0
- package/fe/packages/react/core/Label/index.js +2 -0
- package/fe/packages/react/core/Layout/Layout.js +33 -0
- package/fe/packages/react/core/Layout/index.js +2 -0
- package/fe/packages/react/core/Loading/Loading.js +48 -0
- package/fe/packages/react/core/Loading/index.js +2 -0
- package/fe/packages/react/core/Skeleton/Skeleton.js +101 -0
- package/fe/packages/react/core/Skeleton/index.js +2 -0
- package/fe/packages/react/core/breadcrumb/breadcrumb.js +155 -0
- package/fe/packages/react/core/breadcrumb/index.js +2 -0
- package/fe/packages/react/core/hooks/index.d.ts +12 -0
- package/fe/packages/react/core/hooks/index.js +13 -0
- package/fe/packages/react/core/hooks/useBreadcrumb.d.ts +9 -0
- package/fe/packages/react/core/hooks/useBreadcrumb.js +5 -0
- package/fe/packages/react/core/hooks/useDropdownPositioning.js +122 -0
- package/fe/packages/react/core/hooks/useExecuteOnce.js +47 -0
- package/fe/packages/react/core/hooks/useHydrationData.d.ts +2 -0
- package/fe/packages/react/core/hooks/useHydrationData.js +23 -0
- package/fe/packages/react/core/hooks/useInit.js +11 -0
- package/fe/packages/react/core/hooks/useInputController.js +39 -0
- package/fe/packages/react/core/hooks/useLanguage.d.ts +1 -0
- package/fe/packages/react/core/hooks/useLanguage.js +8 -0
- package/fe/packages/react/core/hooks/usePagination.js +30 -0
- package/fe/packages/react/core/hooks/useRefState.js +45 -0
- package/fe/packages/react/core/hooks/useSSR.js +46 -0
- package/fe/packages/react/core/hooks/useTableState.d.ts +22 -0
- package/fe/packages/react/core/hooks/useTableState.js +22 -0
- package/fe/packages/react/core/hooks/useWatch.js +60 -0
- package/fe/packages/react/core/index.d.ts +12 -0
- package/fe/packages/react/core/index.js +37 -0
- package/fe/packages/react/core/internal/hydration.d.ts +12 -0
- package/fe/packages/react/core/internal/hydration.js +17 -0
- package/fe/packages/react/core/internal/i18n/default.d.ts +86 -0
- package/fe/packages/react/core/internal/i18n/default.js +96 -0
- package/fe/packages/react/core/internal/i18n/en-US.d.ts +86 -0
- package/fe/packages/react/core/internal/i18n/en-US.js +96 -0
- package/fe/packages/react/core/internal/i18n/index.d.ts +18 -0
- package/fe/packages/react/core/internal/i18n/index.js +179 -0
- package/fe/packages/react/core/internal/i18n/locales.d.ts +7 -0
- package/fe/packages/react/core/internal/i18n/locales.js +18 -0
- package/fe/packages/react/core/internal/i18n/types.d.ts +47 -0
- package/fe/packages/react/core/internal/i18n/types.js +0 -0
- package/fe/packages/react/core/internal/raf-timeout.d.ts +2 -0
- package/fe/packages/react/core/internal/raf-timeout.js +54 -0
- package/fe/packages/react/core/internal/react19-compat.d.ts +15 -0
- package/fe/packages/react/core/internal/react19-compat.js +0 -0
- package/fe/packages/react/core/lib/createStoreHook.js +9 -0
- package/fe/packages/react/core/lib/dataTableWidth.js +33 -0
- package/fe/packages/react/core/lib/export.d.ts +21 -0
- package/fe/packages/react/core/lib/export.js +112 -0
- package/fe/packages/react/core/lib/index.d.ts +4 -0
- package/fe/packages/react/core/lib/index.js +5 -0
- package/fe/packages/react/core/lib/utils.d.ts +10 -0
- package/fe/packages/react/core/lib/utils.js +64 -0
- package/fe/packages/react/core/stores/breadcrumb.d.ts +14 -0
- package/fe/packages/react/core/stores/breadcrumb.js +52 -0
- package/fe/packages/react/core/stores/index.d.ts +2 -0
- package/fe/packages/react/core/stores/index.js +5 -0
- package/fe/packages/react/core/stores/language.d.ts +3 -0
- package/fe/packages/react/core/stores/language.js +3 -0
- package/fe/packages/react/core/types/baseType.js +0 -0
- package/fe/packages/react/core/types/index.js +0 -0
- package/fe/packages/react/dev/preview/DemoSection.d.ts +12 -0
- package/fe/packages/react/dev/preview/demoRegistry.d.ts +8 -0
- package/fe/packages/react/dev/preview/demos/core/ButtonDemo.d.ts +3 -0
- package/fe/packages/react/dev/preview/demos/forms/InputDemo.d.ts +3 -0
- package/fe/packages/react/dev/preview/demos/overlays/ModalDemo.d.ts +3 -0
- package/fe/packages/react/dev/preview/index.d.ts +2 -0
- package/fe/packages/react/forms/DataTable/ActionBtn.d.ts +7 -0
- package/fe/packages/react/forms/DataTable/ActionBtn.js +116 -0
- package/fe/packages/react/forms/DataTable/index.d.ts +32 -0
- package/fe/packages/react/forms/DataTable/index.js +216 -0
- package/fe/packages/react/forms/Date/Calendar.js +351 -0
- package/fe/packages/react/forms/Date/Date.js +210 -0
- package/fe/packages/react/forms/Date/LocaleContext.js +27 -0
- package/fe/packages/react/forms/Date/LocaleProvider.js +22 -0
- package/fe/packages/react/forms/Date/TimePicker.js +136 -0
- package/fe/packages/react/forms/Date/data.js +7 -0
- package/fe/packages/react/forms/Date/dateLocaleStore.js +14 -0
- package/fe/packages/react/forms/Date/dropdownPositioning.d.ts +2 -0
- package/fe/packages/react/forms/Date/dropdownPositioning.js +12 -0
- package/fe/packages/react/forms/Date/index.js +6 -0
- package/fe/packages/react/forms/Date/locales.d.ts +30 -0
- package/fe/packages/react/forms/Date/locales.js +58 -0
- package/fe/packages/react/forms/Form/Form.js +15 -0
- package/fe/packages/react/forms/Form/FormItem.d.ts +19 -0
- package/fe/packages/react/forms/Form/FormItem.js +60 -0
- package/fe/packages/react/forms/Form/SchemaForm/data.d.ts +40 -0
- package/fe/packages/react/forms/Form/SchemaForm/data.js +15 -0
- package/fe/packages/react/forms/Form/SchemaForm/defaultComponentsMap.js +4 -0
- package/fe/packages/react/forms/Form/SchemaForm/index.d.ts +60 -0
- package/fe/packages/react/forms/Form/SchemaForm/index.js +119 -0
- package/fe/packages/react/forms/Form/index.d.ts +5 -0
- package/fe/packages/react/forms/Form/index.js +6 -0
- package/fe/packages/react/forms/Input/Input.js +146 -0
- package/fe/packages/react/forms/Input/index.js +2 -0
- package/fe/packages/react/forms/InputNumber/InputNumber.d.ts +25 -0
- package/fe/packages/react/forms/InputNumber/InputNumber.js +207 -0
- package/fe/packages/react/forms/InputNumber/index.js +2 -0
- package/fe/packages/react/forms/InputNumber/inputNumberUtils.js +45 -0
- package/fe/packages/react/forms/Pagination/Pagination.js +115 -0
- package/fe/packages/react/forms/Pagination/index.js +2 -0
- package/fe/packages/react/forms/Radio/Radio.js +36 -0
- package/fe/packages/react/forms/Radio/RadioGroup.js +33 -0
- package/fe/packages/react/forms/Radio/index.js +3 -0
- package/fe/packages/react/forms/Search/Search.d.ts +13 -0
- package/fe/packages/react/forms/Search/Search.js +24 -0
- package/fe/packages/react/forms/Search/index.js +2 -0
- package/fe/packages/react/forms/Select/Select.js +282 -0
- package/fe/packages/react/forms/Select/dropdownPositioning.d.ts +2 -0
- package/fe/packages/react/forms/Select/dropdownPositioning.js +16 -0
- package/fe/packages/react/forms/Select/index.js +2 -0
- package/fe/packages/react/forms/Switch/Switch.js +28 -0
- package/fe/packages/react/forms/Switch/index.js +2 -0
- package/fe/packages/react/forms/TableSearch/TableSearch.d.ts +30 -0
- package/fe/packages/react/forms/TableSearch/TableSearch.js +154 -0
- package/fe/packages/react/forms/TableSearch/index.js +2 -0
- package/fe/packages/react/forms/TableSearch/lang.d.ts +16 -0
- package/fe/packages/react/forms/TableSearch/lang.js +25 -0
- package/fe/packages/react/forms/TableSearch/tableSearchLocaleStore.js +10 -0
- package/fe/packages/react/forms/Textarea/Textarea.js +58 -0
- package/fe/packages/react/forms/Textarea/index.js +2 -0
- package/fe/packages/react/forms/TreeSelect/TreeSelect.js +190 -0
- package/fe/packages/react/forms/TreeSelect/index.js +2 -0
- package/fe/packages/react/forms/Upload/ImageUpload.js +101 -0
- package/fe/packages/react/forms/Upload/Upload.js +29 -0
- package/fe/packages/react/forms/Upload/index.js +3 -0
- package/fe/packages/react/forms/index.d.ts +15 -0
- package/fe/packages/react/forms/index.js +41 -0
- package/fe/packages/react/forms/table/index.js +2 -0
- package/fe/packages/react/forms/table/table.js +166 -0
- package/fe/packages/react/i18n/I18nContext.d.ts +6 -0
- package/fe/packages/react/i18n/I18nContext.js +5 -0
- package/fe/packages/react/i18n/I18nProvider.d.ts +6 -0
- package/fe/packages/react/i18n/I18nProvider.js +19 -0
- package/fe/packages/react/i18n/getUiReactLocale.d.ts +176 -0
- package/fe/packages/react/i18n/getUiReactLocale.js +13 -0
- package/fe/packages/react/i18n/index.d.ts +5 -0
- package/fe/packages/react/i18n/index.js +7 -0
- package/fe/packages/react/i18n/legacy.d.ts +9 -0
- package/fe/packages/react/i18n/legacy.js +12 -0
- package/fe/packages/react/i18n/locales/en-US.d.ts +1 -0
- package/fe/packages/react/i18n/locales/en-US.js +2 -0
- package/fe/packages/react/i18n/locales/zh-CN.d.ts +1 -0
- package/fe/packages/react/i18n/locales/zh-CN.js +2 -0
- package/fe/packages/react/i18n/useI18n.d.ts +2 -0
- package/fe/packages/react/i18n/useI18n.js +15 -0
- package/fe/packages/react/i18n/useI18nState.d.ts +3 -0
- package/fe/packages/react/i18n/useI18nState.js +24 -0
- package/fe/packages/react/index.d.ts +6 -0
- package/fe/packages/react/index.js +80 -0
- package/fe/packages/react/overlays/Dialog/ConfirmDialog.js +41 -0
- package/fe/packages/react/overlays/Dialog/index.js +2 -0
- package/fe/packages/react/overlays/Drawer/Drawer.js +151 -0
- package/fe/packages/react/overlays/Drawer/index.js +2 -0
- package/fe/packages/react/overlays/Dropdown/Dropdown.d.ts +24 -0
- package/fe/packages/react/overlays/Dropdown/Dropdown.js +105 -0
- package/fe/packages/react/overlays/Dropdown/index.js +2 -0
- package/fe/packages/react/overlays/DropdownMenu/Menu.js +147 -0
- package/fe/packages/react/overlays/DropdownMenu/MenuContext.js +88 -0
- package/fe/packages/react/overlays/DropdownMenu/MenuItem.js +78 -0
- package/fe/packages/react/overlays/DropdownMenu/SubMenu.js +207 -0
- package/fe/packages/react/overlays/DropdownMenu/index.js +5 -0
- package/fe/packages/react/overlays/DropdownMenu/menuTypes.js +0 -0
- package/fe/packages/react/overlays/DropdownMenu/utils.js +8 -0
- package/fe/packages/react/overlays/Message/Message.js +76 -0
- package/fe/packages/react/overlays/Message/MessageManager.js +104 -0
- package/fe/packages/react/overlays/Message/data.js +4 -0
- package/fe/packages/react/overlays/Message/index.js +2 -0
- package/fe/packages/react/overlays/Modal/Modal.js +59 -0
- package/fe/packages/react/overlays/Modal/ModalManager.d.ts +46 -0
- package/fe/packages/react/overlays/Modal/ModalManager.js +106 -0
- package/fe/packages/react/overlays/Modal/index.js +3 -0
- package/fe/packages/react/overlays/Overlay/Overlay.js +61 -0
- package/fe/packages/react/overlays/Overlay/index.js +2 -0
- package/fe/packages/react/overlays/Popover/Notification.js +56 -0
- package/fe/packages/react/overlays/Popover/index.js +2 -0
- package/fe/packages/react/overlays/Popup/Popup.d.ts +25 -0
- package/fe/packages/react/overlays/Popup/Popup.js +91 -0
- package/fe/packages/react/overlays/Popup/index.js +2 -0
- package/fe/packages/react/overlays/Tooltip/Tooltip.js +88 -0
- package/fe/packages/react/overlays/Tooltip/index.js +2 -0
- package/fe/packages/react/overlays/index.d.ts +10 -0
- package/fe/packages/react/overlays/index.js +25 -0
- package/fe/packages/react/styles.css +299 -0
- package/fe/packages/react/ui/components/Button/index.d.ts +1 -3
- package/fe/packages/react/ui/components/Button/index.js +3 -2
- package/fe/packages/react/ui/components/Card/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Card/index.js +2 -1
- package/fe/packages/react/ui/components/Checkbox/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Checkbox/index.js +2 -1
- package/fe/packages/react/ui/components/ConfirmDialog/index.d.ts +1 -1
- package/fe/packages/react/ui/components/ConfirmDialog/index.js +2 -1
- package/fe/packages/react/ui/components/DataTable/index.d.ts +1 -32
- package/fe/packages/react/ui/components/DataTable/index.js +2 -215
- package/fe/packages/react/ui/components/Date/index.d.ts +1 -5
- package/fe/packages/react/ui/components/Date/index.js +6 -5
- package/fe/packages/react/ui/components/Drawer/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Drawer/index.js +2 -1
- package/fe/packages/react/ui/components/Dropdown/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Dropdown/index.js +2 -1
- package/fe/packages/react/ui/components/Form/index.d.ts +1 -4
- package/fe/packages/react/ui/components/Form/index.js +6 -5
- package/fe/packages/react/ui/components/ImagePreview/ImagePreview.js +9 -5
- package/fe/packages/react/ui/components/ImagePreview/PreviewImage.d.ts +1 -1
- package/fe/packages/react/ui/components/ImagePreview/PreviewImage.js +4 -4
- package/fe/packages/react/ui/components/Input/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Input/index.js +2 -1
- package/fe/packages/react/ui/components/InputNumber/index.d.ts +1 -1
- package/fe/packages/react/ui/components/InputNumber/index.js +2 -1
- package/fe/packages/react/ui/components/Label/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Label/index.js +3 -2
- package/fe/packages/react/ui/components/Layout/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Layout/index.js +2 -1
- package/fe/packages/react/ui/components/Loading/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Loading/index.js +2 -1
- package/fe/packages/react/ui/components/Menu/index.d.ts +1 -8
- package/fe/packages/react/ui/components/Menu/index.js +5 -4
- package/fe/packages/react/ui/components/Message/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Message/index.js +2 -1
- package/fe/packages/react/ui/components/Modal/index.d.ts +1 -3
- package/fe/packages/react/ui/components/Modal/index.js +3 -2
- package/fe/packages/react/ui/components/Notification/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Notification/index.js +2 -1
- package/fe/packages/react/ui/components/Overlay/Overlay.js +1 -1
- package/fe/packages/react/ui/components/Overlay/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Overlay/index.js +2 -1
- package/fe/packages/react/ui/components/Pagination/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Pagination/index.js +2 -1
- package/fe/packages/react/ui/components/Popup/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Popup/index.js +2 -1
- package/fe/packages/react/ui/components/Radio/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Radio/index.js +3 -2
- package/fe/packages/react/ui/components/Search/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Search/index.js +2 -1
- package/fe/packages/react/ui/components/Select/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Select/index.js +2 -1
- package/fe/packages/react/ui/components/Skeleton/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Skeleton/index.js +2 -1
- package/fe/packages/react/ui/components/Switch/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Switch/index.js +2 -1
- package/fe/packages/react/ui/components/TableSearch/index.d.ts +1 -2
- package/fe/packages/react/ui/components/TableSearch/index.js +2 -1
- package/fe/packages/react/ui/components/Tabs/Tabs.js +1 -1
- package/fe/packages/react/ui/components/Textarea/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Textarea/index.js +2 -1
- package/fe/packages/react/ui/components/Tooltip/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Tooltip/index.js +2 -1
- package/fe/packages/react/ui/components/TreeSelect/index.d.ts +1 -1
- package/fe/packages/react/ui/components/TreeSelect/index.js +2 -1
- package/fe/packages/react/ui/components/Upload/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Upload/index.js +3 -2
- package/fe/packages/react/ui/components/breadcrumb/index.d.ts +1 -1
- package/fe/packages/react/ui/components/breadcrumb/index.js +2 -1
- package/fe/packages/react/ui/components/index.d.ts +3 -33
- package/fe/packages/react/ui/components/index.js +69 -77
- package/fe/packages/react/ui/components/table/index.d.ts +1 -1
- package/fe/packages/react/ui/components/table/index.js +2 -1
- package/fe/packages/react/ui/i18n/I18nProvider.d.ts +1 -1
- package/fe/packages/react/ui/i18n/I18nProvider.js +2 -1
- package/fe/packages/react/ui/i18n/index.d.ts +1 -3
- package/fe/packages/react/ui/i18n/index.js +8 -7
- package/fe/packages/react/ui/i18n/useI18n.d.ts +6 -6
- package/fe/packages/react/ui/i18n/useI18n.js +2 -2
- package/fe/packages/react/ui/index.css +2 -299
- package/fe/packages/react/ui/index.d.ts +0 -2
- package/fe/packages/react/ui/index.js +72 -55
- package/fe/ssr/apps/dash/dash.entry.js +7 -3
- package/fe/ssr/apps/ui-components/ui-components.entry.js +3 -2
- package/fe/ssr/components/StreamingRender/StreamingCache.js +6 -0
- package/fe/ssr/components/StreamingRender/StreamingRender.d.ts +1 -1
- package/fe/ssr/components/StreamingRender/StreamingRender.js +29 -23
- package/fe/ssr/components/StreamingRender/StreamingScript.d.ts +2 -0
- package/fe/ssr/components/StreamingRender/StreamingScript.js +39 -1
- package/fe/ssr/types.d.ts +1 -13
- package/models/frontend/src/common/language.d.ts +1 -1
- package/models/frontend/src/common/request.d.ts +2 -0
- package/models/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +1 -1
- package/models/frontend/src/hooks/useText.d.ts +1 -1
- package/models/frontend/src/language/resources.d.ts +1 -1
- package/models/frontend/src/stores/apiFreezer.d.ts +1 -1
- package/models/frontend/src/stores/schemaStore.d.ts +2 -2
- package/models/frontend/src/typing/scalability.d.ts +2 -2
- package/models/models/types/data/button.d.ts +1 -1
- package/models/models/types/data/component.d.ts +1 -1
- package/models/models/types/data/schema.d.ts +1 -1
- package/models/models/types/data/search.d.ts +1 -1
- package/models/packages/react/core/Button/SubmitButton.d.ts +8 -0
- package/models/packages/react/core/Button/index.d.ts +3 -0
- package/models/packages/react/core/Card/index.d.ts +1 -0
- package/models/packages/react/core/Checkbox/index.d.ts +1 -0
- package/models/packages/react/core/Label/index.d.ts +2 -0
- package/models/packages/react/core/Layout/index.d.ts +1 -0
- package/models/packages/react/core/Loading/index.d.ts +1 -0
- package/models/packages/react/core/Skeleton/index.d.ts +2 -0
- package/models/packages/react/core/breadcrumb/index.d.ts +1 -0
- package/models/packages/react/core/hooks/index.d.ts +12 -0
- package/models/packages/react/core/hooks/useBreadcrumb.d.ts +9 -0
- package/models/packages/react/core/hooks/useHydrationData.d.ts +2 -0
- package/models/packages/react/core/hooks/useInit.d.ts +2 -0
- package/models/packages/react/core/hooks/useLanguage.d.ts +1 -0
- package/models/packages/react/core/hooks/usePagination.d.ts +15 -0
- package/models/packages/react/core/hooks/useRefState.d.ts +9 -0
- package/models/packages/react/core/hooks/useSSR.d.ts +6 -0
- package/models/packages/react/core/hooks/useTableState.d.ts +22 -0
- package/models/packages/react/core/hooks/useWatch.d.ts +14 -0
- package/models/packages/react/core/index.d.ts +12 -0
- package/models/packages/react/core/internal/hydration.d.ts +12 -0
- package/models/packages/react/core/internal/i18n/default.d.ts +86 -0
- package/models/packages/react/core/internal/i18n/en-US.d.ts +86 -0
- package/models/packages/react/core/internal/i18n/index.d.ts +18 -0
- package/models/packages/react/core/internal/i18n/locales.d.ts +7 -0
- package/models/packages/react/core/internal/i18n/types.d.ts +47 -0
- package/models/packages/react/core/internal/raf-timeout.d.ts +2 -0
- package/models/packages/react/core/internal/react19-compat.d.ts +15 -0
- package/models/packages/react/core/lib/export.d.ts +21 -0
- package/models/packages/react/core/lib/index.d.ts +4 -0
- package/models/packages/react/core/lib/utils.d.ts +10 -0
- package/models/packages/react/core/stores/breadcrumb.d.ts +14 -0
- package/models/packages/react/core/stores/index.d.ts +2 -0
- package/models/packages/react/core/stores/language.d.ts +3 -0
- package/models/packages/react/core/types/baseType.d.ts +21 -0
- package/models/packages/react/forms/DataTable/ActionBtn.d.ts +7 -0
- package/models/packages/react/forms/DataTable/index.d.ts +32 -0
- package/models/packages/react/forms/Date/dropdownPositioning.d.ts +2 -0
- package/models/packages/react/forms/Date/index.d.ts +5 -0
- package/models/packages/react/forms/Date/locales.d.ts +30 -0
- package/models/packages/react/forms/Form/FormItem.d.ts +19 -0
- package/models/packages/react/forms/Form/SchemaForm/data.d.ts +40 -0
- package/models/packages/react/forms/Form/SchemaForm/index.d.ts +60 -0
- package/models/packages/react/forms/Form/index.d.ts +5 -0
- package/models/packages/react/forms/Input/index.d.ts +1 -0
- package/models/packages/react/forms/InputNumber/InputNumber.d.ts +25 -0
- package/models/packages/react/forms/InputNumber/index.d.ts +1 -0
- package/models/packages/react/forms/Pagination/index.d.ts +1 -0
- package/models/packages/react/forms/Radio/index.d.ts +2 -0
- package/models/packages/react/forms/Search/Search.d.ts +13 -0
- package/models/packages/react/forms/Search/index.d.ts +1 -0
- package/models/packages/react/forms/Select/dropdownPositioning.d.ts +2 -0
- package/models/packages/react/forms/Select/index.d.ts +1 -0
- package/models/packages/react/forms/Switch/index.d.ts +1 -0
- package/models/packages/react/forms/TableSearch/TableSearch.d.ts +30 -0
- package/models/packages/react/forms/TableSearch/index.d.ts +2 -0
- package/models/packages/react/forms/TableSearch/lang.d.ts +16 -0
- package/models/packages/react/forms/Textarea/index.d.ts +1 -0
- package/models/packages/react/forms/TreeSelect/index.d.ts +1 -0
- package/models/packages/react/forms/Upload/index.d.ts +2 -0
- package/models/packages/react/forms/index.d.ts +15 -0
- package/models/packages/react/forms/table/index.d.ts +1 -0
- package/models/packages/react/i18n/I18nContext.d.ts +6 -0
- package/models/packages/react/i18n/I18nProvider.d.ts +6 -0
- package/models/packages/react/i18n/getUiReactLocale.d.ts +176 -0
- package/models/packages/react/i18n/index.d.ts +5 -0
- package/models/packages/react/i18n/legacy.d.ts +9 -0
- package/models/packages/react/i18n/locales/en-US.d.ts +1 -0
- package/models/packages/react/i18n/locales/zh-CN.d.ts +1 -0
- package/models/packages/react/i18n/useI18n.d.ts +2 -0
- package/models/packages/react/i18n/useI18nState.d.ts +3 -0
- package/models/packages/react/index.d.ts +6 -0
- package/models/packages/react/overlays/Dialog/index.d.ts +1 -0
- package/models/packages/react/overlays/Drawer/index.d.ts +2 -0
- package/models/packages/react/overlays/Dropdown/Dropdown.d.ts +24 -0
- package/models/packages/react/overlays/Dropdown/index.d.ts +1 -0
- package/models/packages/react/overlays/DropdownMenu/index.d.ts +8 -0
- package/models/packages/react/overlays/Message/index.d.ts +2 -0
- package/models/packages/react/overlays/Modal/ModalManager.d.ts +46 -0
- package/models/packages/react/overlays/Modal/index.d.ts +3 -0
- package/models/packages/react/overlays/Overlay/Overlay.d.ts +19 -0
- package/models/packages/react/overlays/Overlay/index.d.ts +2 -0
- package/models/packages/react/overlays/Popover/index.d.ts +1 -0
- package/models/packages/react/overlays/Popup/Popup.d.ts +25 -0
- package/models/packages/react/overlays/Popup/index.d.ts +1 -0
- package/models/packages/react/overlays/Tooltip/index.d.ts +1 -0
- package/models/packages/react/overlays/index.d.ts +10 -0
- package/models/packages/react/ui/components/ImagePreview/PreviewImage.d.ts +1 -1
- package/models/packages/react/ui/components/index.d.ts +3 -33
- package/models/packages/react/ui/i18n/useI18n.d.ts +6 -6
- package/package.json +104 -22
- package/ssr/STREAMING_BOOTSTRAP.md +360 -0
- package/types/app/ai/agent/agent-run.dto.d.ts +7 -0
- package/types/app/ai/agent/agent-scanner.service.d.ts +16 -0
- package/types/app/ai/agent/agent.interface.d.ts +13 -0
- package/types/app/ai/agent/agent.module.d.ts +2 -0
- package/types/app/ai/ai-config.module.d.ts +4 -0
- package/types/app/ai/ai-config.service.d.ts +10 -0
- package/types/app/ai/ai.controller.d.ts +3 -0
- package/types/app/ai/ai.module.d.ts +4 -0
- package/types/app/ai/contracts/index.d.ts +129 -0
- package/types/app/ai/declaration-paths.d.ts +3 -0
- package/types/app/ai/eval/assertions.d.ts +26 -0
- package/types/app/ai/guardrail/guardrail.interface.d.ts +10 -0
- package/types/app/ai/guardrail/guardrail.module.d.ts +2 -0
- package/types/app/ai/guardrail/guardrail.service.d.ts +11 -0
- package/types/app/ai/guardrail/internal/load-guardrail-config.d.ts +4 -0
- package/types/app/ai/mcp/internal/load-mcp-config.d.ts +7 -0
- package/types/app/ai/mcp/mcp-registry.service.d.ts +11 -0
- package/types/app/ai/mcp/mcp.client.d.ts +41 -0
- package/types/app/ai/mcp/mcp.loader.d.ts +26 -0
- package/types/app/ai/mcp/mcp.module.d.ts +14 -0
- package/types/app/ai/mcp/mcp.types.d.ts +51 -0
- package/types/app/ai/memory/checkpoint.service.d.ts +15 -0
- package/types/app/ai/memory/internal/load-memory-config.d.ts +9 -0
- package/types/app/ai/memory/memory.module.d.ts +2 -0
- package/types/app/ai/memory/thread.service.d.ts +34 -0
- package/types/app/ai/rag/chunker.d.ts +14 -0
- package/types/app/ai/rag/internal/load-embedding-config.d.ts +11 -0
- package/types/app/ai/rag/internal/load-rag-config.d.ts +16 -0
- package/types/app/ai/rag/rag.interface.d.ts +57 -0
- package/types/app/ai/rag/rag.module.d.ts +2 -0
- package/types/app/ai/rag/retriever.service.d.ts +18 -0
- package/types/app/ai/retention/conversation-retention.service.d.ts +20 -0
- package/types/app/ai/retention/retention-policy.d.ts +5 -0
- package/types/app/ai/runtime/ai-runtime-startup.validator.d.ts +11 -0
- package/types/app/ai/runtime/internal/agent-run-context.d.ts +12 -0
- package/types/app/ai/runtime/internal/compact-tool-result.d.ts +21 -0
- package/types/app/ai/runtime/internal/context-compaction.service.d.ts +33 -0
- package/types/app/ai/runtime/internal/load-llm-config.d.ts +26 -0
- package/types/app/ai/runtime/internal/load-runtime-config.d.ts +13 -0
- package/types/app/ai/runtime/internal/request-budget.d.ts +44 -0
- package/types/app/ai/runtime/internal/run-event-queue.d.ts +11 -0
- package/types/app/ai/runtime/langchain/langchain-planner.service.d.ts +49 -0
- package/types/app/ai/runtime/langchain/skill-tool.adapter.d.ts +9 -0
- package/types/app/ai/runtime/langgraph/agent.graph.d.ts +130 -0
- package/types/app/ai/runtime/langgraph/agent.state.d.ts +43 -0
- package/types/app/ai/runtime/langgraph/langgraph-orchestrator.service.d.ts +87 -0
- package/types/app/ai/runtime/runtime.module.d.ts +7 -0
- package/types/app/ai/runtime/thread-execution-coordinator.d.ts +21 -0
- package/types/app/ai/skill/skill-scanner.service.d.ts +17 -0
- package/types/app/ai/skill/skill.interface.d.ts +9 -0
- package/types/app/ai/skill/skill.module.d.ts +2 -0
- package/types/app/ai/store/internal/archive-id.d.ts +1 -0
- package/types/app/ai/store/internal/load-store-config.d.ts +22 -0
- package/types/app/ai/store/internal/load-thread-state-store.d.ts +4 -0
- package/types/app/ai/store/reference/file-memory.store.d.ts +33 -0
- package/types/app/ai/store/reference/file-trace.store.d.ts +14 -0
- package/types/app/ai/store/reference/file-vector.store.d.ts +12 -0
- package/types/app/ai/store/reference/qdrant-vector.store.d.ts +9 -0
- package/types/app/ai/store/store.interface.d.ts +141 -0
- package/types/app/ai/store/store.module.d.ts +2 -0
- package/types/app/ai/tool/builtin/index.d.ts +6 -0
- package/types/app/ai/tool/builtin/invoke-agent.tool.d.ts +4 -0
- package/types/app/ai/tool/builtin/retrieve.tool.d.ts +7 -0
- package/types/app/ai/tool/executor.service.d.ts +14 -0
- package/types/app/ai/tool/tool-registry.service.d.ts +18 -0
- package/types/app/ai/tool/tool.interface.d.ts +33 -0
- package/types/app/ai/tool/tool.module.d.ts +2 -0
- package/types/app/ai/trace/trace.service.d.ts +33 -0
- package/types/app/csr/controller.d.ts +3 -0
- package/types/app/extends/$fetch.d.ts +1 -3
- package/types/app/extends/crypto.d.ts +3 -5
- package/types/app/extends/db.d.ts +5 -3
- package/types/app/extends/logger.d.ts +16 -10
- package/types/app/frontend-development.d.ts +14 -0
- package/types/app/html/browser-options.d.ts +3 -0
- package/types/app/http/body-parser.middleware.d.ts +9 -0
- package/types/app/http/compression.middleware.d.ts +7 -0
- package/types/app/http/context.d.ts +11 -0
- package/types/app/http/controller.d.ts +7 -0
- package/types/app/http/error-response.d.ts +3 -0
- package/types/app/http/errors.d.ts +25 -0
- package/types/app/http/exception-filter.d.ts +11 -0
- package/types/app/http/request-data.d.ts +9 -0
- package/types/app/http/request-schema.pipe.d.ts +18 -0
- package/types/app/http/response.d.ts +10 -0
- package/types/app/http/response.interceptor.d.ts +5 -0
- package/types/app/http/security.guard.d.ts +13 -0
- package/types/app/project/controller.d.ts +3 -0
- package/types/app/project/service.d.ts +19 -0
- package/types/app/providers/csr.d.ts +21 -0
- package/types/app/providers/foundation.d.ts +8 -0
- package/types/app/ssr/artifacts.d.ts +25 -0
- package/types/app/ssr/controller.d.ts +3 -0
- package/types/app/ssr/html.d.ts +30 -10
- package/types/app/ssr/session.d.ts +44 -0
- package/types/app/ssr/stream.d.ts +5 -0
- package/types/app/ssr/streaming-request-cache.d.ts +10 -0
- package/types/app/ssr/types.d.ts +14 -0
- package/types/app/static-assets.middleware.d.ts +10 -0
- package/types/app/template-core.module.d.ts +12 -0
- package/types/app/utils/i18n.d.ts +7 -4
- package/types/bundler/buildFE.d.ts +4 -1
- package/types/bundler/buildSSR.d.ts +1 -1
- package/types/bundler/dev-session.d.ts +23 -0
- package/types/bundler/dev.d.ts +4 -1
- package/types/bundler/feSharedConfig.d.ts +3 -1
- package/types/bundler/index.d.ts +4 -0
- package/types/bundler/prod.d.ts +2 -1
- package/types/bundler/state.d.ts +3 -5
- package/types/bundler/utils.d.ts +16 -5
- package/types/config/config.default.d.ts +10 -0
- package/types/index.d.ts +45 -29
- package/types/packages/core/bootstrap.d.ts +5 -0
- package/types/packages/core/config-service.d.ts +13 -0
- package/types/packages/core/duplicate-route-checking-adapter.d.ts +23 -0
- package/types/packages/core/index.d.ts +8 -6
- package/types/packages/core/legacy-factory-diagnostics.d.ts +2 -0
- package/types/packages/core/loader/model.d.ts +14 -10
- package/types/packages/core/paths.d.ts +0 -14
- package/types/packages/core/resource-lifecycle.d.ts +7 -0
- package/types/packages/core/startup.d.ts +70 -0
- package/types/packages/core/tokens.d.ts +8 -0
- package/types/scripts/vite-build/types.d.ts +3 -0
- package/types/ssrSharedData/outputPaths.d.ts +2 -2
- package/.skills/tc-generator/reference/project-template/app/controller/product.js +0 -73
- package/.skills/tc-generator/reference/project-template/app/router/product.js +0 -9
- package/cjs/app/controller/base.js +0 -1
- package/cjs/app/controller/project.js +0 -1
- package/cjs/app/controller/ssr.js +0 -1
- package/cjs/app/controller/view.js +0 -1
- package/cjs/app/extends/generateErrorMessage.js +0 -1
- package/cjs/app/extends/localCacheHtmlEtag.js +0 -1
- package/cjs/app/extends/parsingParamsOnUrl.js +0 -1
- package/cjs/app/extends/render-view.js +0 -1
- package/cjs/app/middleware.js +0 -1
- package/cjs/app/middlewares/api-params-verify.js +0 -1
- package/cjs/app/middlewares/api-sign-verify.js +0 -1
- package/cjs/app/middlewares/error-handle.js +0 -1
- package/cjs/app/middlewares/project-handler.js +0 -1
- package/cjs/app/middlewares/request-parameter-parsing.js +0 -1
- package/cjs/app/router/project.js +0 -1
- package/cjs/app/router/ssr.js +0 -1
- package/cjs/app/router/view.js +0 -1
- package/cjs/app/router-schema/project.js +0 -1
- package/cjs/app/service/base.js +0 -1
- package/cjs/app/service/project.js +0 -1
- package/cjs/packages/core/env.js +0 -1
- package/cjs/packages/core/loader/config.js +0 -1
- package/cjs/packages/core/loader/controller.js +0 -1
- package/cjs/packages/core/loader/extend.js +0 -1
- package/cjs/packages/core/loader/merge.js +0 -1
- package/cjs/packages/core/loader/middleware.js +0 -1
- package/cjs/packages/core/loader/router-schema.js +0 -1
- package/cjs/packages/core/loader/router.js +0 -1
- package/cjs/packages/core/loader/service.js +0 -1
- package/esm/_virtual/_rolldown/runtime.js +0 -7
- package/esm/app/controller/base.js +0 -26
- package/esm/app/controller/project.js +0 -58
- package/esm/app/controller/ssr.js +0 -215
- package/esm/app/controller/view.js +0 -43
- package/esm/app/extends/generateErrorMessage.js +0 -7
- package/esm/app/extends/localCacheHtmlEtag.js +0 -41
- package/esm/app/extends/parsingParamsOnUrl.js +0 -14
- package/esm/app/extends/render-view.js +0 -18
- package/esm/app/middleware.js +0 -31
- package/esm/app/middlewares/api-params-verify.js +0 -56
- package/esm/app/middlewares/api-sign-verify.js +0 -16
- package/esm/app/middlewares/error-handle.js +0 -25
- package/esm/app/middlewares/project-handler.js +0 -16
- package/esm/app/middlewares/request-parameter-parsing.js +0 -18
- package/esm/app/router/project.js +0 -7
- package/esm/app/router/ssr.js +0 -8
- package/esm/app/router/view.js +0 -8
- package/esm/app/router-schema/project.js +0 -15
- package/esm/app/service/base.js +0 -14
- package/esm/app/service/project.js +0 -23
- package/esm/packages/core/env.js +0 -24
- package/esm/packages/core/loader/config.js +0 -29
- package/esm/packages/core/loader/controller.js +0 -15
- package/esm/packages/core/loader/extend.js +0 -32
- package/esm/packages/core/loader/merge.js +0 -7
- package/esm/packages/core/loader/middleware.js +0 -15
- package/esm/packages/core/loader/router-schema.js +0 -26
- package/esm/packages/core/loader/router.js +0 -45
- package/esm/packages/core/loader/service.js +0 -15
- package/fe/_virtual/_rolldown/runtime.js +0 -13
- package/fe/packages/react/hooks/index.d.ts +0 -11
- package/fe/packages/react/hooks/index.js +0 -10
- package/fe/packages/react/hooks/useBreadcrumb.d.ts +0 -9
- package/fe/packages/react/hooks/useBreadcrumb.js +0 -5
- package/fe/packages/react/hooks/useExecuteOnce.js +0 -47
- package/fe/packages/react/hooks/useHydrationData.d.ts +0 -2
- package/fe/packages/react/hooks/useHydrationData.js +0 -23
- package/fe/packages/react/hooks/useInit.js +0 -11
- package/fe/packages/react/hooks/useLanguage.d.ts +0 -1
- package/fe/packages/react/hooks/useLanguage.js +0 -8
- package/fe/packages/react/hooks/usePagination.js +0 -30
- package/fe/packages/react/hooks/useRefState.js +0 -45
- package/fe/packages/react/hooks/useSSR.js +0 -46
- package/fe/packages/react/hooks/useWatch.js +0 -60
- package/fe/packages/react/ui/components/Button/Button.js +0 -88
- package/fe/packages/react/ui/components/Button/SubmitButton.d.ts +0 -8
- package/fe/packages/react/ui/components/Button/SubmitButton.js +0 -30
- package/fe/packages/react/ui/components/Card/Card.js +0 -31
- package/fe/packages/react/ui/components/Checkbox/Checkbox.js +0 -52
- package/fe/packages/react/ui/components/ConfirmDialog/ConfirmDialog.js +0 -41
- package/fe/packages/react/ui/components/DataTable/ActionBtn.d.ts +0 -7
- package/fe/packages/react/ui/components/DataTable/ActionBtn.js +0 -116
- package/fe/packages/react/ui/components/DataTable/dataTableWidth.js +0 -33
- package/fe/packages/react/ui/components/Date/Calendar.js +0 -351
- package/fe/packages/react/ui/components/Date/Date.js +0 -210
- package/fe/packages/react/ui/components/Date/DateTestPage.d.ts +0 -1
- package/fe/packages/react/ui/components/Date/DateTestPage.js +0 -24
- package/fe/packages/react/ui/components/Date/LocaleContext.js +0 -36
- package/fe/packages/react/ui/components/Date/LocaleProvider.js +0 -22
- package/fe/packages/react/ui/components/Date/TimePicker.js +0 -136
- package/fe/packages/react/ui/components/Date/data.js +0 -7
- package/fe/packages/react/ui/components/Date/dateLocaleStore.js +0 -14
- package/fe/packages/react/ui/components/Date/dropdownPositioning.d.ts +0 -2
- package/fe/packages/react/ui/components/Date/dropdownPositioning.js +0 -12
- package/fe/packages/react/ui/components/Date/locales.d.ts +0 -30
- package/fe/packages/react/ui/components/Date/locales.js +0 -56
- package/fe/packages/react/ui/components/Drawer/Drawer.js +0 -151
- package/fe/packages/react/ui/components/Dropdown/Dropdown.d.ts +0 -24
- package/fe/packages/react/ui/components/Dropdown/Dropdown.js +0 -105
- package/fe/packages/react/ui/components/Form/Form.js +0 -15
- package/fe/packages/react/ui/components/Form/FormItem.d.ts +0 -19
- package/fe/packages/react/ui/components/Form/FormItem.js +0 -60
- package/fe/packages/react/ui/components/Form/SchemaForm/data.d.ts +0 -40
- package/fe/packages/react/ui/components/Form/SchemaForm/data.js +0 -15
- package/fe/packages/react/ui/components/Form/SchemaForm/defaultComponentsMap.js +0 -4
- package/fe/packages/react/ui/components/Form/SchemaForm/index.d.ts +0 -60
- package/fe/packages/react/ui/components/Form/SchemaForm/index.js +0 -119
- package/fe/packages/react/ui/components/Input/Input.js +0 -146
- package/fe/packages/react/ui/components/InputNumber/InputNumber.d.ts +0 -25
- package/fe/packages/react/ui/components/InputNumber/InputNumber.js +0 -207
- package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.js +0 -45
- package/fe/packages/react/ui/components/Label/Label.js +0 -58
- package/fe/packages/react/ui/components/Layout/Layout.js +0 -33
- package/fe/packages/react/ui/components/Loading/Loading.js +0 -48
- package/fe/packages/react/ui/components/Menu/Menu.js +0 -147
- package/fe/packages/react/ui/components/Menu/MenuContext.js +0 -88
- package/fe/packages/react/ui/components/Menu/MenuItem.js +0 -78
- package/fe/packages/react/ui/components/Menu/SubMenu.js +0 -207
- package/fe/packages/react/ui/components/Menu/utils.js +0 -8
- package/fe/packages/react/ui/components/Message/Message.js +0 -76
- package/fe/packages/react/ui/components/Message/MessageManager.js +0 -104
- package/fe/packages/react/ui/components/Message/data.js +0 -4
- package/fe/packages/react/ui/components/Modal/Modal.js +0 -59
- package/fe/packages/react/ui/components/Modal/ModalManager.d.ts +0 -46
- package/fe/packages/react/ui/components/Modal/ModalManager.js +0 -106
- package/fe/packages/react/ui/components/Notification/Notification.js +0 -56
- package/fe/packages/react/ui/components/Pagination/Pagination.js +0 -115
- package/fe/packages/react/ui/components/Popup/Popup.d.ts +0 -25
- package/fe/packages/react/ui/components/Popup/Popup.js +0 -91
- package/fe/packages/react/ui/components/Radio/Radio.js +0 -36
- package/fe/packages/react/ui/components/Radio/RadioGroup.js +0 -33
- package/fe/packages/react/ui/components/Search/Search.d.ts +0 -13
- package/fe/packages/react/ui/components/Search/Search.js +0 -24
- package/fe/packages/react/ui/components/Select/Select.js +0 -282
- package/fe/packages/react/ui/components/Select/dropdownPositioning.d.ts +0 -2
- package/fe/packages/react/ui/components/Select/dropdownPositioning.js +0 -16
- package/fe/packages/react/ui/components/Skeleton/Skeleton.js +0 -101
- package/fe/packages/react/ui/components/Switch/Switch.js +0 -28
- package/fe/packages/react/ui/components/TableSearch/TableSearch.d.ts +0 -30
- package/fe/packages/react/ui/components/TableSearch/TableSearch.js +0 -166
- package/fe/packages/react/ui/components/TableSearch/lang.d.ts +0 -16
- package/fe/packages/react/ui/components/TableSearch/lang.js +0 -25
- package/fe/packages/react/ui/components/TableSearch/tableSearchLocaleStore.js +0 -10
- package/fe/packages/react/ui/components/Textarea/Textarea.js +0 -58
- package/fe/packages/react/ui/components/Tooltip/Tooltip.js +0 -77
- package/fe/packages/react/ui/components/TreeSelect/TreeSelect.js +0 -190
- package/fe/packages/react/ui/components/Upload/ImageUpload.js +0 -101
- package/fe/packages/react/ui/components/Upload/Upload.js +0 -29
- package/fe/packages/react/ui/components/breadcrumb/breadcrumb.js +0 -155
- package/fe/packages/react/ui/components/hooks/useDropdownPositioning.js +0 -121
- package/fe/packages/react/ui/components/hooks/useInputController.js +0 -39
- package/fe/packages/react/ui/components/table/table.js +0 -166
- package/fe/packages/react/ui/components/testPage/DemoSection.d.ts +0 -10
- package/fe/packages/react/ui/components/testPage/DemoSection.js +0 -73
- package/fe/packages/react/ui/components/testPage/MenuTestPage.js +0 -24
- package/fe/packages/react/ui/components/testPage/demoRegistry.d.ts +0 -4
- package/fe/packages/react/ui/components/testPage/demoRegistry.js +0 -217
- package/fe/packages/react/ui/components/testPage/demos/core/BreadcrumbDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/BreadcrumbDemo.js +0 -44
- package/fe/packages/react/ui/components/testPage/demos/core/BreadcrumbDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ButtonDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ButtonDemo.js +0 -85
- package/fe/packages/react/ui/components/testPage/demos/core/ButtonDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/CardDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/CardDemo.js +0 -52
- package/fe/packages/react/ui/components/testPage/demos/core/CardDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/CheckboxDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/CheckboxDemo.js +0 -41
- package/fe/packages/react/ui/components/testPage/demos/core/CheckboxDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ConfirmDialogDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ConfirmDialogDemo.js +0 -35
- package/fe/packages/react/ui/components/testPage/demos/core/ConfirmDialogDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/DataTableDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/DataTableDemo.js +0 -273
- package/fe/packages/react/ui/components/testPage/demos/core/DataTableDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/DrawerDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/DrawerDemo.js +0 -105
- package/fe/packages/react/ui/components/testPage/demos/core/DrawerDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/DropdownDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/DropdownDemo.js +0 -48
- package/fe/packages/react/ui/components/testPage/demos/core/DropdownDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/FormDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/FormDemo.js +0 -56
- package/fe/packages/react/ui/components/testPage/demos/core/FormDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ImageUploadDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ImageUploadDemo.js +0 -26
- package/fe/packages/react/ui/components/testPage/demos/core/ImageUploadDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/InputDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/InputDemo.js +0 -55
- package/fe/packages/react/ui/components/testPage/demos/core/InputDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/InputNumberDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/InputNumberDemo.js +0 -65
- package/fe/packages/react/ui/components/testPage/demos/core/InputNumberDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/LabelDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/LabelDemo.js +0 -33
- package/fe/packages/react/ui/components/testPage/demos/core/LabelDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/LayoutDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/LayoutDemo.js +0 -64
- package/fe/packages/react/ui/components/testPage/demos/core/LayoutDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/LoadingDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/LoadingDemo.js +0 -32
- package/fe/packages/react/ui/components/testPage/demos/core/LoadingDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/MessageDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/MessageDemo.js +0 -44
- package/fe/packages/react/ui/components/testPage/demos/core/MessageDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ModalDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ModalDemo.js +0 -61
- package/fe/packages/react/ui/components/testPage/demos/core/ModalDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/NotificationDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/NotificationDemo.js +0 -50
- package/fe/packages/react/ui/components/testPage/demos/core/NotificationDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/PaginationDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/PaginationDemo.js +0 -39
- package/fe/packages/react/ui/components/testPage/demos/core/PaginationDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/PreviewImageDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/PreviewImageDemo.js +0 -22
- package/fe/packages/react/ui/components/testPage/demos/core/PreviewImageDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/RadioDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/RadioDemo.js +0 -129
- package/fe/packages/react/ui/components/testPage/demos/core/RadioDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SchemaFormDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SchemaFormDemo.js +0 -52
- package/fe/packages/react/ui/components/testPage/demos/core/SchemaFormDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SearchDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SearchDemo.js +0 -52
- package/fe/packages/react/ui/components/testPage/demos/core/SearchDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SelectDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SelectDemo.js +0 -73
- package/fe/packages/react/ui/components/testPage/demos/core/SelectDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SkeletonDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SkeletonDemo.js +0 -46
- package/fe/packages/react/ui/components/testPage/demos/core/SkeletonDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SwitchDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SwitchDemo.js +0 -36
- package/fe/packages/react/ui/components/testPage/demos/core/SwitchDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TableDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TableDemo.js +0 -64
- package/fe/packages/react/ui/components/testPage/demos/core/TableDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TableSearchDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TableSearchDemo.js +0 -74
- package/fe/packages/react/ui/components/testPage/demos/core/TableSearchDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TabsDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TabsDemo.js +0 -56
- package/fe/packages/react/ui/components/testPage/demos/core/TabsDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TextareaDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TextareaDemo.js +0 -30
- package/fe/packages/react/ui/components/testPage/demos/core/TextareaDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ThemeSwitcher.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ThemeSwitcher.js +0 -96
- package/fe/packages/react/ui/components/testPage/demos/core/ThemeSwitcher2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TooltipDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TooltipDemo.js +0 -29
- package/fe/packages/react/ui/components/testPage/demos/core/TooltipDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TreeSelectDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TreeSelectDemo.js +0 -66
- package/fe/packages/react/ui/components/testPage/demos/core/TreeSelectDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateBasicDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateBasicDemo.js +0 -31
- package/fe/packages/react/ui/components/testPage/demos/date/DateBasicDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateControlledDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateControlledDemo.js +0 -67
- package/fe/packages/react/ui/components/testPage/demos/date/DateControlledDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDateDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDateDemo.js +0 -36
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDateDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDemo.js +0 -35
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateFormatDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateFormatDemo.js +0 -35
- package/fe/packages/react/ui/components/testPage/demos/date/DateFormatDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateRangeDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateRangeDemo.js +0 -76
- package/fe/packages/react/ui/components/testPage/demos/date/DateRangeDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateTimeDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/date/DateTimeDemo.js +0 -60
- package/fe/packages/react/ui/components/testPage/demos/date/DateTimeDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuAccordionDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuAccordionDemo.js +0 -78
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuAccordionDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuClickTriggerDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuClickTriggerDemo.js +0 -79
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuClickTriggerDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedDemo.js +0 -82
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedNoIconDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedNoIconDemo.js +0 -44
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedNoIconDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuJsxDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuJsxDemo.js +0 -64
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuJsxDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuLeftMultipleDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuLeftMultipleDemo.js +0 -81
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuLeftMultipleDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuPopupDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuPopupDemo.js +0 -56
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuPopupDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuStateDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuStateDemo.js +0 -67
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuStateDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuTopDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuTopDemo.js +0 -55
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuTopDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/index.d.ts +0 -2
- package/fe/packages/react/ui/components/testPage/index.js +0 -45
- package/fe/packages/react/ui/components/testPage/types.d.ts +0 -17
- package/fe/packages/react/ui/lib/createStoreHook.js +0 -9
- package/fe/packages/react/ui/lib/export.d.ts +0 -21
- package/fe/packages/react/ui/lib/export.js +0 -112
- package/fe/packages/react/ui/lib/utils.d.ts +0 -9
- package/fe/packages/react/ui/lib/utils.js +0 -64
- package/fe/packages/react/ui/stores/breadcrumb.d.ts +0 -14
- package/fe/packages/react/ui/stores/breadcrumb.js +0 -52
- package/fe/packages/react/ui/stores/language.d.ts +0 -3
- package/fe/packages/react/ui/stores/language.js +0 -4
- package/models/packages/react/hooks/useBreadcrumb.d.ts +0 -9
- package/models/packages/react/hooks/useLanguage.d.ts +0 -1
- package/models/packages/react/ui/components/Button/SubmitButton.d.ts +0 -8
- package/models/packages/react/ui/components/DataTable/ActionBtn.d.ts +0 -7
- package/models/packages/react/ui/components/DataTable/index.d.ts +0 -32
- package/models/packages/react/ui/components/Date/dropdownPositioning.d.ts +0 -2
- package/models/packages/react/ui/components/Date/locales.d.ts +0 -30
- package/models/packages/react/ui/components/Dropdown/Dropdown.d.ts +0 -24
- package/models/packages/react/ui/components/Form/FormItem.d.ts +0 -19
- package/models/packages/react/ui/components/Form/SchemaForm/data.d.ts +0 -40
- package/models/packages/react/ui/components/Form/SchemaForm/index.d.ts +0 -60
- package/models/packages/react/ui/components/Form/index.d.ts +0 -4
- package/models/packages/react/ui/components/InputNumber/InputNumber.d.ts +0 -25
- package/models/packages/react/ui/components/Modal/ModalManager.d.ts +0 -46
- package/models/packages/react/ui/components/Popup/Popup.d.ts +0 -25
- package/models/packages/react/ui/components/Search/Search.d.ts +0 -13
- package/models/packages/react/ui/components/Select/dropdownPositioning.d.ts +0 -2
- package/models/packages/react/ui/components/TableSearch/TableSearch.d.ts +0 -30
- package/models/packages/react/ui/components/TableSearch/lang.d.ts +0 -16
- package/models/packages/react/ui/i18n/I18nProvider.d.ts +0 -12
- package/models/packages/react/ui/i18n/index.d.ts +0 -3
- package/models/packages/react/ui/index.d.ts +0 -4
- package/models/packages/react/ui/lib/export.d.ts +0 -21
- package/models/packages/react/ui/lib/utils.d.ts +0 -9
- package/models/packages/react/ui/stores/breadcrumb.d.ts +0 -14
- package/models/packages/react/ui/stores/language.d.ts +0 -3
- package/types/app/controller/base.d.ts +0 -12
- package/types/app/controller/project.d.ts +0 -22
- package/types/app/controller/ssr.d.ts +0 -14
- package/types/app/controller/view.d.ts +0 -8
- package/types/app/extends/generateErrorMessage.d.ts +0 -7
- package/types/app/extends/localCacheHtmlEtag.d.ts +0 -10
- package/types/app/extends/parsingParamsOnUrl.d.ts +0 -2
- package/types/app/extends/render-view.d.ts +0 -7
- package/types/app/middleware.d.ts +0 -3
- package/types/app/middlewares/api-params-verify.d.ts +0 -4
- package/types/app/middlewares/api-sign-verify.d.ts +0 -4
- package/types/app/middlewares/error-handle.d.ts +0 -4
- package/types/app/middlewares/project-handler.d.ts +0 -4
- package/types/app/middlewares/request-parameter-parsing.d.ts +0 -7
- package/types/app/router/project.d.ts +0 -4
- package/types/app/router/ssr.d.ts +0 -6
- package/types/app/router/view.d.ts +0 -3
- package/types/app/router-schema/project.d.ts +0 -3
- package/types/app/service/base.d.ts +0 -9
- package/types/app/service/project.d.ts +0 -57
- package/types/app/type.d.ts +0 -35
- package/types/app/typings.d.ts +0 -50
- package/types/packages/core/env.d.ts +0 -15
- package/types/packages/core/loader/config.d.ts +0 -9
- package/types/packages/core/loader/controller.d.ts +0 -17
- package/types/packages/core/loader/extend.d.ts +0 -8
- package/types/packages/core/loader/merge.d.ts +0 -3
- package/types/packages/core/loader/middleware.d.ts +0 -11
- package/types/packages/core/loader/router-schema.d.ts +0 -18
- package/types/packages/core/loader/router.d.ts +0 -8
- package/types/packages/core/loader/service.d.ts +0 -17
- package/types/packages/core/types.d.ts +0 -158
- /package/cjs/app/{type.js → ai/agent/agent-run.dto.js} +0 -0
- /package/cjs/app/{typings.js → ai/agent/agent.interface.js} +0 -0
- /package/{fe/packages/react/ui/types → cjs/app/ai/contracts}/index.js +0 -0
- /package/cjs/{packages/core/types.js → app/ai/guardrail/guardrail.interface.js} +0 -0
- /package/{esm/app/type.js → cjs/app/ai/skill/skill.interface.js} +0 -0
- /package/{esm/app/typings.js → cjs/app/ai/tool/tool.interface.js} +0 -0
- /package/{esm/packages/core → cjs/app/ssr}/types.js +0 -0
- /package/{fe/packages/react/ui/components/Menu/menuTypes.js → esm/app/ai/agent/agent-run.dto.js} +0 -0
- /package/{fe/packages/react/ui/components/testPage/types.js → esm/app/ai/agent/agent.interface.js} +0 -0
- /package/fe/packages/react/{ui/assets → assets}/table/no-result.svg +0 -0
- /package/fe/packages/react/{ui/components → core}/Button/Button.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Button/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Card/Card.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Card/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Checkbox/Checkbox.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Checkbox/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Label/Label.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Label/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Layout/Layout.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Layout/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Loading/Loading.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Loading/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Skeleton/Skeleton.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Skeleton/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/breadcrumb/breadcrumb.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/breadcrumb/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/hooks/useDropdownPositioning.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useExecuteOnce.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useInit.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/hooks/useInputController.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/usePagination.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useRefState.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useSSR.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useWatch.d.ts +0 -0
- /package/fe/packages/react/{ui → core}/lib/createStoreHook.d.ts +0 -0
- /package/fe/packages/react/{ui/components/DataTable → core/lib}/dataTableWidth.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/types/baseType.d.ts +0 -0
- /package/fe/packages/react/{ui → core}/types/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components/testPage → dev/preview}/MenuTestPage.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/Calendar.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/Date.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/LocaleContext.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/LocaleProvider.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/TimePicker.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/data.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/dateLocaleStore.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Date/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Form/Form.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Form/SchemaForm/defaultComponentsMap.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Form/useForm.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Form/useForm.js +0 -0
- /package/fe/packages/react/{ui/components → forms}/Input/Input.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Input/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/InputNumber/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/InputNumber/inputNumberUtils.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Pagination/Pagination.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Pagination/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Radio/Radio.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Radio/RadioGroup.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Radio/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Search/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Select/Select.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Select/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Switch/Switch.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Switch/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/TableSearch/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/TableSearch/tableSearchLocaleStore.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Textarea/Textarea.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Textarea/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/TreeSelect/TreeSelect.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/TreeSelect/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Upload/ImageUpload.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Upload/Upload.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Upload/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/table/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/table/table.d.ts +0 -0
- /package/fe/packages/react/{ui/components/ConfirmDialog → overlays/Dialog}/ConfirmDialog.d.ts +0 -0
- /package/{models/packages/react/ui/components/ConfirmDialog → fe/packages/react/overlays/Dialog}/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Drawer/Drawer.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Drawer/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Dropdown/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/Menu.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/MenuContext.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/MenuItem.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/SubMenu.d.ts +0 -0
- /package/{models/packages/react/ui/components/Menu → fe/packages/react/overlays/DropdownMenu}/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/menuTypes.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/utils.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Message/Message.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Message/MessageManager.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Message/data.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Message/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Modal/Modal.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Modal/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Overlay/Overlay.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Overlay/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Notification → overlays/Popover}/Notification.d.ts +0 -0
- /package/{models/packages/react/ui/components/Notification → fe/packages/react/overlays/Popover}/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Popup/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Tooltip/Tooltip.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Tooltip/index.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Button/Button.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Card/Card.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Checkbox/Checkbox.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Label/Label.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Layout/Layout.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Loading/Loading.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Skeleton/Skeleton.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/breadcrumb/breadcrumb.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/hooks/useDropdownPositioning.d.ts +0 -0
- /package/models/packages/react/{hooks → core/hooks}/useExecuteOnce.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/hooks/useInputController.d.ts +0 -0
- /package/models/packages/react/{ui → core}/lib/createStoreHook.d.ts +0 -0
- /package/models/packages/react/{ui/components/DataTable → core/lib}/dataTableWidth.d.ts +0 -0
- /package/models/packages/react/{ui → core}/types/index.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/Calendar.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/Date.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/LocaleContext.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/LocaleProvider.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/TimePicker.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/data.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/dateLocaleStore.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Form/Form.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Form/useForm.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Input/Input.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/InputNumber/inputNumberUtils.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Pagination/Pagination.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Radio/Radio.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Radio/RadioGroup.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Select/Select.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Switch/Switch.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/TableSearch/tableSearchLocaleStore.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Textarea/Textarea.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/TreeSelect/TreeSelect.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Upload/ImageUpload.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Upload/Upload.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/table/table.d.ts +0 -0
- /package/models/packages/react/{ui/components/ConfirmDialog → overlays/Dialog}/ConfirmDialog.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Drawer/Drawer.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/Menu.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/MenuContext.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/MenuItem.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/SubMenu.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/menuTypes.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/utils.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Message/Message.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Message/MessageManager.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Message/data.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Modal/Modal.d.ts +0 -0
- /package/models/packages/react/{ui/components/Notification → overlays/Popover}/Notification.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Tooltip/Tooltip.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @_tc/template-core
|
|
2
2
|
|
|
3
|
-
TemplateCore 是一个基于 TypeScript、
|
|
3
|
+
TemplateCore 是一个基于 TypeScript、NestJS、React 的后台框架包。它把 Nest 后端运行时、前端 Dashboard、Schema CRUD 页面、models 类型和类型扩展放到同一个 npm 包里,项目通过显式业务 Module 与 `models/`、`frontend/` 配置接入。
|
|
4
4
|
|
|
5
5
|
预览 & 文档地址:https://t-c-s-p.allomg.qzz.io/preview
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ pnpm add @_tc/template-core
|
|
|
14
14
|
|
|
15
15
|
- Node.js >= 22.13.0
|
|
16
16
|
- pnpm >= 8
|
|
17
|
-
-
|
|
17
|
+
- Nest/Express 运行时属于框架的 `dependencies`;消费方业务源码直接导入的 Nest 包也应在业务项目的 `dependencies` 中声明。使用内置前端时按包内 `peerDependencies` 安装所需 React、Vite、路由、状态、表单、UI 和类型依赖。
|
|
18
18
|
|
|
19
19
|
## 快速使用
|
|
20
20
|
|
|
@@ -22,12 +22,10 @@ pnpm add @_tc/template-core
|
|
|
22
22
|
|
|
23
23
|
```text
|
|
24
24
|
my-admin/
|
|
25
|
-
├──
|
|
26
|
-
│ ├──
|
|
27
|
-
│
|
|
28
|
-
│
|
|
29
|
-
│ │ └── product.ts
|
|
30
|
-
│ └── service/
|
|
25
|
+
├── backend/
|
|
26
|
+
│ ├── business.module.ts
|
|
27
|
+
│ ├── product.controller.ts
|
|
28
|
+
│ └── product.service.ts
|
|
31
29
|
├── config/
|
|
32
30
|
│ └── config.default.ts
|
|
33
31
|
├── frontend/
|
|
@@ -43,25 +41,40 @@ my-admin/
|
|
|
43
41
|
│ └── demo.ts
|
|
44
42
|
├── typing/
|
|
45
43
|
│ └── template-core.d.ts
|
|
46
|
-
|
|
44
|
+
├── scripts/
|
|
45
|
+
│ └── build-be.mjs
|
|
46
|
+
└── index.js
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
先通过公开 `buildBE()` 编译 Nest 后端,再由 JavaScript 启动器加载编译产物。
|
|
50
50
|
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
import {
|
|
54
|
-
|
|
51
|
+
```js
|
|
52
|
+
// scripts/build-be.mjs
|
|
53
|
+
import { buildBE } from '@_tc/template-core/bundler'
|
|
54
|
+
|
|
55
|
+
await buildBE({
|
|
56
|
+
rootDir: process.cwd(),
|
|
57
|
+
input: ['backend'],
|
|
58
|
+
format: ['cjs'],
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
// index.js
|
|
64
|
+
const { join } = require('node:path')
|
|
65
|
+
const { serverStart } = require('@_tc/template-core')
|
|
66
|
+
const { BusinessModule } = require('./dist/cjs/backend/business.module.js')
|
|
55
67
|
|
|
56
68
|
async function main() {
|
|
57
|
-
await serverStart({
|
|
69
|
+
const app = await serverStart({
|
|
58
70
|
name: 'my-admin',
|
|
59
71
|
baseDir: join(__dirname, '.'),
|
|
60
|
-
|
|
61
|
-
additionalPublicPaths: [join(__dirname, 'dist/public')],
|
|
72
|
+
businessModules: [BusinessModule],
|
|
62
73
|
})
|
|
63
74
|
|
|
64
|
-
|
|
75
|
+
const close = () => app.close()
|
|
76
|
+
process.once('SIGINT', close)
|
|
77
|
+
process.once('SIGTERM', close)
|
|
65
78
|
}
|
|
66
79
|
|
|
67
80
|
main().catch((error) => {
|
|
@@ -70,7 +83,7 @@ main().catch((error) => {
|
|
|
70
83
|
})
|
|
71
84
|
```
|
|
72
85
|
|
|
73
|
-
|
|
86
|
+
`serverStart()` 在 Nest 初始化并开始监听后返回 `INestApplication`。启动失败会 reject;应用关闭使用 `await app.close()`。开发内置前端时,在启动参数中加入 `frontendDev: true`,开启同源 Vite、React Fast Refresh 和实时 SSR,无需预构建 FE/SSR。修改 backend/config/models 后需按需重新编译并重启应用。
|
|
74
87
|
|
|
75
88
|
### serverStart 参数说明
|
|
76
89
|
|
|
@@ -78,6 +91,9 @@ main().catch((error) => {
|
|
|
78
91
|
| --- | --- | --- | --- | --- |
|
|
79
92
|
| `name` | `string` | 否 | - | 应用名称 |
|
|
80
93
|
| `baseDir` | `string` | 否 | - | 项目根目录,通常为 `join(__dirname, '.')` |
|
|
94
|
+
| `businessModules` | `Array<Type<unknown> \| DynamicModule>` | 否 | `[]` | 显式接入的 Nest 业务模块 |
|
|
95
|
+
| `providerOverrides` | `ProviderOverride[]` | 否 | `[]` | 对允许替换的公开框架 token 提供 Nest Provider 声明 |
|
|
96
|
+
| `frontendDev` | `boolean \| FrontendDevOptions` | 否 | `false` | 开启同源 Vite/React Fast Refresh 和实时 SSR;随 `app.close()` 释放 |
|
|
81
97
|
| `pageBasePath` | `string` | 否 | `'/'` | 页面访问前缀,所有前端页面路由的基础路径 |
|
|
82
98
|
| `ssrPageBasePath` | `string` | 否 | `'/fessr'` | SSR 页面访问前缀,如 `/tssr` 会让 SSR 页面路由变成 `/tssr/:page` |
|
|
83
99
|
| `homePage` | `string` | 否 | - | 应用首页路径 |
|
|
@@ -105,7 +121,7 @@ export default {
|
|
|
105
121
|
|
|
106
122
|
服务端返回给前端的错误消息会按请求头里的语种翻译。当前优先读取 `x-tc-language`,也兼容 `tc_language`、`tc-language`、`language`、`lang`、`locale` 和 `accept-language`;如果没取到,默认按英文 `en-US` 处理。
|
|
107
123
|
|
|
108
|
-
静态资源挂载顺序为:项目 `app/public`、框架 `app/public`、`additionalPublicPaths`。Nunjucks 模板查找顺序为:项目 `app/public/dist`、框架 `app/public/dist`、`additionalPublicPaths/dist
|
|
124
|
+
静态资源挂载顺序为:项目 `app/public`、框架 `app/public`、`additionalPublicPaths`。Nunjucks 模板查找顺序为:项目 `app/public/dist`、框架 `app/public/dist`、`additionalPublicPaths/dist`。当 `buildFE` 输出到自定义目录时,可以用 `additionalPublicPaths` 把该目录交给 Nest 运行时提供静态资源访问和模板渲染;追加目录必须是绝对路径。
|
|
109
125
|
|
|
110
126
|
### buildFE 参数说明
|
|
111
127
|
|
|
@@ -129,8 +145,8 @@ buildFE(mode: 'dev' | 'prod', options?: BuildFEOptions)
|
|
|
129
145
|
示例:
|
|
130
146
|
|
|
131
147
|
```ts
|
|
132
|
-
//
|
|
133
|
-
await buildFE('dev')
|
|
148
|
+
// 需要磁盘产物时的构建监听;退出时 await watcher.close()
|
|
149
|
+
const watcher = await buildFE('dev', { baseDir, output: 'run' })
|
|
134
150
|
|
|
135
151
|
// 生产模式,输出到项目目录
|
|
136
152
|
await buildFE('prod', { output: 'run' })
|
|
@@ -184,6 +200,8 @@ SSR 运行时会通过 React streaming bootstrap 动态 import 客户端入口
|
|
|
184
200
|
|
|
185
201
|
`pageTitle` / `pageDescription` 可以导出字符串,也可以导出同步或异步函数。函数会在 `getServerProps()` 之后执行,入参包含 `params`、`query`、`path`、`app`、`ctx` 和 `props`。
|
|
186
202
|
|
|
203
|
+
其中 `app` 是 `serverStart()` 返回的同一个 `INestApplication`,通过 `app.get(token)` 获取 Provider;`ctx` 是 `TemplateCoreHttpContext`,包含原始 Express `request` / `response`、可选 `projectKey` 和 `language`。旧 `app.service` / `app.extends` 与 Koa `ctx` 调用需要迁移。只把允许浏览器读取的可序列化业务数据返回为 props,不返回应用、上下文或 Provider。
|
|
204
|
+
|
|
187
205
|
组件级流式异步数据可以使用 `StreamingRender`。它会在服务端 Suspense 中等待 `getData()`,把结果 JSON 序列化后转成 base64,再随 HTML 片段写入 script;客户端 hydration 时会先解码并复用这份数据。
|
|
188
206
|
|
|
189
207
|
```tsx
|
|
@@ -213,13 +231,14 @@ import { buildSSR, watchSSRFiles } from '@_tc/template-core/bundler'
|
|
|
213
231
|
|
|
214
232
|
const baseDir = join(__dirname, '.')
|
|
215
233
|
|
|
234
|
+
await buildSSR({ baseDir, output: 'run' })
|
|
235
|
+
|
|
216
236
|
await serverStart({
|
|
217
237
|
name: 'my-admin',
|
|
218
238
|
baseDir,
|
|
219
239
|
ssrPageBasePath: '/fessr',
|
|
220
240
|
})
|
|
221
241
|
|
|
222
|
-
await buildSSR({ baseDir, output: 'run' })
|
|
223
242
|
await watchSSRFiles({ baseDir, output: 'run' })
|
|
224
243
|
```
|
|
225
244
|
|
|
@@ -230,7 +249,7 @@ http://localhost:9000/fessr/hello
|
|
|
230
249
|
http://localhost:9000/fessr/hello?name=TemplateCore
|
|
231
250
|
```
|
|
232
251
|
|
|
233
|
-
`buildSSR()` 会构建私有 `{ssrPrivateRoot}/ssr-server/{page}.mjs`、私有 `{ssrPrivateRoot}/ssr-manifest/manifest.json`,并把 SSR hydration 入口并入 FE browser build。浏览器侧静态资源走普通 `/dist/assets/*`,可与 CSR 入口共享 chunk;SSR HTML 会根据 manifest 生成 preload,并通过 React bootstrap dynamic import 启动对应客户端入口。服务端会从 `{publicPath}/../.tc/ssr` 查找 server bundle 和 manifest。`/dist/ssr-server/*` 和 `/dist/.vite/*` 会被拦截为 404,避免私有产物或误放文件直连暴露。如果 `output` 使用自定义目录,需要把对应 public 根目录加入 `additionalPublicPaths`。
|
|
252
|
+
`buildSSR()` 会构建私有 `{ssrPrivateRoot}/ssr-server/{page}.mjs`、私有 `{ssrPrivateRoot}/ssr-manifest/manifest.json`,并把 SSR hydration 入口并入 FE browser build。浏览器侧静态资源走普通 `/dist/assets/*`,可与 CSR 入口共享 chunk;SSR HTML 会根据 manifest 生成 preload,并通过 React bootstrap dynamic import 启动对应客户端入口。服务端会从 `{publicPath}/../.tc/ssr` 查找 server bundle 和 manifest。构建会把 `baseDir` 作为 Vite 根目录,因此从任意当前工作目录调用时仍按消费方依赖解析 SSR server bundle。`/dist/ssr-server/*` 和 `/dist/.vite/*` 会被拦截为 404,避免私有产物或误放文件直连暴露。如果 `output` 使用自定义目录,需要把对应 public 根目录加入 `additionalPublicPaths`。
|
|
234
253
|
|
|
235
254
|
`*.entry.tsx` 会被 server/client 两次构建处理,顶层代码需要同时兼容 Node 和浏览器。Node-only 逻辑建议放到 `*.server.ts`,并在 `getServerProps()` 内动态导入;浏览器 API 需要放到 `useEffect` 或 `typeof window !== 'undefined'` 守卫之后。`getServerProps()` 运行在 Node 侧,不要直接复用依赖 `window` / `localStorage` 签名上下文的前端 API 层。
|
|
236
255
|
|
|
@@ -258,9 +277,9 @@ http://localhost:9000/dash?projk=demo
|
|
|
258
277
|
|
|
259
278
|
## 内置功能
|
|
260
279
|
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
280
|
+
- Nest 服务启动:`serverStart(options)`,成功后返回 `INestApplication`。
|
|
281
|
+
- 业务模块:通过 `businessModules` 显式装配 Controller 和 Provider。
|
|
282
|
+
- 配置与模型:保留 `config/` 与 `models/` 的 loader 约定;业务后端使用 Nest DI 和公开 Provider tokens。
|
|
264
283
|
- 默认项目接口:
|
|
265
284
|
- `GET /api/project/model_list`
|
|
266
285
|
- `GET /api/project/list`
|
|
@@ -273,7 +292,7 @@ http://localhost:9000/dash?projk=demo
|
|
|
273
292
|
- API 中间件:错误处理、静态资源、body parser、项目上下文、接口签名、参数校验。
|
|
274
293
|
- 前端构建:扫描框架和项目的 `frontend/**/*.entry.{ts,tsx,js,jsx}`,输出服务端可渲染的 `.entry.tpl`,并写入 `FEBuildKey` 供 HTML ETag 缓存失效使用。
|
|
275
294
|
- SSR 页面:扫描框架和项目的 `ssr/apps/**/*.entry.{ts,tsx,js,jsx}`,输出 server/client 双产物并通过 `/fessr/:page` 服务端渲染。
|
|
276
|
-
- 类型扩展:支持扩展 SchemaForm、SchemaTable
|
|
295
|
+
- 类型扩展:支持扩展 SchemaForm、SchemaTable 单元格渲染组件和 CallCom。
|
|
277
296
|
|
|
278
297
|
## 常用公开入口
|
|
279
298
|
|
|
@@ -281,7 +300,7 @@ http://localhost:9000/dash?projk=demo
|
|
|
281
300
|
|
|
282
301
|
| 入口 | 用途 |
|
|
283
302
|
| --- | --- |
|
|
284
|
-
| `@_tc/template-core` |
|
|
303
|
+
| `@_tc/template-core` | 服务启动、Nest 请求/响应 helpers、Provider tokens、model loader 与公开类型 |
|
|
285
304
|
| `@_tc/template-core/bundler` | 构建入口,提供 `buildFE`、`buildBE`、`buildSSR`、`watchSSRFiles` |
|
|
286
305
|
| `@_tc/template-core/ssr` | SSR 类型与运行时辅助,导出 `SSRPropsContext`、`SSRPageMetaResolver`、`StreamingRender`、`useSuspensePromise` |
|
|
287
306
|
| `@_tc/template-core/ssr/createSSREntry` | SSR 页面客户端 hydration 工厂 |
|
|
@@ -291,7 +310,7 @@ http://localhost:9000/dash?projk=demo
|
|
|
291
310
|
| `@_tc/template-core/ssr/hooks/useSuspensePromise` | `useSuspensePromise` 显式子路径 |
|
|
292
311
|
| `@_tc/template-core/fe` | 前端初始化、动态组件渲染辅助、Dash 路由扩展、请求方法、SchemaPage 事件、token 工具、共享状态和内置前端组件 |
|
|
293
312
|
| `@_tc/template-core/fe/main` | 前端初始化入口 |
|
|
294
|
-
| `@_tc/template-core/fe/common/request` |
|
|
313
|
+
| `@_tc/template-core/fe/common/request` | 请求实例、请求方法、请求类型和 HTTP 401 handler 配置的显式子路径 |
|
|
295
314
|
| `@_tc/template-core/fe/rc` | UI/SchemaForm 组件和类型 |
|
|
296
315
|
| `@_tc/template-core/fe/rc/hooks` | React hooks 汇总入口 |
|
|
297
316
|
| `@_tc/template-core/fe/tailwind_ui.css` | 前端全局样式入口,源码对应 `frontend/src/main.css` |
|
|
@@ -299,45 +318,34 @@ http://localhost:9000/dash?projk=demo
|
|
|
299
318
|
|
|
300
319
|
### 后端类型
|
|
301
320
|
|
|
302
|
-
`@_tc/template-core`
|
|
321
|
+
`@_tc/template-core` 导出消费方 Nest 接入需要的 Node 类型和 helpers。业务类使用 Nest 提供的装饰器,通过显式 Module 注册。
|
|
303
322
|
|
|
304
323
|
| 类型 | 使用场景 |
|
|
305
324
|
| --- | --- |
|
|
306
|
-
| `
|
|
307
|
-
| `
|
|
308
|
-
| `
|
|
309
|
-
| `
|
|
310
|
-
| `
|
|
325
|
+
| `INestApplication` | `serverStart()` 成功后的应用返回值;使用 `close()` 释放资源。 |
|
|
326
|
+
| `StartOptions` | 业务 Module、Provider override 和启动路径配置。 |
|
|
327
|
+
| `TemplateCoreController` | 可选 Nest Controller 基类,提供 `this.success`、`this.fail`、`this.sendData`,不持有请求状态。 |
|
|
328
|
+
| `TemplateCoreRequestData` | `RequestData()` 的 headers/body/query/data 参数形状。 |
|
|
329
|
+
| `TemplateCoreHttpContext` | SSR 与框架请求上下文,包含原生 request/response、可选 projectKey 和 language。 |
|
|
330
|
+
| `FrameworkDB`、`CryptoExtend`、`FrameworkLogger` | 公开 Provider token 对应的能力接口。 |
|
|
311
331
|
|
|
312
332
|
示例:
|
|
313
333
|
|
|
314
334
|
```ts
|
|
315
|
-
import {
|
|
335
|
+
import { Controller, Get, Module } from '@nestjs/common'
|
|
336
|
+
import { RequestData, success } from '@_tc/template-core'
|
|
337
|
+
import type { TemplateCoreRequestData } from '@_tc/template-core'
|
|
316
338
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
this.success(ctx, ctx.reqData?.data ?? {})
|
|
323
|
-
}
|
|
339
|
+
@Controller('api/demo')
|
|
340
|
+
class DemoController {
|
|
341
|
+
@Get('list')
|
|
342
|
+
list(@RequestData() request: TemplateCoreRequestData) {
|
|
343
|
+
return success(request.data)
|
|
324
344
|
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
export const getDemoService = ((app) => {
|
|
328
|
-
return class DemoService {
|
|
329
|
-
readonly app = app
|
|
330
|
-
}
|
|
331
|
-
}) satisfies ServiceFN
|
|
332
|
-
|
|
333
|
-
export const demoMiddleware = ((app) => async (ctx, next) => {
|
|
334
|
-
app.extends.logger?.info(ctx.path)
|
|
335
|
-
await next()
|
|
336
|
-
}) satisfies MiddlewareFN
|
|
345
|
+
}
|
|
337
346
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}) satisfies RouterFN
|
|
347
|
+
@Module({ controllers: [DemoController] })
|
|
348
|
+
export class BusinessModule {}
|
|
341
349
|
```
|
|
342
350
|
|
|
343
351
|
## model 数据如何配置
|
|
@@ -586,14 +594,13 @@ export default {
|
|
|
586
594
|
后端可以直接调用 loader:
|
|
587
595
|
|
|
588
596
|
```ts
|
|
589
|
-
import { modelLoader
|
|
597
|
+
import { modelLoader } from '@_tc/template-core'
|
|
590
598
|
|
|
591
|
-
|
|
592
|
-
const modelList = modelLoader(app)
|
|
593
|
-
return modelList
|
|
594
|
-
}
|
|
599
|
+
const modelList = modelLoader({ baseDir: process.cwd() })
|
|
595
600
|
```
|
|
596
601
|
|
|
602
|
+
`modelLoader` 的唯一参数是含 `baseDir: string` 的选项对象;`ModelLoaderOptions`、`ModelItem`、`ModelConfig` 类型也从根入口导出。内置 Nest Project Service 使用当前应用的 `baseDir` 调用同一 loader。
|
|
603
|
+
|
|
597
604
|
前端默认不直接读文件,而是通过内置接口获取:
|
|
598
605
|
|
|
599
606
|
```text
|
|
@@ -616,87 +623,66 @@ DELETE {api} -> 删除
|
|
|
616
623
|
|
|
617
624
|
`$schema::字段名` 表示从当前表格行读取字段值,常用于删除按钮参数。
|
|
618
625
|
|
|
619
|
-
###
|
|
620
|
-
|
|
621
|
-
项目可以创建 `app/router-guard.ts` 或 `app/router-guard.js`。它只在所有正常 `app/router/*` 路由都没有命中时执行。
|
|
626
|
+
### 服务端兜底路由
|
|
622
627
|
|
|
623
|
-
|
|
624
|
-
import type { Ctx, KoaApp } from '@_tc/template-core'
|
|
628
|
+
Nest 业务路由由 Controller 明确声明。未匹配的 TemplateCore API 请求保留框架的兜底协议;项目需要处理其他兜底行为时,按职责使用 Nest `ExceptionFilter`、`Guard` 或显式 Controller 路由。旧 `app/router-guard` 工厂返回字符串或 `{ status, body }` 的约定不再执行。
|
|
625
629
|
|
|
626
|
-
|
|
627
|
-
return (ctx: Ctx) => {
|
|
628
|
-
if (ctx.path.startsWith('/api/')) {
|
|
629
|
-
return {
|
|
630
|
-
status: 404,
|
|
631
|
-
body: { code: 404, message: `${ctx.path} not found` },
|
|
632
|
-
}
|
|
633
|
-
}
|
|
630
|
+
## 后端接入
|
|
634
631
|
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
```
|
|
639
|
-
|
|
640
|
-
返回字符串会 `ctx.redirect()`;返回 `{ status, body }` 会直接设置响应;无返回则使用框架默认兜底:API 路径返回 HTTP 200 + `{ code: 404, message }`,非 API 路径返回 HTTP 404 + `notFound`。
|
|
641
|
-
|
|
642
|
-
## 后端约定
|
|
643
|
-
|
|
644
|
-
项目目录会按下面规则加载:
|
|
645
|
-
|
|
646
|
-
```text
|
|
647
|
-
app/controller/**/*.(js|ts) -> app.controller
|
|
648
|
-
app/service/**/*.(js|ts) -> app.service
|
|
649
|
-
app/middlewares/**/*.(js|ts) -> app.middlewares
|
|
650
|
-
app/middleware.(js|ts) -> 全局中间件编排,按框架 -> 项目顺序执行
|
|
651
|
-
app/router/**/*.(js|ts) -> Koa router
|
|
652
|
-
app/router-schema/**/*.(js|ts) -> app.routerSchema
|
|
653
|
-
app/extends/*.(js|ts) -> app.extends
|
|
654
|
-
config/config.default.(js|ts) -> app.config
|
|
655
|
-
config/config.{env}.(js|ts) -> app.config
|
|
656
|
-
models/**/*.(js|ts) -> 内置 project service 按需读取的项目模型配置
|
|
657
|
-
```
|
|
632
|
+
消费方业务代码用 Nest `Module`、`Controller` 和 injectable `Provider` 组织,并通过 `serverStart({ businessModules })` 显式注册。不要依赖目录扫描来注册业务类。完整生成结构和 CRUD 示例见包内 `.skills/tc-generator/reference/project-template/` 与 `example.md`。
|
|
658
633
|
|
|
659
|
-
|
|
634
|
+
配置文件和模型文件仍由 TemplateCore loaders 读取。`config/` 与 `models/` 中的 `.js` / `.ts` 文件按 CommonJS 语义同步加载;`.ts` 文件使用 `export default`。Nest 业务源码放在独立目录(推荐 `backend/`),使用公开 `buildBE()` 编译,再由 JavaScript 启动器加载编译产物。若项目设置 `"type": "module"` 并使用 `.js` loader 文件,可在对应目录添加 `{ "type": "commonjs" }` 的局部 `package.json`。
|
|
660
635
|
|
|
661
|
-
|
|
636
|
+
### 请求与响应
|
|
662
637
|
|
|
663
|
-
|
|
638
|
+
`RequestData()` 注入 `headers`、解析后的 `body`、`query` 和 `data` 合并视图。`data` 按 query 后 body 合并,字段冲突时 body 优先;URL 参数使用 Nest `@Param()`。`RequestSchema()` 只验证显式标注的来源,不隐式转换或删除字段。JSON Controller 使用 `success(data)`、`fail(code, message)` 或 `sendData(data, code, message, status)` 返回 TemplateCore 协议;HTML、文件和 stream 由对应的 Nest 响应方式处理。
|
|
664
639
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
- `.mjs`、顶层 `await`、依赖原生 ESM 语义的后端约定文件当前不作为支持约定。
|
|
640
|
+
```ts
|
|
641
|
+
import { Body, Controller, Get, Post } from '@nestjs/common'
|
|
642
|
+
import { RequestData, success } from '@_tc/template-core'
|
|
643
|
+
import type { TemplateCoreRequestData } from '@_tc/template-core'
|
|
670
644
|
|
|
671
|
-
|
|
645
|
+
@Controller('api/setting')
|
|
646
|
+
export class SettingController {
|
|
647
|
+
@Get()
|
|
648
|
+
detail(@RequestData() request: TemplateCoreRequestData) {
|
|
649
|
+
return success({ language: request.headers['x-tc-language'] ?? 'en-US' })
|
|
650
|
+
}
|
|
672
651
|
|
|
673
|
-
|
|
652
|
+
@Post()
|
|
653
|
+
save(@Body() body: unknown) {
|
|
654
|
+
return success(body)
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
```
|
|
674
658
|
|
|
675
|
-
|
|
676
|
-
- `app.extends.crypto`:Node 侧加密辅助方法,支持 base64url 编解码、HMAC 签名、签名 payload 和常量时间比较。
|
|
677
|
-
- `app.extends.db`:默认 SQLite 框架数据库,提供 `getDBData/setDBData` 等通用数据方法。
|
|
659
|
+
### 框架 Provider
|
|
678
660
|
|
|
679
|
-
|
|
661
|
+
框架默认能力通过公开 `TC_*` token 注入。`providerOverrides` 支持 Nest 的 value、class、factory、existing provider 声明;`TC_CONFIG` 只读。比如替换 logger:
|
|
680
662
|
|
|
681
663
|
```ts
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
664
|
+
import { TC_LOGGER, serverStart } from '@_tc/template-core'
|
|
665
|
+
|
|
666
|
+
const logger = {
|
|
667
|
+
log: console.log,
|
|
668
|
+
info: console.info,
|
|
669
|
+
warn: console.warn,
|
|
670
|
+
error: console.error,
|
|
671
|
+
debug: console.debug,
|
|
672
|
+
trace: console.trace,
|
|
687
673
|
}
|
|
688
|
-
```
|
|
689
674
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
675
|
+
const app = await serverStart({
|
|
676
|
+
businessModules: [BusinessModule],
|
|
677
|
+
providerOverrides: [{ provide: TC_LOGGER, useValue: logger }],
|
|
678
|
+
})
|
|
679
|
+
```
|
|
694
680
|
|
|
695
|
-
`
|
|
681
|
+
将旧 Controller/Service 工厂迁移为 Nest 类及 constructor injection;将 Router 注册函数迁移为装饰器路由;将 Middleware、schema 校验和 `router-guard` 分别迁移到 Middleware、Guard、Pipe、Interceptor、Exception Filter 或显式 Controller 路由;将 `app.extends` 能力改为 `TC_*` Provider 注入及 `providerOverrides`。`baseFn` 的继承与 `this.success(ctx, ...)` 调用改为直接返回公开响应 helper,或继承 `TemplateCoreController` 并使用不带 `ctx` 参数的同名方法。旧 Koa 工厂和注册表不保证源码兼容。
|
|
696
682
|
|
|
697
683
|
### 数据库扩展
|
|
698
684
|
|
|
699
|
-
默认 `
|
|
685
|
+
默认 `TC_DATABASE` Provider 使用 SQLite 保存数据,数据库文件位于项目根目录 `.template-core/template-core.sqlite`。可以在配置中调整路径:
|
|
700
686
|
|
|
701
687
|
```ts
|
|
702
688
|
// config/config.default.ts
|
|
@@ -707,36 +693,29 @@ export default {
|
|
|
707
693
|
}
|
|
708
694
|
```
|
|
709
695
|
|
|
710
|
-
|
|
696
|
+
在 Nest Provider 中通过公开 token 使用:
|
|
711
697
|
|
|
712
698
|
```ts
|
|
713
|
-
import {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
const BaseController = baseFn.baseControllerFn(app)
|
|
699
|
+
import { Inject, Injectable } from '@nestjs/common'
|
|
700
|
+
import { TC_DATABASE } from '@_tc/template-core'
|
|
701
|
+
import type { FrameworkDB } from '@_tc/template-core'
|
|
717
702
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
namespace: 'setting',
|
|
722
|
-
})
|
|
703
|
+
@Injectable()
|
|
704
|
+
export class SettingService {
|
|
705
|
+
constructor(@Inject(TC_DATABASE) private readonly db: FrameworkDB) {}
|
|
723
706
|
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
save = async (ctx: Ctx) => {
|
|
728
|
-
app.extends.db.setDBData('site-setting', ctx.request.body, {
|
|
729
|
-
namespace: 'setting',
|
|
730
|
-
})
|
|
731
|
-
|
|
732
|
-
this.success(ctx, true)
|
|
733
|
-
}
|
|
707
|
+
detail() {
|
|
708
|
+
return this.db.getDBData('site-setting', { namespace: 'setting' }) ?? {}
|
|
734
709
|
}
|
|
735
|
-
}) satisfies ControllerFN
|
|
736
710
|
|
|
737
|
-
|
|
711
|
+
save(value: unknown) {
|
|
712
|
+
this.db.setDBData('site-setting', value, { namespace: 'setting' })
|
|
713
|
+
}
|
|
714
|
+
}
|
|
738
715
|
```
|
|
739
716
|
|
|
717
|
+
在 `BusinessModule` 的 `providers` 中注册 `SettingService`,再由 Controller 注入并返回 `success(service.detail())` 等响应结果。
|
|
718
|
+
|
|
740
719
|
常用方法:
|
|
741
720
|
|
|
742
721
|
- `getDBData(key, options)`:读取 JSON 数据。
|
|
@@ -757,7 +736,7 @@ SQL 注入边界:
|
|
|
757
736
|
|
|
758
737
|
### 加密扩展
|
|
759
738
|
|
|
760
|
-
`
|
|
739
|
+
`TC_CRYPTO` 默认使用应用配置中的 `signKey` 作为签名密钥,适合生成登录 token、接口签名和安全比较。Nest Provider 可通过构造函数注入:
|
|
761
740
|
|
|
762
741
|
常用方法:
|
|
763
742
|
|
|
@@ -770,159 +749,51 @@ SQL 注入边界:
|
|
|
770
749
|
- `verifySignedPayload(token, options)`:验证并解析签名串,失败返回 `null`。
|
|
771
750
|
|
|
772
751
|
```ts
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
752
|
+
import { Inject, Injectable } from '@nestjs/common'
|
|
753
|
+
import { TC_CRYPTO } from '@_tc/template-core'
|
|
754
|
+
import type { CryptoExtend } from '@_tc/template-core'
|
|
755
|
+
|
|
756
|
+
@Injectable()
|
|
757
|
+
export class AuthService {
|
|
758
|
+
constructor(@Inject(TC_CRYPTO) private readonly crypto: CryptoExtend) {}
|
|
778
759
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
760
|
+
createToken(account: string) {
|
|
761
|
+
const now = Date.now()
|
|
762
|
+
return this.crypto.createSignedPayload({
|
|
763
|
+
account,
|
|
764
|
+
exp: now + 1000 * 60 * 60 * 24 * 7,
|
|
765
|
+
iat: now,
|
|
766
|
+
})
|
|
767
|
+
}
|
|
784
768
|
|
|
785
|
-
|
|
769
|
+
verifyToken(token: string) {
|
|
770
|
+
return this.crypto.verifySignedPayload<{ account: string; exp: number; iat: number }>(token)
|
|
771
|
+
}
|
|
772
|
+
}
|
|
786
773
|
```
|
|
787
774
|
|
|
788
775
|
```ts
|
|
789
776
|
// 推荐:参数绑定
|
|
790
|
-
const users =
|
|
777
|
+
const users = db.queryDB(
|
|
791
778
|
'SELECT * FROM user WHERE name = ?',
|
|
792
|
-
[
|
|
779
|
+
[userName]
|
|
793
780
|
)
|
|
794
781
|
|
|
795
782
|
// 不推荐:拼接用户输入,有 SQL 注入风险
|
|
796
|
-
const unsafeUsers =
|
|
797
|
-
`SELECT * FROM user WHERE name = '${
|
|
783
|
+
const unsafeUsers = db.queryDB(
|
|
784
|
+
`SELECT * FROM user WHERE name = '${userName}'`
|
|
798
785
|
)
|
|
799
786
|
```
|
|
800
787
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
```ts
|
|
804
|
-
// app/extends/db.ts
|
|
805
|
-
import type { DB, DBFactory } from '@_tc/template-core'
|
|
806
|
-
|
|
807
|
-
interface DataOptions {
|
|
808
|
-
namespace?: string
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
const store = new Map<string, unknown>()
|
|
812
|
-
|
|
813
|
-
const getDB = ((_app) => {
|
|
814
|
-
const toKey = (key: string, namespace = 'framework') => `${namespace}:${key}`
|
|
815
|
-
|
|
816
|
-
const db = {
|
|
817
|
-
dbPath: 'memory',
|
|
818
|
-
getDBConnection: () => {
|
|
819
|
-
throw new Error('memory db 没有底层 SQLite connection')
|
|
820
|
-
},
|
|
821
|
-
execDB: () => undefined,
|
|
822
|
-
runDB: () => ({ changes: 0, lastInsertRowid: 0 }),
|
|
823
|
-
queryDB: <T extends object = Record<string, unknown>>() => [] as T[],
|
|
824
|
-
getDBFirst: <T extends object = Record<string, unknown>>() => undefined as T | undefined,
|
|
825
|
-
transactionDB: <T>(handler: (db: DB) => T) => handler(db),
|
|
826
|
-
getDBData: <T = unknown>(key: string, options?: DataOptions) => {
|
|
827
|
-
return store.get(toKey(key, options?.namespace)) as T | undefined
|
|
828
|
-
},
|
|
829
|
-
getDBDataRecord: <T = unknown>(key: string, options?: DataOptions) => {
|
|
830
|
-
const value = store.get(toKey(key, options?.namespace)) as T | undefined
|
|
831
|
-
if (value === undefined) return undefined
|
|
832
|
-
|
|
833
|
-
return {
|
|
834
|
-
key,
|
|
835
|
-
value,
|
|
836
|
-
namespace: options?.namespace ?? 'framework',
|
|
837
|
-
createdAt: '',
|
|
838
|
-
updatedAt: '',
|
|
839
|
-
}
|
|
840
|
-
},
|
|
841
|
-
setDBData: <T = unknown>(key: string, value: T, options?: DataOptions) => {
|
|
842
|
-
store.set(toKey(key, options?.namespace), value)
|
|
843
|
-
return { changes: 1, lastInsertRowid: 0 }
|
|
844
|
-
},
|
|
845
|
-
hasDBData: (key: string, options?: DataOptions) => {
|
|
846
|
-
return store.has(toKey(key, options?.namespace))
|
|
847
|
-
},
|
|
848
|
-
deleteDBData: (key: string, options?: DataOptions) => {
|
|
849
|
-
return store.delete(toKey(key, options?.namespace))
|
|
850
|
-
},
|
|
851
|
-
listDBData: <T = unknown>(options?: DataOptions) => {
|
|
852
|
-
const namespace = options?.namespace ?? 'framework'
|
|
853
|
-
|
|
854
|
-
return Array.from(store.entries())
|
|
855
|
-
.filter(([key]) => key.startsWith(`${namespace}:`))
|
|
856
|
-
.map(([key, value]) => ({
|
|
857
|
-
key: key.slice(namespace.length + 1),
|
|
858
|
-
value: value as T,
|
|
859
|
-
namespace,
|
|
860
|
-
createdAt: '',
|
|
861
|
-
updatedAt: '',
|
|
862
|
-
}))
|
|
863
|
-
},
|
|
864
|
-
countDBData: () => store.size,
|
|
865
|
-
clearDBData: () => {
|
|
866
|
-
const size = store.size
|
|
867
|
-
store.clear()
|
|
868
|
-
return size
|
|
869
|
-
},
|
|
870
|
-
closeDB: () => undefined,
|
|
871
|
-
} satisfies DB
|
|
872
|
-
|
|
873
|
-
return db
|
|
874
|
-
}) satisfies DBFactory
|
|
875
|
-
|
|
876
|
-
export default getDB
|
|
877
|
-
```
|
|
878
|
-
|
|
879
|
-
Controller 示例:
|
|
880
|
-
|
|
881
|
-
```ts
|
|
882
|
-
import { baseFn, type ControllerFN, type Ctx } from '@_tc/template-core'
|
|
883
|
-
|
|
884
|
-
const getProductController = ((app) => {
|
|
885
|
-
const BaseController = baseFn.baseControllerFn(app)
|
|
886
|
-
|
|
887
|
-
return class ProductController extends BaseController {
|
|
888
|
-
list = async (ctx: Ctx) => {
|
|
889
|
-
this.success(ctx, {
|
|
890
|
-
data: [],
|
|
891
|
-
page: 1,
|
|
892
|
-
pageSize: 10,
|
|
893
|
-
total: 0,
|
|
894
|
-
})
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
}) satisfies ControllerFN
|
|
898
|
-
|
|
899
|
-
export default getProductController
|
|
900
|
-
```
|
|
901
|
-
|
|
902
|
-
Router 示例:
|
|
788
|
+
项目可以通过 `providerOverrides` 替换默认数据库;自定义实现应满足公开 `FrameworkDB` 接口,并在业务 Module 中通过 `TC_DATABASE` 注入。
|
|
903
789
|
|
|
904
790
|
```ts
|
|
905
|
-
import
|
|
906
|
-
|
|
907
|
-
export default (app: KoaApp, router: Router) => {
|
|
908
|
-
router.get('/api/product/list', app.controller.product.list)
|
|
909
|
-
}
|
|
910
|
-
```
|
|
911
|
-
|
|
912
|
-
路由挂载顺序:
|
|
791
|
+
import { TC_DATABASE, serverStart } from '@_tc/template-core'
|
|
913
792
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
```ts
|
|
920
|
-
import type { KoaApp, Router } from '@_tc/template-core'
|
|
921
|
-
|
|
922
|
-
export default (app: KoaApp, router: Router) => {
|
|
923
|
-
router.level = 10
|
|
924
|
-
router.get('/api/fallback/:id', app.controller.fallback.detail)
|
|
925
|
-
}
|
|
793
|
+
const app = await serverStart({
|
|
794
|
+
businessModules: [BusinessModule],
|
|
795
|
+
providerOverrides: [{ provide: TC_DATABASE, useClass: CustomDatabase }],
|
|
796
|
+
})
|
|
926
797
|
```
|
|
927
798
|
|
|
928
799
|
## 前端公共能力
|
|
@@ -957,6 +828,7 @@ import {
|
|
|
957
828
|
setLanguage,
|
|
958
829
|
setResources,
|
|
959
830
|
setAuthToken,
|
|
831
|
+
setUnauthorizedHandler,
|
|
960
832
|
ThemeSwitch,
|
|
961
833
|
t,
|
|
962
834
|
useApiFreezer,
|
|
@@ -983,6 +855,7 @@ import type {
|
|
|
983
855
|
SchemaFormComponentsMap,
|
|
984
856
|
SchemaFormNamespace,
|
|
985
857
|
SelectProps,
|
|
858
|
+
UnauthorizedHandler,
|
|
986
859
|
} from '@_tc/template-core/fe'
|
|
987
860
|
```
|
|
988
861
|
|
|
@@ -997,6 +870,7 @@ import type {
|
|
|
997
870
|
| SchemaPage 类型 | `CallComComponentsMap`、`CallComRenderer`、`SchemaTableRenderComponent`、`SchemaTableRenderComponentsMap` |
|
|
998
871
|
| SchemaForm 类型 | `FormFieldSchema`、`SchemaFormComponentsMap`、`SchemaFormNamespace`、`SelectProps` |
|
|
999
872
|
| 请求方法 | `api`、`request`、`get`、`post`、`put`、`patch`、`del` |
|
|
873
|
+
| HTTP 401 处理 | `setUnauthorizedHandler`、`UnauthorizedHandler` |
|
|
1000
874
|
| 请求类型 | `BaseResponse`、`PageParams`、`PageResponse`、`RequestConfig`、`ResponseConfig`、`AxiosError` |
|
|
1001
875
|
| RAF 风格计时器 | `rafSetTimeout`、`rafSetInterval`、`rafClearTimeout`、`rafClearInterval`、`clearRafTimer`、`RafTimerId`、`RafTimerCallback` |
|
|
1002
876
|
| Token 工具 | `getAuthToken`、`setAuthToken`、`clearAuthToken`、`localKeyMap` |
|
|
@@ -1009,7 +883,7 @@ import type {
|
|
|
1009
883
|
|
|
1010
884
|
`renderImportComponent` 封装了 `React.lazy` + `Suspense`,默认会用页面骨架屏作为 fallback。`getAuthToken()`、`setAuthToken()` 和 `clearAuthToken()` 用于读写或清理本地短 token,`localKeyMap` 暴露对应的本地存储 key 常量。
|
|
1011
885
|
|
|
1012
|
-
只使用请求层时,也可以从 `@_tc/template-core/fe/common/request` 导入 `api
|
|
886
|
+
只使用请求层时,也可以从 `@_tc/template-core/fe/common/request` 导入 `api`、请求方法、请求类型及 `setUnauthorizedHandler` / `UnauthorizedHandler`;这是发布包显式子路径,不要下钻到 `frontend/src/common/request`。
|
|
1013
887
|
|
|
1014
888
|
### 前端多语言
|
|
1015
889
|
|
|
@@ -1268,7 +1142,7 @@ RAF 风格计时器通过 `@_tc/template-core/fe` 对外提供,浏览器优先
|
|
|
1268
1142
|
- `BASE_URL`:固定为 `/api`
|
|
1269
1143
|
- `timeout`:15000ms(15秒)
|
|
1270
1144
|
- `credentials`:`'include'`,支持跨域携带 cookie
|
|
1271
|
-
- `window._signKey
|
|
1145
|
+
- `window._signKey`:由服务端页面模板从应用配置的 `signKey` 注入
|
|
1272
1146
|
- 默认会先设置 `Content-Type: application/json`;如果是上传文件、`FormData` 或其他内容类型,请在请求配置里显式覆盖
|
|
1273
1147
|
|
|
1274
1148
|
**请求拦截器**:
|
|
@@ -1287,17 +1161,64 @@ RAF 风格计时器通过 `@_tc/template-core/fe` 对外提供,浏览器优先
|
|
|
1287
1161
|
`Authorization` 默认对应服务端配置 `config.auth.ATKey`。前端本地 token 存在 `localStorage.auth_token`,项目 key 存在 `localStorage.p_J_k`;刷新 token header 名预留为 `config.auth.RTKey`,默认是 `RT`。
|
|
1288
1162
|
|
|
1289
1163
|
**签名机制**:
|
|
1290
|
-
-
|
|
1164
|
+
- 签名密钥:服务端从应用配置的 `signKey` 读取,并在页面渲染时注入为 `window._signKey`
|
|
1291
1165
|
- 签名算法:`md5(签名密钥_${时间戳})`
|
|
1292
1166
|
- 服务端会在非 local 环境下校验签名和时间戳
|
|
1293
1167
|
|
|
1294
1168
|
**响应拦截器**:
|
|
1295
1169
|
|
|
1296
|
-
- **401 处理**:自动清空 token
|
|
1170
|
+
- **401 处理**:自动清空 token,默认跳转到 `/login`;可注册 `setUnauthorizedHandler` 接管跳转
|
|
1297
1171
|
- **错误提取**:自动从响应中提取 `message`、`msg` 或 `errors` 字段
|
|
1298
1172
|
- **超时处理**:请求超时会返回当前语言的超时提示
|
|
1299
1173
|
- **网络错误**:网络异常会返回当前语言的网络错误提示
|
|
1300
1174
|
|
|
1175
|
+
#### 自定义 HTTP 401 处理
|
|
1176
|
+
|
|
1177
|
+
`setUnauthorizedHandler(handler?: UnauthorizedHandler): void` 与 `UnauthorizedHandler` 均从
|
|
1178
|
+
`@_tc/template-core/fe`、`@_tc/template-core/fe/common/request` 导出。回调类型为
|
|
1179
|
+
`(error: AxiosError) => void | Promise<void>`,可执行同步或异步业务处理。
|
|
1180
|
+
|
|
1181
|
+
HTTP 401 时框架先清理 token,再调用当前 handler,handler 仅接管默认跳转。后一次注册替换前一次注册;调用 `setUnauthorizedHandler()` 或传入 `undefined` 恢复 `/login`,空函数则接管且不跳转。handler 完成、抛出或拒绝后,框架仍提取并记录原请求错误,请求仍以原错误拒绝。非 401 处理不变。
|
|
1182
|
+
|
|
1183
|
+
在 `frontend/extended/dash/init.ts` 的首次请求前注册。内置 Dashboard 等待 init 完成后才渲染并请求模型;独立前端入口则在自身首次请求前注册。仅修改登录地址时保留默认响应拦截器,业务登录地址可与页面守卫共享:
|
|
1184
|
+
|
|
1185
|
+
```ts
|
|
1186
|
+
// frontend/src/login.ts
|
|
1187
|
+
export const loginUrl = '/admin/login'
|
|
1188
|
+
```
|
|
1189
|
+
|
|
1190
|
+
```ts
|
|
1191
|
+
// frontend/extended/dash/init.ts
|
|
1192
|
+
import { setUnauthorizedHandler } from '@_tc/template-core/fe/common/request'
|
|
1193
|
+
import type { UnauthorizedHandler } from '@_tc/template-core/fe/common/request'
|
|
1194
|
+
import type { DashInit } from '@_tc/template-core/fe'
|
|
1195
|
+
import { loginUrl } from '../../src/login'
|
|
1196
|
+
|
|
1197
|
+
const onUnauthorized: UnauthorizedHandler = () => {
|
|
1198
|
+
if (typeof window !== 'undefined') window.location.assign(loginUrl)
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
const initDash: DashInit = () => {
|
|
1202
|
+
setUnauthorizedHandler(onUnauthorized)
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
export default initDash
|
|
1206
|
+
```
|
|
1207
|
+
|
|
1208
|
+
```ts
|
|
1209
|
+
// frontend/extended/dash/routeGuard.ts
|
|
1210
|
+
import type { DashRouteGuard } from '@_tc/template-core/fe'
|
|
1211
|
+
import { loginUrl } from '../../src/login'
|
|
1212
|
+
|
|
1213
|
+
const dashRouteGuard: DashRouteGuard = ({ isLoggedIn }) => {
|
|
1214
|
+
if (!isLoggedIn) return loginUrl
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export default dashRouteGuard
|
|
1218
|
+
```
|
|
1219
|
+
|
|
1220
|
+
HTTP handler 与页面守卫分别处理请求失败和 Dashboard 初始化,互不覆盖、互不调用;框架不按 `pageBasePath` 推导登录地址。已有 `routeGuard` 返回 `undefined` 时中断内置重定向的语义保持不变。
|
|
1221
|
+
|
|
1301
1222
|
**使用示例**:
|
|
1302
1223
|
|
|
1303
1224
|
```ts
|
|
@@ -1641,12 +1562,12 @@ model 中用 `custom` 菜单指向自定义路径:
|
|
|
1641
1562
|
|
|
1642
1563
|
## 前端构建 buildFE
|
|
1643
1564
|
|
|
1644
|
-
|
|
1565
|
+
日常前端开发使用 `serverStart({ baseDir, businessModules, frontendDev: true })`。仅需要磁盘构建产物时使用以下监听方式,并在退出时关闭 watcher:
|
|
1645
1566
|
|
|
1646
1567
|
```ts
|
|
1647
1568
|
import { buildFE } from '@_tc/template-core/bundler'
|
|
1648
1569
|
|
|
1649
|
-
await buildFE('dev')
|
|
1570
|
+
const watcher = await buildFE('dev', { baseDir, output: 'run' })
|
|
1650
1571
|
```
|
|
1651
1572
|
|
|
1652
1573
|
生产构建:
|
|
@@ -1685,7 +1606,7 @@ import { buildBE } from '@_tc/template-core/bundler'
|
|
|
1685
1606
|
await buildBE()
|
|
1686
1607
|
```
|
|
1687
1608
|
|
|
1688
|
-
|
|
1609
|
+
消费方脚本示例(推荐的 `backend/` 必须显式加入 `input`):
|
|
1689
1610
|
|
|
1690
1611
|
```js
|
|
1691
1612
|
// scripts/build-be.mjs
|
|
@@ -1693,11 +1614,11 @@ import { buildBE } from '@_tc/template-core/bundler'
|
|
|
1693
1614
|
|
|
1694
1615
|
await buildBE({
|
|
1695
1616
|
rootDir: process.cwd(),
|
|
1696
|
-
input: ['
|
|
1617
|
+
input: ['backend'],
|
|
1697
1618
|
outDir: 'dist',
|
|
1698
1619
|
format: 'cjs',
|
|
1699
1620
|
alias: {
|
|
1700
|
-
'@
|
|
1621
|
+
'@backend': './backend',
|
|
1701
1622
|
'@model': './models',
|
|
1702
1623
|
},
|
|
1703
1624
|
})
|
|
@@ -1718,7 +1639,7 @@ await buildBE({
|
|
|
1718
1639
|
import chokidar from 'chokidar'
|
|
1719
1640
|
import { buildBE } from '@_tc/template-core/bundler'
|
|
1720
1641
|
|
|
1721
|
-
const input = ['
|
|
1642
|
+
const input = ['backend']
|
|
1722
1643
|
|
|
1723
1644
|
let building = false
|
|
1724
1645
|
let pending = false
|
|
@@ -1739,7 +1660,7 @@ async function runBuild() {
|
|
|
1739
1660
|
outDir: 'dist',
|
|
1740
1661
|
format: 'cjs',
|
|
1741
1662
|
alias: {
|
|
1742
|
-
'@
|
|
1663
|
+
'@backend': './backend',
|
|
1743
1664
|
'@model': './models',
|
|
1744
1665
|
},
|
|
1745
1666
|
})
|
|
@@ -1794,11 +1715,11 @@ chokidar
|
|
|
1794
1715
|
|
|
1795
1716
|
```ts
|
|
1796
1717
|
await buildBE({
|
|
1797
|
-
input: ['
|
|
1718
|
+
input: ['backend', 'config', 'models'],
|
|
1798
1719
|
outDir: 'dist',
|
|
1799
1720
|
format: ['es', 'cjs'],
|
|
1800
1721
|
alias: {
|
|
1801
|
-
'@
|
|
1722
|
+
'@backend': './backend',
|
|
1802
1723
|
'@model': './models',
|
|
1803
1724
|
},
|
|
1804
1725
|
})
|
|
@@ -1821,7 +1742,7 @@ await buildBE({
|
|
|
1821
1742
|
|
|
1822
1743
|
```ts
|
|
1823
1744
|
await buildBE({
|
|
1824
|
-
input: ['
|
|
1745
|
+
input: ['backend', 'config', 'models'],
|
|
1825
1746
|
allowMissingInput: true,
|
|
1826
1747
|
})
|
|
1827
1748
|
```
|
|
@@ -2151,7 +2072,7 @@ declare module '@_tc/template-core/fe/rc' {
|
|
|
2151
2072
|
|
|
2152
2073
|
- `FieldTypes` 用来增加字段类型名。
|
|
2153
2074
|
- `PropsMap` 用来绑定该字段的 props 类型。
|
|
2154
|
-
- 类型声明只负责 TS
|
|
2075
|
+
- 类型声明只负责 TS 校验。运行时可将组件 map 放在 `frontend/extended/SchemaForm/data.ts`,并在 `dash/init.ts` 或 `initApp()` 的 `beforeRender` 中调用公开的 `registerSchemaFormComponents(map)`(来自 `@_tc/template-core/fe/rc/forms`)。文件存在不会自动完成注册;框架的 `registerFrontendSchemaFormComponents()` 只注册框架字段。完整例子见包内 `.skills/tc-component-usage-skills/reference/patterns.md`。
|
|
2155
2076
|
|
|
2156
2077
|
### Model mode 类型扩展
|
|
2157
2078
|
|
|
@@ -2239,59 +2160,9 @@ declare module '@_tc/template-core/models' {
|
|
|
2239
2160
|
- 运行时组件注册在 `frontend/extended/SchemaPage/SchemaTable/data.ts`。
|
|
2240
2161
|
- 组件运行时会自动收到 `value`、`record`、`rowIndex`、`fieldKey`;`renderComponentProps` 只配置自定义参数。
|
|
2241
2162
|
|
|
2242
|
-
###
|
|
2243
|
-
|
|
2244
|
-
使用方推荐增强根包 `@_tc/template-core`:
|
|
2245
|
-
|
|
2246
|
-
```ts
|
|
2247
|
-
// typing/template-core.d.ts
|
|
2248
|
-
import '@_tc/template-core'
|
|
2249
|
-
|
|
2250
|
-
declare module '@_tc/template-core' {
|
|
2251
|
-
namespace FrameworkAugment {
|
|
2252
|
-
interface IServiceAugmented {
|
|
2253
|
-
product: {
|
|
2254
|
-
list(): Promise<unknown[]>
|
|
2255
|
-
}
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
interface IControllerAugmented {
|
|
2259
|
-
product: {
|
|
2260
|
-
list(ctx: import('@_tc/template-core').Ctx): Promise<void>
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
interface IExtendsAugmented {
|
|
2265
|
-
redis: {
|
|
2266
|
-
get(key: string): Promise<string | null>
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
interface IMiddlewaresAugmented {
|
|
2271
|
-
auth: import('koa').Middleware
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
|
-
interface AppConfigAugmented {
|
|
2275
|
-
authSecret: string
|
|
2276
|
-
}
|
|
2277
|
-
}
|
|
2278
|
-
}
|
|
2279
|
-
```
|
|
2163
|
+
### 后端业务类型
|
|
2280
2164
|
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
```ts
|
|
2284
|
-
import type { KoaApp } from '@_tc/template-core'
|
|
2285
|
-
|
|
2286
|
-
export default (app: KoaApp) => {
|
|
2287
|
-
app.config.authSecret
|
|
2288
|
-
app.service.product.list()
|
|
2289
|
-
app.extends.$fetch.get('https://example.com/api')
|
|
2290
|
-
app.extends.redis.get('token')
|
|
2291
|
-
}
|
|
2292
|
-
```
|
|
2293
|
-
|
|
2294
|
-
如果在 TemplateCore 仓库源码内部扩展,声明目标通常是内部别名 `@tc/core`;npm 使用方不要依赖 `@tc/*` 内部路径。
|
|
2165
|
+
Nest 业务 Service、Controller 与自定义 Provider 使用普通 TypeScript 类型和 constructor injection,注册在消费方 Module 的 `providers` / `controllers` 中。旧 `FrameworkAugment` 下的 app 注册表增强不再用于业务依赖;自定义配置通过只读 `ConfigService` 或 `TC_CONFIG` 获取。框架默认能力使用公开 token 与相应接口,不从 `@tc/*` 内部路径导入。
|
|
2295
2166
|
|
|
2296
2167
|
## 可选:给项目 AI 助手的文档与 Skill
|
|
2297
2168
|
|
|
@@ -2301,21 +2172,23 @@ export default (app: KoaApp) => {
|
|
|
2301
2172
|
|
|
2302
2173
|
| Skill | 用途 |
|
|
2303
2174
|
| --- | --- |
|
|
2304
|
-
| `tc-generator` |
|
|
2175
|
+
| `tc-generator` | 生成显式 Nest 业务模块、model 配置、Schema CRUD、前端扩展和 SSR 页面。 |
|
|
2305
2176
|
| `tc-component-usage-skills` | 指导 Agent 选用和正确使用内置 React 组件库(Button、Form、DataTable、Modal 等)。 |
|
|
2306
2177
|
|
|
2307
2178
|
如果你的 Agent 支持本地 skills 目录,可以从已安装的 npm 包复制安装。以 Codex 为例:
|
|
2308
2179
|
|
|
2309
2180
|
```bash
|
|
2310
|
-
mkdir -p "$
|
|
2311
|
-
cp -R node_modules/@_tc/template-core/.skills/tc-generator "$
|
|
2312
|
-
cp -R node_modules/@_tc/template-core/.skills/tc-component-usage-skills "$
|
|
2181
|
+
mkdir -p "$HOME/.agents/skills"
|
|
2182
|
+
cp -R node_modules/@_tc/template-core/.skills/tc-generator "$HOME/.agents/skills/"
|
|
2183
|
+
cp -R node_modules/@_tc/template-core/.skills/tc-component-usage-skills "$HOME/.agents/skills/"
|
|
2313
2184
|
```
|
|
2314
2185
|
|
|
2315
2186
|
安装后重启对应 Agent,让新 skill 生效。使用时可以直接说”用 tc-generator 生成一个商品管理模块”或”用 tc-component-usage-skills 帮我写一个带搜索的分页表格”。
|
|
2316
2187
|
|
|
2317
2188
|
其他 Agent 如果不支持自动安装 skill,也可以直接读取 `.skills/tc-generator/SKILL.md` 或 `.skills/tc-component-usage-skills/SKILL.md`,再按需读取 `reference/` 下的参考文件。
|
|
2318
2189
|
|
|
2190
|
+
升级 TemplateCore 后同步更新复制安装的 Skill 与其整个 `reference/` 目录。先备份并移走旧 Skill 目录,再按上述命令复制,避免目录合并留下已删除的旧模板;自行定制的内容按需合并。使用项目模板时,保留现有项目的 registry/版本选择;新项目将模板里的 `latest` 替换为提供该 Skill 的已安装包版本或指定 tag,私有 `beta` 不会由 `latest` 选中。
|
|
2191
|
+
|
|
2319
2192
|
## 注意事项
|
|
2320
2193
|
|
|
2321
2194
|
- 不要在项目代码里引用 `dist/fe/*`、`dist/models/*` 这类构建产物路径。
|
|
@@ -2324,6 +2197,10 @@ cp -R node_modules/@_tc/template-core/.skills/tc-component-usage-skills "${CODEX
|
|
|
2324
2197
|
- `model` 数组合并依赖稳定 `key`。
|
|
2325
2198
|
- Dashboard 默认需要 URL 带 `?projk=项目key`。
|
|
2326
2199
|
- Dashboard 登录守卫放在 `frontend/extended/dash/routeGuard.ts`;登录页通常不在 Dash 路由下,返回登录页 URL 即可。
|
|
2327
|
-
-
|
|
2200
|
+
- 服务端自定义鉴权和兜底行为使用 Nest Guard、Exception Filter 或显式 Controller 路由。
|
|
2328
2201
|
- 前端入口必须命名为 `.entry.tsx`、`.entry.ts`、`.entry.jsx` 或 `.entry.js`。
|
|
2329
2202
|
- 入口同目录的 `.html` 只能作为插槽文件使用,不能写完整 HTML 文档;页面外壳始终由 `app/view/entry.tpl` 生成。
|
|
2203
|
+
|
|
2204
|
+
## Vite 开发模式
|
|
2205
|
+
|
|
2206
|
+
编译 Nest 后端后,使用 `serverStart({ baseDir, businessModules, frontendDev: true })` 开启同源 Vite、React Fast Refresh 和实时 SSR,无需先构建 FE/SSR。生成项目使用 `pnpm dev`。关闭时等待 `app.close()`;生产不传 `frontendDev`,继续使用已构建的模板和私有 SSR 产物。`buildFE('dev')` 是磁盘构建监听,返回的 watcher 需要 `await watcher.close()`。
|