@nocobase/plugin-ai 2.1.0-alpha.45 → 2.1.0-alpha.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/ai/docs/nocobase/ai-dev/capabilities.md +1 -1
  2. package/dist/ai/docs/nocobase/ai-dev/index.md +1 -1
  3. package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +1 -1
  4. package/dist/ai/docs/nocobase/api/cli/config/delete.md +4 -1
  5. package/dist/ai/docs/nocobase/api/cli/config/get.md +4 -1
  6. package/dist/ai/docs/nocobase/api/cli/config/index.md +21 -0
  7. package/dist/ai/docs/nocobase/api/cli/config/set.md +9 -2
  8. package/dist/ai/docs/nocobase/api/cli/self/update.md +2 -0
  9. package/dist/ai/docs/nocobase/get-started/installation/env.md +6 -2
  10. package/dist/ai/docs/nocobase/integration/embed/index.md +3 -3
  11. package/dist/ai/docs/nocobase/plugin-development/build.md +5 -0
  12. package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +3 -3
  13. package/dist/ai/docs/nocobase/plugin-development/client/component/index.md +1 -1
  14. package/dist/ai/docs/nocobase/plugin-development/client/ctx/common-capabilities.md +2 -2
  15. package/dist/ai/docs/nocobase/plugin-development/client/ctx/index.md +1 -1
  16. package/dist/ai/docs/nocobase/plugin-development/client/router.md +11 -11
  17. package/dist/ai/docs/nocobase/plugin-development/write-your-first-plugin.md +28 -0
  18. package/dist/ai/docs/nocobase/solution/crm/changelog.md +0 -3
  19. package/dist/ai/docs/nocobase/solution/crm/installation.md +6 -76
  20. package/dist/ai/docs/nocobase/solution/crm/v1.md +6 -43
  21. package/dist/ai/docs/nocobase/solution/ticket-system/changelog.md +0 -2
  22. package/dist/ai/docs/nocobase/solution/ticket-system/installation.md +6 -69
  23. package/dist/ai/docs/nocobase/workflow/nodes/javascript.md +4 -2
  24. package/dist/client/{406.15c09d98faa2ccf1.js → 406.9a530334eae8cede.js} +1 -1
  25. package/dist/client/{428.e9f38da3b0d8b498.js → 428.431a00d29107058e.js} +1 -1
  26. package/dist/client/index.js +2 -2
  27. package/dist/client-v2/index.js +1 -1
  28. package/dist/externalVersion.js +18 -18
  29. package/dist/locale/de-DE.json +1 -0
  30. package/dist/locale/en-US.json +2 -1
  31. package/dist/locale/es-ES.json +1 -0
  32. package/dist/locale/fr-FR.json +1 -0
  33. package/dist/locale/hu-HU.json +1 -0
  34. package/dist/locale/id-ID.json +1 -0
  35. package/dist/locale/it-IT.json +1 -0
  36. package/dist/locale/ja-JP.json +1 -0
  37. package/dist/locale/ko-KR.json +1 -0
  38. package/dist/locale/nl-NL.json +1 -0
  39. package/dist/locale/pt-BR.json +1 -0
  40. package/dist/locale/ru-RU.json +1 -0
  41. package/dist/locale/tr-TR.json +1 -0
  42. package/dist/locale/uk-UA.json +1 -0
  43. package/dist/locale/vi-VN.json +1 -0
  44. package/dist/locale/zh-CN.json +2 -1
  45. package/dist/locale/zh-TW.json +1 -0
  46. package/dist/node_modules/@langchain/xai/package.json +1 -1
  47. package/dist/node_modules/fs-extra/package.json +1 -1
  48. package/dist/node_modules/jsonrepair/package.json +1 -1
  49. package/dist/node_modules/just-bash/package.json +1 -1
  50. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  51. package/dist/node_modules/openai/package.json +1 -1
  52. package/dist/node_modules/zod/package.json +1 -1
  53. package/dist/server/llm-providers/anthropic.js +17 -23
  54. package/dist/server/llm-providers/dashscope.js +3 -3
  55. package/dist/server/llm-providers/deepseek.js +2 -2
  56. package/dist/server/llm-providers/google-genai.js +17 -22
  57. package/dist/server/llm-providers/kimi/provider.js +4 -4
  58. package/dist/server/llm-providers/mimo.js +2 -2
  59. package/dist/server/llm-providers/ollama.js +14 -21
  60. package/dist/server/llm-providers/openai/completions.js +2 -2
  61. package/dist/server/llm-providers/openai/embedding.js +1 -1
  62. package/dist/server/llm-providers/openai/responses.js +2 -2
  63. package/dist/server/llm-providers/provider.d.ts +3 -1
  64. package/dist/server/llm-providers/provider.js +55 -22
  65. package/dist/server/llm-providers/xai.js +2 -2
  66. package/dist/server/resource/ai.js +11 -9
  67. package/dist/server/workflow/nodes/employee/types.d.ts +2 -2
  68. package/package.json +2 -2
@@ -18,7 +18,7 @@ Here is a list of everything AI can currently help you do. Each capability comes
18
18
 
19
19
  :::warning Note
20
20
 
21
- - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v2/` path. It is available for early access and experimentation, but is not recommended for production use.
21
+ - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v/` path. It is available for early access and experimentation, but is not recommended for production use.
22
22
  - AI-generated code may not be 100% correct. We recommend reviewing it before enabling. If you encounter issues at runtime, send the error message to AI and let it investigate and fix -- it usually takes just a few rounds of conversation to resolve.
23
23
  - We recommend using GPT or Claude series models for development, as they produce the best results. Other models can also work, but generation quality may vary.
24
24
 
@@ -33,7 +33,7 @@ Your browser will automatically open the visual configuration page, guiding you
33
33
 
34
34
  :::warning Note
35
35
 
36
- - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v2/` path. It is available for early access and experimentation, but is not recommended for production use.
36
+ - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v/` path. It is available for early access and experimentation, but is not recommended for production use.
37
37
  - AI-generated code may not be 100% correct. We recommend reviewing it before enabling. If you encounter issues at runtime, send the error message to AI and let it investigate and fix -- it usually takes just a few rounds of conversation to resolve.
38
38
  - We recommend using GPT or Claude series models for development, as they produce the best results. Other models can also work, but generation quality may vary.
39
39
 
@@ -34,7 +34,7 @@ Make sure you have:
34
34
 
35
35
  :::warning Note
36
36
 
37
- - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v2/` path. It is available for early access and experimentation, but is not recommended for production use.
37
+ - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v/` path. It is available for early access and experimentation, but is not recommended for production use.
38
38
  - AI-generated code may not be 100% correct. We recommend reviewing it before enabling. If you encounter issues at runtime, send the error message to AI and let it investigate and fix -- it usually takes just a few rounds of conversation to resolve.
39
39
 
40
40
  :::
@@ -18,14 +18,17 @@ nb config delete <key>
18
18
 
19
19
  | Parameter | Type | Description |
20
20
  | --- | --- | --- |
21
- | `<key>` | string | Configuration key: `license.pkg-url`, `docker.network`, or `docker.container-prefix` |
21
+ | `<key>` | string | Configuration key: `locale`, `update.policy`, `license.pkg-url`, `docker.network`, `docker.container-prefix`, `bin.docker`, `bin.git`, or `bin.yarn` |
22
22
 
23
23
  ## Examples
24
24
 
25
25
  ```bash
26
+ nb config delete locale
27
+ nb config delete update.policy
26
28
  nb config delete license.pkg-url
27
29
  nb config delete docker.network
28
30
  nb config delete docker.container-prefix
31
+ nb config delete bin.git
29
32
  ```
30
33
 
31
34
  ## Related Commands
@@ -18,14 +18,17 @@ nb config get <key>
18
18
 
19
19
  | Parameter | Type | Description |
20
20
  | --- | --- | --- |
21
- | `<key>` | string | Configuration key: `license.pkg-url`, `docker.network`, or `docker.container-prefix` |
21
+ | `<key>` | string | Configuration key: `locale`, `update.policy`, `license.pkg-url`, `docker.network`, `docker.container-prefix`, `bin.docker`, `bin.git`, or `bin.yarn` |
22
22
 
23
23
  ## Examples
24
24
 
25
25
  ```bash
26
+ nb config get locale
27
+ nb config get update.policy
26
28
  nb config get license.pkg-url
27
29
  nb config get docker.network
28
30
  nb config get docker.container-prefix
31
+ nb config get bin.git
29
32
  ```
30
33
 
31
34
  ## Related Commands
@@ -8,9 +8,27 @@ keywords: "nb config,NocoBase CLI,configuration,defaults"
8
8
 
9
9
  Manage CLI configuration defaults. Supported keys:
10
10
 
11
+ - `locale`
12
+ - `update.policy`
11
13
  - `license.pkg-url`
12
14
  - `docker.network`
13
15
  - `docker.container-prefix`
16
+ - `bin.docker`
17
+ - `bin.git`
18
+ - `bin.yarn`
19
+
20
+ ## Common Keys
21
+
22
+ | Key | Default | Description |
23
+ | --- | --- | --- |
24
+ | `locale` | current CLI locale resolution | Override the CLI locale |
25
+ | `update.policy` | `prompt` | Startup update behavior: `prompt`, `auto`, or `off` |
26
+ | `license.pkg-url` | `https://pkg.nocobase.com/` | Package registry for commercial packages |
27
+ | `docker.network` | `nocobase` | Default Docker network used by CLI-managed Docker apps |
28
+ | `docker.container-prefix` | `nb` | Default container prefix used by CLI-managed Docker apps |
29
+ | `bin.docker` | `docker` | Override the Docker executable path |
30
+ | `bin.git` | `git` | Override the Git executable path |
31
+ | `bin.yarn` | `yarn` | Override the Yarn executable path |
14
32
 
15
33
  ## Usage
16
34
 
@@ -31,8 +49,11 @@ nb config <command>
31
49
 
32
50
  ```bash
33
51
  nb config list
52
+ nb config get update.policy
53
+ nb config set update.policy auto
34
54
  nb config get docker.network
35
55
  nb config set docker.network nocobase
56
+ nb config set bin.git /usr/bin/git
36
57
  nb config delete docker.container-prefix
37
58
  ```
38
59
 
@@ -6,7 +6,7 @@ keywords: "nb config set,NocoBase CLI,configuration"
6
6
 
7
7
  # nb config set
8
8
 
9
- Set a CLI configuration value. Supported keys are `license.pkg-url`, `docker.network`, and `docker.container-prefix`.
9
+ Set a CLI configuration value. Supported keys are `locale`, `update.policy`, `license.pkg-url`, `docker.network`, `docker.container-prefix`, `bin.docker`, `bin.git`, and `bin.yarn`.
10
10
 
11
11
  ## Usage
12
12
 
@@ -18,21 +18,28 @@ nb config set <key> <value>
18
18
 
19
19
  | Parameter | Type | Description |
20
20
  | --- | --- | --- |
21
- | `<key>` | string | Configuration key: `license.pkg-url`, `docker.network`, or `docker.container-prefix` |
21
+ | `<key>` | string | Configuration key: `locale`, `update.policy`, `license.pkg-url`, `docker.network`, `docker.container-prefix`, `bin.docker`, `bin.git`, or `bin.yarn` |
22
22
  | `<value>` | string | Configuration value; must not be empty |
23
23
 
24
24
  ## Examples
25
25
 
26
26
  ```bash
27
+ nb config set locale zh-CN
28
+ nb config set update.policy auto
27
29
  nb config set license.pkg-url https://pkg.nocobase.com/
28
30
  nb config set docker.network nocobase
29
31
  nb config set docker.container-prefix nb
32
+ nb config set bin.docker /usr/local/bin/docker
33
+ nb config set bin.git /usr/bin/git
34
+ nb config set bin.yarn yarn
30
35
  ```
31
36
 
32
37
  ## Notes
33
38
 
34
39
  When setting `license.pkg-url`, the CLI normalizes the URL so it ends with `/`.
35
40
 
41
+ `update.policy` supports `prompt`, `auto`, and `off`. The default is `prompt`.
42
+
36
43
  ## Related Commands
37
44
 
38
45
  - [`nb config get`](./get.md)
@@ -21,6 +21,7 @@ nb self update [flags]
21
21
  | `--channel` | string | Release channel to update to, default `auto`; options: `auto`, `latest`, `beta`, `alpha` |
22
22
  | `--yes`, `-y` | boolean | Skip update confirmation |
23
23
  | `--json` | boolean | Output JSON |
24
+ | `--skills` | boolean | Also refresh the globally installed NocoBase AI coding skills |
24
25
  | `--verbose` | boolean | Show detailed update output |
25
26
 
26
27
  ## Examples
@@ -28,6 +29,7 @@ nb self update [flags]
28
29
  ```bash
29
30
  nb self update
30
31
  nb self update --yes
32
+ nb self update --skills
31
33
  nb self update --channel alpha --json
32
34
  ```
33
35
 
@@ -294,7 +294,7 @@ Log print format. Default is `console` in development and `json` in production.
294
294
  LOGGER_FORMAT=json
295
295
  ```
296
296
 
297
- Reference: [Log Format](/log-and-monitor/logger/index.md#log-format)
297
+ Reference: [Log Format](/log-and-monitor/logger/index.md#log-formats)
298
298
 
299
299
  ### CACHE_DEFAULT_STORE
300
300
 
@@ -375,8 +375,10 @@ Supported formats:
375
375
  Used to append preset local plugins. The value is the package name (the `name` parameter in `package.json`), with multiple plugins separated by commas.
376
376
 
377
377
  :::info
378
+
378
379
  1. Ensure the plugin is downloaded locally and can be found in the `node_modules` directory. For more details, see [Plugin Organization](/plugin-development/project-structure).
379
380
  2. After adding the environment variable, the plugin will appear on the plugin manager page only after an initial installation (`nocobase install`) or upgrade (`nocobase upgrade`).
381
+
380
382
  :::
381
383
 
382
384
  ```bash
@@ -388,8 +390,10 @@ APPEND_PRESET_LOCAL_PLUGINS=@my-project/plugin-foo,@my-project/plugin-bar
388
390
  Used to append built-in plugins that are installed by default. The value is the package name (the `name` parameter in `package.json`), with multiple plugins separated by commas.
389
391
 
390
392
  :::info
393
+
391
394
  1. Ensure the plugin is downloaded locally and can be found in the `node_modules` directory. For more details, see [Plugin Organization](/plugin-development/project-structure).
392
395
  2. After adding the environment variable, the plugin will be automatically installed or upgraded during the initial installation (`nocobase install`) or upgrade (`nocobase upgrade`).
396
+
393
397
  :::
394
398
 
395
399
  ```bash
@@ -472,7 +476,7 @@ yarn cross-env \
472
476
 
473
477
  ### WORKFLOW_SCRIPT_MODULES
474
478
 
475
- Workflow JavaScript node available modules list. For details, see "[JavaScript Node: Using External Modules](/workflow/nodes/javascript#using-external-modules)".
479
+ Workflow JavaScript node available modules list. For details, see "[JavaScript Node: Using External Modules](/workflow/nodes/javascript#unsafe-mode-module-support)".
476
480
 
477
481
  ### WORKFLOW_LOOP_LIMIT
478
482
 
@@ -10,12 +10,12 @@ This plugin is used to embed NocoBase pages into other websites or applications.
10
10
 
11
11
  ## Installation
12
12
 
13
- This is a commercial plugin. For detailed activation instructions, please refer to: [Commercial Plugin Activation Guide](https://www.nocobase.com/en/blog/nocobase-commercial-license-activation-guide)
13
+ Enable the "Embed NocoBase" plugin in the plugin manager to use it.
14
14
 
15
15
 
16
16
  ## User Guide
17
17
 
18
- After activating the interface configuration, click "Copy embedded link" in the page's configuration menu (top right corner).
18
+ After enabling the plugin, click "Copy embedded link" in the page's configuration menu (top right corner).
19
19
 
20
20
 
21
21
  ![](https://static-docs.nocobase.com/f11bd6d5e88d38731d7cd3cb149022c8.png)
@@ -27,4 +27,4 @@ After clicking, you will get a link that can be opened separately, for example,
27
27
  ![](https://static-docs.nocobase.com/9d847805a00fd07372a474665ec0e968.png)
28
28
 
29
29
 
30
- If you want to embed NocoBase pages into other websites or applications, user authentication is required, and the `token` needs to be appended to the link, for example, `https://example.com/embed/qs087rz4o2b?token=xxx`.
30
+ If you want to embed NocoBase pages into other websites or applications, user authentication is required, and the `token` needs to be appended to the link, for example, `https://example.com/embed/qs087rz4o2b?token=xxx`.
@@ -44,6 +44,10 @@ yarn build @my-project/plugin-hello --tar
44
44
 
45
45
  Upload and extract the `.tar.gz` file to the target application's `./storage/plugins` directory. For detailed steps, see [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx).
46
46
 
47
+ ### Enable a Plugin by Default
48
+
49
+ After uploading, the plugin is not activated automatically — it appears in the Plugin Manager and must be enabled manually. If you are maintaining your own NocoBase application and want the plugin to be enabled by default along with the application, you can use the `APPEND_PRESET_BUILT_IN_PLUGINS` (append built-in plugins) environment variable. See [Make a Plugin Preset or Built-in by Default](./write-your-first-plugin.md#make-a-plugin-preset-or-built-in-by-default-optional) for usage.
50
+
47
51
  ## Custom Build Configuration
48
52
 
49
53
  In most cases, the default build configuration is sufficient. If you need to customize it — such as modifying the bundle entry, adding aliases, adjusting compression options, etc. — you can create a `build.config.ts` file in the plugin root directory:
@@ -84,3 +88,4 @@ Key points:
84
88
  - [Dependency Management](./dependency-management.md) — Plugin dependency declarations and global dependencies
85
89
  - [Plugin Development Overview](./index.md) — Overall introduction to plugin development
86
90
  - [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx) — Upload packaged files to target environments
91
+ - [Environment Variables](../get-started/installation/env.md) — Environment variable configuration for preset and built-in plugins
@@ -38,11 +38,11 @@ If client code changes don't hot reload, try refreshing the browser first.
38
38
 
39
39
  ### Registered page route is not accessible
40
40
 
41
- NocoBase v2 routes automatically add a `/v2` prefix. For example, if you registered `path: '/hello'`, the actual URL is `/v2/hello`:
41
+ NocoBase v2 routes automatically add a `/v` prefix. For example, if you registered `path: '/hello'`, the actual URL is `/v/hello`:
42
42
 
43
43
  ```ts
44
44
  this.router.add('hello', {
45
- path: '/hello', // actual URL -> /v2/hello
45
+ path: '/hello', // actual URL -> /v/hello
46
46
  componentLoader: () => import('./pages/HelloPage'),
47
47
  });
48
48
  ```
@@ -285,7 +285,7 @@ NocoBase's build system maintains an [external list](../../dependency-management
285
285
  ## Related Links
286
286
 
287
287
  - [Plugin](../plugin) — Plugin entry and lifecycle
288
- - [Router](../router) — Route registration and the `/v2` prefix
288
+ - [Router](../router) — Route registration and the `/v` prefix
289
289
  - [FlowEngine Overview](../flow-engine/index.md) — FlowModel basics
290
290
  - [FlowEngine - Block Extension](../flow-engine/block) — BlockModel, TableBlockModel, filterCollection
291
291
  - [FlowEngine - Field Extension](../flow-engine/field) — FieldModel, bindModelToInterface
@@ -118,7 +118,7 @@ const msg = ctx.t('Save success', { ns: '@my-project/plugin-hello' });
118
118
  Use `ctx.router.navigate()` for page navigation:
119
119
 
120
120
  ```tsx
121
- ctx.router.navigate('/some-page'); // -> /v2/some-page
121
+ ctx.router.navigate('/some-page'); // -> /v/some-page
122
122
  ```
123
123
 
124
124
  Get current route parameters:
@@ -316,7 +316,7 @@ Navigate between pages in components via `ctx.router.navigate()`:
316
316
 
317
317
  ```tsx
318
318
  const ctx = useFlowContext();
319
- ctx.router.navigate('/hello'); // -> /v2/hello
319
+ ctx.router.navigate('/hello'); // -> /v/hello
320
320
  ```
321
321
 
322
322
  ### Route Information (ctx.route)
@@ -351,7 +351,7 @@ interface RouteOptions {
351
351
  ```tsx
352
352
  const ctx = useFlowContext();
353
353
 
354
- console.log(ctx.location.pathname); // '/v2/hello'
354
+ console.log(ctx.location.pathname); // '/v/hello'
355
355
  console.log(ctx.location.search); // '?page=1'
356
356
  console.log(ctx.location.hash); // '#section'
357
357
  ```
@@ -85,7 +85,7 @@ async load() {
85
85
  ```tsx
86
86
  // In component: page navigation
87
87
  const ctx = useFlowContext();
88
- ctx.router.navigate('/hello'); // -> /v2/hello
88
+ ctx.router.navigate('/hello'); // -> /v/hello
89
89
  ```
90
90
 
91
91
  ## Common Capabilities Provided by Context
@@ -15,7 +15,7 @@ Route registration is typically done in the plugin's `load()` method. See [Plugi
15
15
 
16
16
  :::warning Note
17
17
 
18
- For NocoBase v2 plugins, registered routes automatically get a `/v2` prefix. You need to include this prefix when accessing the routes.
18
+ For NocoBase v2 plugins, registered routes automatically get a `/v` prefix. You need to include this prefix when accessing the routes.
19
19
 
20
20
  :::
21
21
 
@@ -25,9 +25,9 @@ NocoBase has the following default routes registered:
25
25
 
26
26
  | Name | Path | Component | Description |
27
27
  | -------------- | --------------------- | ------------------- | ------------------------- |
28
- | admin | /v2/admin/\* | AdminLayout | Admin pages |
29
- | admin.page | /v2/admin/:name | AdminDynamicPage | Dynamically created pages |
30
- | admin.settings | /v2/admin/settings/\* | AdminSettingsLayout | Plugin settings pages |
28
+ | admin | /v/admin/\* | AdminLayout | Admin pages |
29
+ | admin.page | /v/admin/:name | AdminDynamicPage | Dynamically created pages |
30
+ | admin.settings | /v/admin/settings/\* | AdminSettingsLayout | Plugin settings pages |
31
31
 
32
32
  ## Page Routes
33
33
 
@@ -55,7 +55,7 @@ class MyPlugin extends Plugin {
55
55
  async load() {
56
56
  this.router.add('hello', {
57
57
  path: '/hello',
58
- // Lazy loading: the module is loaded only when /v2/hello is visited
58
+ // Lazy loading: the module is loaded only when /v/hello is visited
59
59
  componentLoader: () => import('./pages/HelloPage'),
60
60
  });
61
61
  }
@@ -103,12 +103,12 @@ class MyPlugin extends Plugin {
103
103
 
104
104
  // Child route, using componentLoader for lazy loading
105
105
  this.router.add('root.home', {
106
- path: '/', // -> /v2/
106
+ path: '/', // -> /v/
107
107
  componentLoader: () => import('./pages/HomePage'),
108
108
  });
109
109
 
110
110
  this.router.add('root.about', {
111
- path: '/about', // -> /v2/about
111
+ path: '/about', // -> /v/about
112
112
  componentLoader: () => import('./pages/AboutPage'),
113
113
  });
114
114
  }
@@ -121,7 +121,7 @@ Route paths support dynamic parameters:
121
121
 
122
122
  ```tsx
123
123
  this.router.add('root.user', {
124
- path: '/user/:id', // -> /v2/user/:id
124
+ path: '/user/:id', // -> /v/user/:id
125
125
  componentLoader: () => import('./pages/UserPage'),
126
126
  });
127
127
  ```
@@ -176,7 +176,7 @@ export class HelloPlugin extends Plugin<any, Application> {
176
176
  }
177
177
  ```
178
178
 
179
- After registration, the access path is `/admin/settings/hello`. When there is only one page under the menu, the top tab bar is automatically hidden.
179
+ After registration, the access path is `/v/admin/settings/hello`. When there is only one page under the menu, the top tab bar is automatically hidden.
180
180
 
181
181
  ### Multi-Tab Settings Page
182
182
 
@@ -194,7 +194,7 @@ class HelloPlugin extends Plugin<any, Application> {
194
194
  icon: 'ApiOutlined',
195
195
  });
196
196
 
197
- // Tab 1: General settings (key 'index' maps to /admin/settings/hello)
197
+ // Tab 1: General settings (key 'index' maps to /v/admin/settings/hello)
198
198
  this.pluginSettingsManager.addPageTabItem({
199
199
  menuKey: 'hello',
200
200
  key: 'index',
@@ -202,7 +202,7 @@ class HelloPlugin extends Plugin<any, Application> {
202
202
  componentLoader: () => import('./settings/GeneralPage'),
203
203
  });
204
204
 
205
- // Tab 2: Advanced settings (maps to /admin/settings/hello/advanced)
205
+ // Tab 2: Advanced settings (maps to /v/admin/settings/hello/advanced)
206
206
  this.pluginSettingsManager.addPageTabItem({
207
207
  menuKey: 'hello',
208
208
  key: 'advanced',
@@ -118,6 +118,33 @@ After activation, create a new "Modern page (v2)" page. When adding blocks, you'
118
118
 
119
119
  ![20250928174529](https://static-docs.nocobase.com/20250928174529.png)
120
120
 
121
+ ### Make a Plugin Preset or Built-in by Default (Optional)
122
+
123
+ The steps above describe manually enabling a single plugin. If you are maintaining your own NocoBase application and want certain plugins to be automatically ready after running `nocobase install` (first-time installation) or `nocobase upgrade` (upgrade), you can use two environment variables to control a plugin's default state:
124
+
125
+ - **`APPEND_PRESET_LOCAL_PLUGINS` (append preset local plugins)** — Adds the plugin to the preset local plugin list. After installation it appears in the Plugin Manager but is not activated by default; you need to enable it manually.
126
+ - **`APPEND_PRESET_BUILT_IN_PLUGINS` (append built-in plugins)** — Adds the plugin to the built-in plugin list. It is automatically activated on installation and, as a built-in plugin, **cannot be disabled or deleted from the Plugin Manager**.
127
+
128
+ The value for both variables is the plugin package name (the `name` field in `package.json`); separate multiple plugins with commas. Configure them in `.env` like this:
129
+
130
+ ```bash
131
+ # Preset: appears in the Plugin Manager list but is not activated automatically
132
+ APPEND_PRESET_LOCAL_PLUGINS=@my-project/plugin-hello,@my-project/plugin-hello-world
133
+
134
+ # Built-in: automatically installed and activated, and cannot be disabled from the UI
135
+ APPEND_PRESET_BUILT_IN_PLUGINS=@my-project/plugin-hello,@my-project/plugin-hello-world
136
+ ```
137
+
138
+ For day-to-day local development and debugging, `yarn pm enable` (described above) is usually sufficient. These two variables are better suited for "out-of-the-box" distribution scenarios — for example, when you are shipping a NocoBase application bundled with a fixed set of plugins and want those plugins to be ready immediately after initialization.
139
+
140
+ :::tip Note
141
+
142
+ - The plugin must already be downloaded locally and resolvable in `node_modules`. See [Project Structure](./project-structure.md) for details.
143
+ - After configuring, you need to re-run `nocobase install` or `nocobase upgrade` for the changes to take effect.
144
+ - For the full list of environment variable options, see [Environment Variables](../get-started/installation/env.md#append_preset_local_plugins).
145
+
146
+ :::
147
+
121
148
  ## Step 4: Build and Package
122
149
 
123
150
  When you're ready to distribute the plugin to other environments, you need to build and package it first:
@@ -158,4 +185,5 @@ Upload and extract the package file to the target application's `./storage/plugi
158
185
  - [Install using create-nocobase-app](../get-started/installation/create-nocobase-app) — One of the NocoBase installation methods
159
186
  - [Install from Git source](../get-started/installation/git) — Install NocoBase from source code
160
187
  - [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx) — Upload packaged plugins to other environments
188
+ - [Environment Variables](../get-started/installation/env.md) — Environment variable configuration for preset and built-in plugins
161
189
 
@@ -8,7 +8,6 @@ This page documents the update history for the CRM solution. New entries are add
8
8
 
9
9
  **Backup files**:
10
10
  - [nocobase_crm_v2_backup_260406.nbdata](https://static-docs.nocobase.com/nocobase_crm_v2_backup_260406.nbdata)
11
- - [nocobase_crm_v2_sql_260406.zip](https://static-docs.nocobase.com/nocobase_crm_v2_sql_260406.zip)
12
11
 
13
12
  **Changes**:
14
13
  - Fixed table Summary aggregation display issue
@@ -24,7 +23,6 @@ This page documents the update history for the CRM solution. New entries are add
24
23
 
25
24
  **Backup files**:
26
25
  - [nocobase_crm_v2_backup_260327.nbdata](https://static-docs.nocobase.com/nocobase_crm_v2_backup_260327.nbdata)
27
- - [nocobase_crm_v2_sql_260327.zip](https://static-docs.nocobase.com/nocobase_crm_v2_sql_260327.zip)
28
26
 
29
27
  **Changes**:
30
28
 
@@ -52,7 +50,6 @@ This page documents the update history for the CRM solution. New entries are add
52
50
 
53
51
  **Backup files**:
54
52
  - nocobase_crm_v2_backup_260223.nbdata
55
- - nocobase_crm_v2_sql_260223.zip
56
53
 
57
54
  **Changes**:
58
55
  - Initial release of CRM 2.0
@@ -2,15 +2,13 @@
2
2
 
3
3
  > The current version is deployed via **backup and restore**. In future versions, we may switch to **incremental migration** to make it easier to integrate the solution into your existing systems.
4
4
 
5
- To help you deploy the CRM 2.0 solution smoothly to your own NocoBase environment, we provide two restoration methods. Please choose the one that best suits your edition and technical background.
5
+ > **The Backup Manager plugin is now open-source**: The "[Backup Manager](https://docs-cn.nocobase.com/handbook/backups)" plugin needed to restore the solution is now open-source and available to all editions (including the Community Edition). We recommend restoring directly via this plugin.
6
6
 
7
7
  Before you begin, please ensure:
8
8
 
9
9
  - You have a basic NocoBase running environment. For main system installation, please refer to the [official installation documentation](https://docs-cn.nocobase.com/welcome/getting-started/installation).
10
10
  - NocoBase version **v2.1.0-beta.2 or above**.
11
- - You have downloaded the corresponding CRM system files:
12
- - **Backup file**: [nocobase_crm_v2_backup_260523.nbdata](https://static-docs.nocobase.com/nocobase_crm_v2_backup_260523.nbdata) - For Method 1
13
- - **SQL file**: [nocobase_crm_v2_sql_260523.zip](https://static-docs.nocobase.com/nocobase_crm_v2_sql_260523.zip) - For Method 2
11
+ - You have downloaded the CRM system backup file: [nocobase_crm_v2_backup_260523.nbdata](https://static-docs.nocobase.com/nocobase_crm_v2_backup_260523.nbdata)
14
12
 
15
13
  **Important Notes**:
16
14
  - This solution is built on **PostgreSQL 16**. Please ensure your environment uses PostgreSQL 16.
@@ -18,9 +16,9 @@ Before you begin, please ensure:
18
16
 
19
17
  ---
20
18
 
21
- ## Method 1: Restore Using Backup Manager (Recommended for Pro/Enterprise Users)
19
+ ## Restore Using Backup Manager
22
20
 
23
- This method uses NocoBase's built-in "[Backup Manager](https://docs-cn.nocobase.com/handbook/backups)" (Pro/Enterprise Edition) plugin for one-click restoration. It is the simplest operation but has certain requirements for the environment and edition.
21
+ This method uses NocoBase's built-in "[Backup Manager](https://docs-cn.nocobase.com/handbook/backups)" plugin for one-click restoration. It is the simplest operation. This plugin is now open-source and available to all editions (including the Community Edition).
24
22
 
25
23
  ### Key Characteristics
26
24
 
@@ -28,9 +26,8 @@ This method uses NocoBase's built-in "[Backup Manager](https://docs-cn.nocobase.
28
26
  1. **Convenient operation**: Completed within the UI, allowing for full restoration of all configurations including plugins.
29
27
  2. **Complete restoration**: **Able to restore all system files**, including print template files and files uploaded via file fields in collections, ensuring full functional integrity.
30
28
  * **Limitations**:
31
- 1. **Pro/Enterprise Edition only**: "Backup Manager" is an enterprise-level plugin available only to Pro/Enterprise users.
32
- 2. **Strict environment requirements**: Requires your database environment (version, case sensitivity settings, etc.) to be highly compatible with the environment where the backup was created.
33
- 3. **Plugin dependency**: If the solution includes commercial plugins not present in your local environment, the restoration will fail.
29
+ 1. **Strict environment requirements**: Requires your database environment (version, case sensitivity settings, etc.) to be highly compatible with the environment where the backup was created.
30
+ 2. **Plugin dependency**: If the solution includes commercial plugins not present in your local environment, the restoration will fail.
34
31
 
35
32
  ### Steps
36
33
 
@@ -69,69 +66,6 @@ Then use this image to start your NocoBase service.
69
66
 
70
67
  ---
71
68
 
72
- ## Method 2: Direct SQL File Import (Universal, Better for Community Edition)
73
-
74
- This method restores data by directly operating on the database, bypassing the "Backup Manager" plugin, and therefore has no Pro/Enterprise Edition restrictions.
75
-
76
- ### Key Characteristics
77
-
78
- * **Advantages**:
79
- 1. **No edition restrictions**: Suitable for all NocoBase users, including Community Edition.
80
- 2. **High compatibility**: Does not rely on the `dump` tool within the application; as long as you can connect to the database, you can operate.
81
- 3. **High fault tolerance**: If the solution includes commercial plugins you do not have, the related features will not be enabled, but it will not affect the normal use of other features, and the application can start successfully.
82
- * **Limitations**:
83
- 1. **Requires database operation skills**: Users need basic database operation skills, such as how to execute a `.sql` file.
84
- 2. **System file loss**: **This method will lose all system files**, including print template files and files uploaded via file fields in collections.
85
-
86
- ### Steps
87
-
88
- **Step 1: Prepare a clean database**
89
-
90
- Prepare a brand new, empty database for the data you are about to import.
91
-
92
- **Step 2: Import the `.sql` file into the database**
93
-
94
- Obtain the downloaded database file (usually in `.sql` format) and import its content into the database you prepared in the previous step. There are several ways to execute this, depending on your environment:
95
-
96
- * **Option A: Via server command line (using Docker as an example)**
97
- If you use Docker to install NocoBase and the database, you can upload the `.sql` file to the server and then use the `docker exec` command to perform the import. Assuming your PostgreSQL container is named `my-nocobase-db` and the filename is `nocobase_crm_v2_sql_260523.sql`:
98
-
99
- ```bash
100
- # Copy the sql file into the container
101
- docker cp nocobase_crm_v2_sql_260523.sql my-nocobase-db:/tmp/
102
- # Enter the container and execute the import command
103
- docker exec -it my-nocobase-db psql -U nocobase -d nocobase -f /tmp/nocobase_crm_v2_sql_260523.sql
104
- ```
105
- * **Option B: Via a remote database client (Navicat, etc.)**
106
- If your database port is exposed, you can use any graphical database client (such as Navicat, DBeaver, pgAdmin, etc.) to connect to the database, then:
107
- 1. Right-click the target database.
108
- 2. Select "Run SQL File" or "Execute SQL Script".
109
- 3. Select the downloaded `.sql` file and execute.
110
-
111
- **Step 3: Connect to the database and start the application**
112
-
113
- Configure your NocoBase startup parameters (such as environment variables `DB_HOST`, `DB_PORT`, `DB_DATABASE`, `DB_USER`, `DB_PASSWORD`, etc.) to point to the database where you just imported the data. Then, start the NocoBase service normally.
114
-
115
- ### Notes
116
-
117
- * **Database permissions**: This method requires you to have an account and password that can directly operate on the database.
118
- * **Plugin status**: After a successful import, although the data for commercial plugins included in the system exists, if you have not installed and enabled the corresponding plugins locally, the related features will not be displayed or usable, but this will not cause the application to crash.
119
-
120
- ---
121
-
122
- ## Summary and Comparison
123
-
124
- | Feature | Method 1: Backup Manager | Method 2: Direct SQL Import |
125
- | :-------------- | :--------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------- |
126
- | **Applicable Users** | **Pro/Enterprise Edition** users | **All users** (including Community Edition) |
127
- | **Ease of Use** | ⭐⭐⭐⭐⭐ (Very simple, UI operation) | ⭐⭐⭐ (Requires basic database knowledge) |
128
- | **Environment Requirements** | **Strict**, database and system versions must be highly compatible | **General**, requires database compatibility |
129
- | **Plugin Dependency** | **Strong dependency**, plugins are validated during restoration; missing any plugin will cause **restoration failure**. | **Features strongly depend on plugins**. Data can be imported independently, and the system will have basic functionality. However, if corresponding plugins are missing, related features will be **completely unusable**. |
130
- | **System Files** | **Fully preserved** (print templates, uploaded files, etc.) | **Will be lost** (print templates, uploaded files, etc.) |
131
- | **Recommended Scenarios** | Enterprise users with controlled, consistent environments needing full functionality | Missing some plugins, seeking high compatibility and flexibility, non-Pro/Enterprise users, or those who can accept the loss of file features |
132
-
133
- ---
134
-
135
69
  ## FAQ
136
70
 
137
71
  ### Can Pro Edition users install this? Will it cause errors?
@@ -146,10 +80,6 @@ We recommend the latest `beta-full` image (e.g., `nocobase/nocobase:beta-full`).
146
80
 
147
81
  The demo's logo is configured with a domain restriction and cannot load on local domains. Go to **System Settings** and re-upload your own logo.
148
82
 
149
- ### File upload error (OSS Key error)?
150
-
151
- After SQL import, file uploads may fail with an OSS-related error. Solution: go to **Plugin Manager → File Manager**, set **Local Storage** as the default storage, and save. Uploads will work normally after this.
152
-
153
83
  ### What about incremental upgrades?
154
84
 
155
85
  Currently, version upgrades are full replacements — your custom modifications will be overwritten. Always back up before upgrading. An incremental migration solution is being planned and will prioritize Pro/Enterprise editions. Community edition support is more difficult due to the lack of the migration management plugin.