@nocobase/server 2.4.0-alpha.12 → 2.4.0-alpha.14

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/README.md CHANGED
@@ -24,7 +24,7 @@ Online Demo:
24
24
  https://demo.nocobase.com/new
25
25
 
26
26
  Documents:
27
- https://docs.nocobase.com/
27
+ https://nocode.docs.nocobase.com/
28
28
 
29
29
  Forum:
30
30
  https://forum.nocobase.com/
@@ -80,15 +80,15 @@ Adding more no-code features will never cover every business case. NocoBase is b
80
80
 
81
81
  NocoBase supports three installation methods:
82
82
 
83
- - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/docker-compose">Installing With Docker (👍Recommended)</a>
83
+ - <a target="_blank" href="https://nocode.docs.nocobase.com/welcome/getting-started/installation/docker-compose">Installing With Docker (👍Recommended)</a>
84
84
 
85
85
  Suitable for no-code scenarios, no code to write. When upgrading, just download the latest image and reboot.
86
86
 
87
- - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/create-nocobase-app">Installing from create-nocobase-app CLI</a>
87
+ - <a target="_blank" href="https://nocode.docs.nocobase.com/welcome/getting-started/installation/create-nocobase-app">Installing from create-nocobase-app CLI</a>
88
88
 
89
89
  The business code of the project is completely independent and supports low-code development.
90
90
 
91
- - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/git-clone">Installing from Git source code</a>
91
+ - <a target="_blank" href="https://nocode.docs.nocobase.com/welcome/getting-started/installation/git-clone">Installing from Git source code</a>
92
92
 
93
93
  If you want to experience the latest unreleased version, or want to participate in the contribution, you need to make changes and debug on the source code, it is recommended to choose this installation method, which requires a high level of development skills, and if the code has been updated, you can git pull the latest code.
94
94
 
@@ -201,6 +201,14 @@ export declare class Application<StateT = DefaultState, ContextT = DefaultContex
201
201
  static addCommand(callback: (app: Application) => void): void;
202
202
  private _sqlLogger;
203
203
  get instanceId(): number;
204
+ /**
205
+ * Adopt a worker id handed out at runtime, after the allocator loses its lease and acquires a different one. Ids may
206
+ * only be minted under a worker id this process currently holds, so the generator is rebuilt to match.
207
+ *
208
+ * Returning early on an unchanged id is required rather than an optimisation: rebuilding restarts the sequence at 0,
209
+ * so doing it for the same worker id inside one second would re-issue ids this process has already handed out.
210
+ */
211
+ setInstanceId(instanceId: number): void;
204
212
  get sqlLogger(): Logger;
205
213
  protected _logger: SystemLogger;
206
214
  get logger(): SystemLogger;
@@ -154,6 +154,21 @@ const _Application = class _Application extends import_koa.default {
154
154
  get instanceId() {
155
155
  return this._instanceId;
156
156
  }
157
+ /**
158
+ * Adopt a worker id handed out at runtime, after the allocator loses its lease and acquires a different one. Ids may
159
+ * only be minted under a worker id this process currently holds, so the generator is rebuilt to match.
160
+ *
161
+ * Returning early on an unchanged id is required rather than an optimisation: rebuilding restarts the sequence at 0,
162
+ * so doing it for the same worker id inside one second would re-issue ids this process has already handed out.
163
+ */
164
+ setInstanceId(instanceId) {
165
+ if (this._instanceId === instanceId) {
166
+ return;
167
+ }
168
+ this._instanceId = instanceId;
169
+ this.snowflakeIdGenerator = new import_snowflake_id.Snowflake({ workerId: instanceId });
170
+ this.log.info(`adopt worker id: ${instanceId}`, { method: "setInstanceId" });
171
+ }
157
172
  get sqlLogger() {
158
173
  return this._sqlLogger;
159
174
  }
package/lib/plugin.js CHANGED
@@ -276,7 +276,7 @@ const _Plugin = class _Plugin {
276
276
  "fr-FR": "fr/"
277
277
  };
278
278
  if (packageName.startsWith("@nocobase/plugin-")) {
279
- packageJson.homepage = `https://docs.nocobase.com/${langMap[locale] || ""}plugins/${packageName}`;
279
+ packageJson.homepage = `https://nocode.docs.nocobase.com/${langMap[locale] || ""}plugins/${packageName}`;
280
280
  }
281
281
  const results = {
282
282
  ...this.options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "2.4.0-alpha.12",
3
+ "version": "2.4.0-alpha.14",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -10,21 +10,21 @@
10
10
  "@koa/cors": "^5.0.0",
11
11
  "@koa/multer": "^3.1.0",
12
12
  "@koa/router": "^13.1.0",
13
- "@nocobase/acl": "2.4.0-alpha.12",
14
- "@nocobase/actions": "2.4.0-alpha.12",
15
- "@nocobase/ai": "2.4.0-alpha.12",
16
- "@nocobase/auth": "2.4.0-alpha.12",
17
- "@nocobase/cache": "2.4.0-alpha.12",
18
- "@nocobase/data-source-manager": "2.4.0-alpha.12",
19
- "@nocobase/database": "2.4.0-alpha.12",
20
- "@nocobase/evaluators": "2.4.0-alpha.12",
21
- "@nocobase/lock-manager": "2.4.0-alpha.12",
22
- "@nocobase/logger": "2.4.0-alpha.12",
23
- "@nocobase/resourcer": "2.4.0-alpha.12",
24
- "@nocobase/sdk": "2.4.0-alpha.12",
25
- "@nocobase/snowflake-id": "2.4.0-alpha.12",
26
- "@nocobase/telemetry": "2.4.0-alpha.12",
27
- "@nocobase/utils": "2.4.0-alpha.12",
13
+ "@nocobase/acl": "2.4.0-alpha.14",
14
+ "@nocobase/actions": "2.4.0-alpha.14",
15
+ "@nocobase/ai": "2.4.0-alpha.14",
16
+ "@nocobase/auth": "2.4.0-alpha.14",
17
+ "@nocobase/cache": "2.4.0-alpha.14",
18
+ "@nocobase/data-source-manager": "2.4.0-alpha.14",
19
+ "@nocobase/database": "2.4.0-alpha.14",
20
+ "@nocobase/evaluators": "2.4.0-alpha.14",
21
+ "@nocobase/lock-manager": "2.4.0-alpha.14",
22
+ "@nocobase/logger": "2.4.0-alpha.14",
23
+ "@nocobase/resourcer": "2.4.0-alpha.14",
24
+ "@nocobase/sdk": "2.4.0-alpha.14",
25
+ "@nocobase/snowflake-id": "2.4.0-alpha.14",
26
+ "@nocobase/telemetry": "2.4.0-alpha.14",
27
+ "@nocobase/utils": "2.4.0-alpha.14",
28
28
  "@types/ini": "^1.3.31",
29
29
  "@types/koa-send": "^4.1.3",
30
30
  "@types/multer": "^1.4.12",
@@ -60,5 +60,5 @@
60
60
  "@types/serve-handler": "^6.1.1",
61
61
  "@types/ws": "^8.5.5"
62
62
  },
63
- "gitHead": "de0ec0596d238752ed56bae95600a59395c920ea"
63
+ "gitHead": "b276c8e47a32cb7f1f5ec2d4968892b11a14cbd5"
64
64
  }