@nocobase/app-server 2.0.0-beta.2 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/not-configured.d.ts +3 -3
- package/dist/config/not-configured.js +3 -3
- package/dist/database/provider.d.ts +1 -1
- package/dist/database/provider.js +1 -1
- package/dist/router/api-error.d.ts +2 -2
- package/dist/router/api-error.d.ts.map +1 -1
- package/dist/router/api-error.js +1 -1
- package/dist/router/api-limits.d.ts +1 -1
- package/dist/router/api-limits.js +1 -1
- package/package.json +5 -5
|
@@ -8,9 +8,9 @@ export interface ApplicationNotConfiguredDetails {
|
|
|
8
8
|
* The application has nothing to start with: no configuration supplies what it cannot run without.
|
|
9
9
|
*
|
|
10
10
|
* It states what is missing and nothing more. The remedy depends on how the application is run — a standalone start
|
|
11
|
-
* points at `pnpm nocobase config init`, while an application
|
|
12
|
-
* that prints the error adds it, and a
|
|
13
|
-
* apply. Recognised by `name` as well as by class, so a second copy of this package in the process is still
|
|
11
|
+
* points at `pnpm nocobase config init`, while an application run by a host is configured through that host — so the entry
|
|
12
|
+
* point that prints the error adds it, and a host showing the same error to an operator does not pass on advice that does
|
|
13
|
+
* not apply. Recognised by `name` as well as by class, so a second copy of this package in the process is still
|
|
14
14
|
* recognised.
|
|
15
15
|
*/
|
|
16
16
|
export declare class ApplicationNotConfiguredError extends Error {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* The application has nothing to start with: no configuration supplies what it cannot run without.
|
|
3
3
|
*
|
|
4
4
|
* It states what is missing and nothing more. The remedy depends on how the application is run — a standalone start
|
|
5
|
-
* points at `pnpm nocobase config init`, while an application
|
|
6
|
-
* that prints the error adds it, and a
|
|
7
|
-
* apply. Recognised by `name` as well as by class, so a second copy of this package in the process is still
|
|
5
|
+
* points at `pnpm nocobase config init`, while an application run by a host is configured through that host — so the entry
|
|
6
|
+
* point that prints the error adds it, and a host showing the same error to an operator does not pass on advice that does
|
|
7
|
+
* not apply. Recognised by `name` as well as by class, so a second copy of this package in the process is still
|
|
8
8
|
* recognised.
|
|
9
9
|
*/
|
|
10
10
|
export class ApplicationNotConfiguredError extends Error {
|
|
@@ -10,7 +10,7 @@ export interface DatabaseProviderApplication {
|
|
|
10
10
|
/**
|
|
11
11
|
* Set by `nocobase dev` on the server process it starts, to that
|
|
12
12
|
* application's root. Naming the root rather than switching the behavior on
|
|
13
|
-
* matters for a
|
|
13
|
+
* matters for a host: applications it runs in the same process see the same
|
|
14
14
|
* environment, and their directories are deployed revisions a cache must not
|
|
15
15
|
* be written into.
|
|
16
16
|
*/
|
|
@@ -16,7 +16,7 @@ import { loggingToken } from '../logging/token.js';
|
|
|
16
16
|
/**
|
|
17
17
|
* Set by `nocobase dev` on the server process it starts, to that
|
|
18
18
|
* application's root. Naming the root rather than switching the behavior on
|
|
19
|
-
* matters for a
|
|
19
|
+
* matters for a host: applications it runs in the same process see the same
|
|
20
20
|
* environment, and their directories are deployed revisions a cache must not
|
|
21
21
|
* be written into.
|
|
22
22
|
*/
|
|
@@ -38,7 +38,7 @@ export interface ApiErrorOptions {
|
|
|
38
38
|
readonly status: ApiErrorStatus;
|
|
39
39
|
/** What went wrong, in UPPER_SNAKE_CASE, unique within `domain`. Clients branch on `reason`, never on `message`. */
|
|
40
40
|
readonly reason: string;
|
|
41
|
-
/** Who defined `reason`: the plugin's URL namespace, such as `
|
|
41
|
+
/** Who defined `reason`: the plugin's URL namespace, such as `workflows`, or `app` for the framework. */
|
|
42
42
|
readonly domain: string;
|
|
43
43
|
/** Developer-facing English description. Never shown to end users and never relied on by clients. */
|
|
44
44
|
readonly message: string;
|
|
@@ -73,7 +73,7 @@ export interface ApiErrorBody {
|
|
|
73
73
|
* An error a route throws to answer with the standard `/api` error body.
|
|
74
74
|
*
|
|
75
75
|
* ```ts
|
|
76
|
-
* throw new ApiError({ status: 'NOT_FOUND', reason: '
|
|
76
|
+
* throw new ApiError({ status: 'NOT_FOUND', reason: 'WORKFLOW_NOT_FOUND', domain: 'workflows', message: `Workflow ${id} was not found.` });
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
79
|
export declare class ApiError extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-error.d.ts","sourceRoot":"","sources":["../../src/router/api-error.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAGxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE;IAChC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC;IAC/B,QAAQ,CAAC,mBAAmB,EAAE,GAAG,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,GAAG,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,GAAG,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC;IACtB,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,GAAG,CAAC;CAehC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAE9D,2GAA2G;AAC3G,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED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Q,MAAM,CAAC;IACpB,UAAU,kBAAkB;QAC1B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF;AAKD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAYrD;AAED,6GAA6G;AAC7G,wBAAgB,mBAAmB,IAAI,iBAAiB,CAYvD"}
|
package/dist/router/api-error.js
CHANGED
|
@@ -28,7 +28,7 @@ export const appErrorDomain = 'app';
|
|
|
28
28
|
* An error a route throws to answer with the standard `/api` error body.
|
|
29
29
|
*
|
|
30
30
|
* ```ts
|
|
31
|
-
* throw new ApiError({ status: 'NOT_FOUND', reason: '
|
|
31
|
+
* throw new ApiError({ status: 'NOT_FOUND', reason: 'WORKFLOW_NOT_FOUND', domain: 'workflows', message: `Workflow ${id} was not found.` });
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export class ApiError extends Error {
|
|
@@ -70,7 +70,7 @@ export declare function apiTimeoutMiddleware(timeoutMs: number): MiddlewareHandl
|
|
|
70
70
|
*
|
|
71
71
|
* The client is the address of the connection, read from the Node.js server bindings. The signed-in user is not known
|
|
72
72
|
* at this point: authentication runs inside the routes that need it. A request whose address is unknown, such as one an
|
|
73
|
-
* in-process
|
|
73
|
+
* in-process host forwards, is not counted. Counters live in this process, so each instance of a multi-instance
|
|
74
74
|
* deployment counts on its own.
|
|
75
75
|
*/
|
|
76
76
|
export declare function apiRateLimitMiddleware(limit: {
|
|
@@ -220,7 +220,7 @@ const maxTrackedClients = 100_000;
|
|
|
220
220
|
*
|
|
221
221
|
* The client is the address of the connection, read from the Node.js server bindings. The signed-in user is not known
|
|
222
222
|
* at this point: authentication runs inside the routes that need it. A request whose address is unknown, such as one an
|
|
223
|
-
* in-process
|
|
223
|
+
* in-process host forwards, is not counted. Counters live in this process, so each instance of a multi-instance
|
|
224
224
|
* deployment counts on its own.
|
|
225
225
|
*/
|
|
226
226
|
export function apiRateLimitMiddleware(limit, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/app-server",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"prettier": "@nocobase/dev-config/prettier",
|
|
6
6
|
"engines": {
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
"zod": "^4.6.5",
|
|
115
115
|
"openapi-types": "^12.1.3",
|
|
116
116
|
"@nocobase/app-websocket": "^0.0.1",
|
|
117
|
-
"@nocobase/drive": "^0.1.0-beta.4",
|
|
118
117
|
"@nocobase/config": "^0.1.0-beta.2",
|
|
118
|
+
"@nocobase/drive": "^0.1.0-beta.4",
|
|
119
119
|
"@nocobase/logging": "^0.1.0-beta.6",
|
|
120
120
|
"@nocobase/realtime": "^0.0.2-beta.0",
|
|
121
121
|
"@nocobase/secrets": "^0.1.0-beta.0",
|
|
@@ -136,20 +136,20 @@
|
|
|
136
136
|
"@nocobase/db-sqlite": "0.1.0-beta.4",
|
|
137
137
|
"@nocobase/db-testing": "0.1.0-beta.0",
|
|
138
138
|
"@nocobase/api-client": "1.0.0-beta.3",
|
|
139
|
-
"@nocobase/dev-config": "0.1.0-beta.
|
|
139
|
+
"@nocobase/dev-config": "0.1.0-beta.21",
|
|
140
140
|
"@nocobase/db-dameng": "0.1.0-beta.3",
|
|
141
141
|
"@nocobase/db-kingbase": "0.1.0-beta.3",
|
|
142
142
|
"@nocobase/db-oceanbase": "0.1.0-beta.3"
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
145
|
-
"@nocobase/i18n": "^1.0.0-beta.
|
|
145
|
+
"@nocobase/i18n": "^1.0.0-beta.6",
|
|
146
146
|
"@nocobase/caching": "^0.1.0-beta.2",
|
|
147
147
|
"@nocobase/db": "^1.0.0-beta.18",
|
|
148
148
|
"@nocobase/service-provider": "^0.0.2-beta.1",
|
|
149
|
+
"@nocobase/queue": "^0.1.0-beta.8",
|
|
149
150
|
"@nocobase/jobs": "^0.1.0-beta.2",
|
|
150
151
|
"@nocobase/db-sqlite": "^0.1.0-beta.4",
|
|
151
152
|
"@nocobase/db-mysql": "^0.1.0-beta.4",
|
|
152
|
-
"@nocobase/queue": "^0.1.0-beta.8",
|
|
153
153
|
"@nocobase/db-postgres": "^0.1.0-beta.3",
|
|
154
154
|
"@nocobase/db-mssql": "^0.1.0-beta.3",
|
|
155
155
|
"@nocobase/db-oracle": "^0.1.0-beta.3",
|