@nocobase/server 0.12.0-alpha.5 → 0.13.0-alpha.2
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/lib/app-supervisor.d.ts +59 -0
- package/lib/app-supervisor.js +268 -0
- package/lib/application.d.ts +65 -52
- package/lib/application.js +369 -269
- package/lib/commands/db-sync.js +0 -3
- package/lib/commands/destroy.d.ts +3 -0
- package/lib/commands/destroy.js +16 -0
- package/lib/commands/index.js +3 -0
- package/lib/commands/install.js +1 -37
- package/lib/commands/pm.js +53 -13
- package/lib/commands/restart.d.ts +3 -0
- package/lib/commands/restart.js +16 -0
- package/lib/commands/start.js +10 -10
- package/lib/commands/stop.d.ts +3 -0
- package/lib/commands/stop.js +16 -0
- package/lib/commands/upgrade.js +0 -3
- package/lib/errors/application-not-install.d.ts +4 -0
- package/lib/errors/application-not-install.js +14 -0
- package/lib/gateway/errors.d.ts +22 -0
- package/lib/gateway/errors.js +146 -0
- package/lib/gateway/handle-plugin-static-file.d.ts +3 -0
- package/lib/gateway/handle-plugin-static-file.js +91 -0
- package/lib/gateway/index.d.ts +59 -0
- package/lib/gateway/index.js +327 -0
- package/lib/gateway/ipc-socket-client.d.ts +9 -0
- package/lib/gateway/ipc-socket-client.js +48 -0
- package/lib/gateway/ipc-socket-server.d.ts +12 -0
- package/lib/gateway/ipc-socket-server.js +86 -0
- package/lib/gateway/ws-server.d.ts +26 -0
- package/lib/gateway/ws-server.js +198 -0
- package/lib/helper.d.ts +3 -0
- package/lib/helper.js +32 -1
- package/lib/helpers/application-version.d.ts +10 -0
- package/lib/helpers/application-version.js +78 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +24 -8
- package/lib/locale/locale.d.ts +1 -1
- package/lib/locale/locale.js +26 -17
- package/lib/locale/resource.js +8 -0
- package/lib/plugin-manager/clientStaticMiddleware.d.ts +0 -8
- package/lib/plugin-manager/clientStaticMiddleware.js +2 -95
- package/lib/plugin-manager/options/resource.js +12 -3
- package/lib/plugin-manager/plugin-manager-repository.d.ts +2 -1
- package/lib/plugin-manager/plugin-manager-repository.js +53 -18
- package/lib/plugin-manager/plugin-manager.d.ts +21 -18
- package/lib/plugin-manager/plugin-manager.js +394 -332
- package/lib/plugin.d.ts +10 -2
- package/lib/plugin.js +21 -3
- package/lib/swagger/index.json +1565 -0
- package/package.json +18 -13
- package/lib/app-manager.d.ts +0 -21
- package/lib/app-manager.js +0 -138
package/lib/plugin.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Model } from '@nocobase/database';
|
|
1
2
|
import { Application } from './application';
|
|
2
3
|
import { InstallOptions } from './plugin-manager';
|
|
3
4
|
export interface PluginInterface {
|
|
@@ -16,15 +17,20 @@ export interface PluginOptions {
|
|
|
16
17
|
plugin?: typeof Plugin;
|
|
17
18
|
[key: string]: any;
|
|
18
19
|
}
|
|
19
|
-
export type PluginType = typeof Plugin;
|
|
20
20
|
export declare abstract class Plugin<O = any> implements PluginInterface {
|
|
21
21
|
options: any;
|
|
22
22
|
app: Application;
|
|
23
|
+
model: Model;
|
|
24
|
+
state: any;
|
|
23
25
|
constructor(app: Application, options?: any);
|
|
26
|
+
get log(): import("winston").Logger;
|
|
24
27
|
get name(): string;
|
|
28
|
+
get pm(): import("./plugin-manager").PluginManager;
|
|
25
29
|
get db(): import("@nocobase/database").default;
|
|
26
30
|
get enabled(): any;
|
|
27
31
|
set enabled(value: any);
|
|
32
|
+
get installed(): any;
|
|
33
|
+
set installed(value: any);
|
|
28
34
|
setOptions(options: any): void;
|
|
29
35
|
getName(): any;
|
|
30
36
|
afterAdd(): void;
|
|
@@ -33,8 +39,10 @@ export declare abstract class Plugin<O = any> implements PluginInterface {
|
|
|
33
39
|
install(options?: InstallOptions): Promise<void>;
|
|
34
40
|
beforeEnable(): Promise<void>;
|
|
35
41
|
afterEnable(): Promise<void>;
|
|
42
|
+
beforeDisable(): Promise<void>;
|
|
36
43
|
afterDisable(): Promise<void>;
|
|
37
|
-
|
|
44
|
+
beforeRemove(): Promise<void>;
|
|
45
|
+
afterRemove(): Promise<void>;
|
|
38
46
|
importCollections(collectionsPath: string): Promise<void>;
|
|
39
47
|
requiredPlugins(): any[];
|
|
40
48
|
}
|
package/lib/plugin.js
CHANGED
|
@@ -10,14 +10,20 @@ class Plugin {
|
|
|
10
10
|
constructor(app, options) {
|
|
11
11
|
this.options = void 0;
|
|
12
12
|
this.app = void 0;
|
|
13
|
-
this.
|
|
13
|
+
this.model = void 0;
|
|
14
|
+
this.state = {};
|
|
14
15
|
this.app = app;
|
|
15
16
|
this.setOptions(options);
|
|
16
|
-
|
|
17
|
+
}
|
|
18
|
+
get log() {
|
|
19
|
+
return this.app.log;
|
|
17
20
|
}
|
|
18
21
|
get name() {
|
|
19
22
|
return this.options.name;
|
|
20
23
|
}
|
|
24
|
+
get pm() {
|
|
25
|
+
return this.app.pm;
|
|
26
|
+
}
|
|
21
27
|
get db() {
|
|
22
28
|
return this.app.db;
|
|
23
29
|
}
|
|
@@ -27,6 +33,12 @@ class Plugin {
|
|
|
27
33
|
set enabled(value) {
|
|
28
34
|
this.options.enabled = value;
|
|
29
35
|
}
|
|
36
|
+
get installed() {
|
|
37
|
+
return this.options.installed;
|
|
38
|
+
}
|
|
39
|
+
set installed(value) {
|
|
40
|
+
this.options.installed = value;
|
|
41
|
+
}
|
|
30
42
|
setOptions(options) {
|
|
31
43
|
this.options = options || {};
|
|
32
44
|
}
|
|
@@ -47,10 +59,16 @@ class Plugin {
|
|
|
47
59
|
afterEnable() {
|
|
48
60
|
return _asyncToGenerator(function* () {})();
|
|
49
61
|
}
|
|
62
|
+
beforeDisable() {
|
|
63
|
+
return _asyncToGenerator(function* () {})();
|
|
64
|
+
}
|
|
50
65
|
afterDisable() {
|
|
51
66
|
return _asyncToGenerator(function* () {})();
|
|
52
67
|
}
|
|
53
|
-
|
|
68
|
+
beforeRemove() {
|
|
69
|
+
return _asyncToGenerator(function* () {})();
|
|
70
|
+
}
|
|
71
|
+
afterRemove() {
|
|
54
72
|
return _asyncToGenerator(function* () {})();
|
|
55
73
|
}
|
|
56
74
|
importCollections(collectionsPath) {
|