egg 4.1.0-beta.34 → 4.1.0-beta.36
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/agent.d.ts +7 -3
- package/dist/agent.js +10 -6
- package/dist/ajv.d.ts +1 -1
- package/dist/ajv.js +3 -2
- package/dist/aop.d.ts +1 -1
- package/dist/aop.js +3 -2
- package/dist/app/extend/context.d.ts +181 -178
- package/dist/app/extend/context.js +244 -259
- package/dist/app/extend/helper.d.ts +40 -35
- package/dist/app/extend/helper.js +45 -41
- package/dist/app/extend/request.d.ts +135 -131
- package/dist/app/extend/request.js +219 -258
- package/dist/app/extend/response.d.ts +28 -24
- package/dist/app/extend/response.js +36 -34
- package/dist/app/middleware/body_parser.d.ts +2 -2
- package/dist/app/middleware/body_parser.js +7 -3
- package/dist/app/middleware/meta.d.ts +8 -8
- package/dist/app/middleware/meta.js +15 -18
- package/dist/app/middleware/notfound.d.ts +8 -5
- package/dist/app/middleware/notfound.js +25 -28
- package/dist/app/middleware/override_method.d.ts +2 -2
- package/dist/app/middleware/override_method.js +7 -3
- package/dist/app/middleware/site_file.d.ts +11 -7
- package/dist/app/middleware/site_file.js +37 -52
- package/dist/config/config.default.d.ts +11 -6
- package/dist/config/config.default.js +258 -375
- package/dist/config/config.local.d.ts +6 -3
- package/dist/config/config.local.js +7 -8
- package/dist/config/config.unittest.d.ts +6 -3
- package/dist/config/config.unittest.js +10 -8
- package/dist/config/plugin.d.ts +6 -2
- package/dist/config/plugin.js +67 -131
- package/dist/dal.d.ts +1 -1
- package/dist/dal.js +3 -2
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +3 -2
- package/dist/helper.d.ts +1 -1
- package/dist/helper.js +3 -2
- package/dist/index.d.ts +24 -106
- package/dist/index.js +23 -89
- package/dist/lib/agent.d.ts +21 -15
- package/dist/lib/agent.js +53 -45
- package/dist/lib/application.d.ts +60 -54
- package/dist/lib/application.js +200 -250
- package/dist/lib/core/base_context_class.d.ts +23 -17
- package/dist/lib/core/base_context_class.js +17 -15
- package/dist/lib/core/base_context_logger.d.ts +39 -35
- package/dist/lib/core/base_context_logger.js +58 -60
- package/dist/lib/core/base_hook_class.d.ts +18 -11
- package/dist/lib/core/base_hook_class.js +26 -22
- package/dist/lib/core/context_httpclient.d.ts +21 -16
- package/dist/lib/core/context_httpclient.js +29 -26
- package/dist/lib/core/httpclient.d.ts +14 -12
- package/dist/lib/core/httpclient.js +34 -37
- package/dist/lib/core/logger.d.ts +7 -3
- package/dist/lib/core/logger.js +30 -36
- package/dist/lib/core/messenger/IMessenger.d.ts +53 -49
- package/dist/lib/core/messenger/IMessenger.js +1 -2
- package/dist/lib/core/messenger/base.d.ts +11 -7
- package/dist/lib/core/messenger/base.js +30 -29
- package/dist/lib/core/messenger/index.d.ts +10 -6
- package/dist/lib/core/messenger/index.js +11 -8
- package/dist/lib/core/messenger/ipc.d.ts +62 -57
- package/dist/lib/core/messenger/ipc.js +126 -138
- package/dist/lib/core/messenger/local.d.ts +63 -58
- package/dist/lib/core/messenger/local.js +126 -131
- package/dist/lib/core/utils.d.ts +5 -2
- package/dist/lib/core/utils.js +44 -66
- package/dist/lib/define.d.ts +72 -67
- package/dist/lib/define.js +54 -53
- package/dist/lib/egg.d.ts +283 -281
- package/dist/lib/egg.js +512 -573
- package/dist/lib/error/CookieLimitExceedError.d.ts +7 -4
- package/dist/lib/error/CookieLimitExceedError.js +15 -12
- package/dist/lib/error/MessageUnhandledRejectionError.d.ts +7 -4
- package/dist/lib/error/MessageUnhandledRejectionError.js +15 -12
- package/dist/lib/error/index.d.ts +3 -2
- package/dist/lib/error/index.js +4 -3
- package/dist/lib/loader/AgentWorkerLoader.d.ts +15 -10
- package/dist/lib/loader/AgentWorkerLoader.js +22 -18
- package/dist/lib/loader/AppWorkerLoader.d.ts +20 -15
- package/dist/lib/loader/AppWorkerLoader.js +35 -37
- package/dist/lib/loader/EggApplicationLoader.d.ts +7 -3
- package/dist/lib/loader/EggApplicationLoader.js +7 -4
- package/dist/lib/loader/index.d.ts +4 -3
- package/dist/lib/loader/index.js +5 -4
- package/dist/lib/start.d.ts +24 -20
- package/dist/lib/start.js +32 -42
- package/dist/lib/types.d.ts +288 -286
- package/dist/lib/types.js +2 -2
- package/dist/lib/types.plugin.d.ts +21 -21
- package/dist/lib/types.plugin.js +23 -24
- package/dist/orm.d.ts +1 -1
- package/dist/orm.js +3 -2
- package/dist/schedule.d.ts +2 -2
- package/dist/schedule.js +5 -5
- package/dist/transaction.d.ts +1 -1
- package/dist/transaction.js +3 -2
- package/dist/urllib.d.ts +1 -1
- package/dist/urllib.js +3 -2
- package/package.json +60 -64
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PartialEggConfig } from "../lib/define.js";
|
|
2
|
+
|
|
3
|
+
//#region src/config/config.local.d.ts
|
|
4
|
+
declare const config: PartialEggConfig;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { config as default };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from "../lib/define.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmxvY2FsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbmZpZy9jb25maWcubG9jYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBeUIsTUFBTSxrQkFBa0IsQ0FBQztBQUV2RSxlQUFlLFlBQVksQ0FBQztJQUMxQixNQUFNLEVBQUU7UUFDTixVQUFVLEVBQUU7WUFDVixZQUFZLEVBQUUsTUFBTTtTQUNyQjtLQUNGO0NBQ0YsQ0FBcUIsQ0FBQyJ9
|
|
2
|
+
|
|
3
|
+
//#region src/config/config.local.ts
|
|
4
|
+
const config = defineConfig({ logger: { coreLogger: { consoleLevel: "WARN" } } });
|
|
5
|
+
var config_local_default = config;
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { config_local_default as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PartialEggConfig } from "../lib/define.js";
|
|
2
|
+
|
|
3
|
+
//#region src/config/config.unittest.d.ts
|
|
4
|
+
declare const config: PartialEggConfig;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { config as default };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { defineConfig } from "../lib/define.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
|
|
3
|
+
//#region src/config/config.unittest.ts
|
|
4
|
+
const config = defineConfig({ logger: {
|
|
5
|
+
consoleLevel: "WARN",
|
|
6
|
+
buffer: false
|
|
7
|
+
} });
|
|
8
|
+
var config_unittest_default = config;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { config_unittest_default as default };
|
package/dist/config/plugin.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { EggPluginItem } from "../lib/types.js";
|
|
2
|
+
import "../index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/config/plugin.d.ts
|
|
2
5
|
declare const plugins: Record<string, EggPluginItem>;
|
|
3
|
-
|
|
6
|
+
//#endregion
|
|
7
|
+
export { plugins as default };
|
package/dist/config/plugin.js
CHANGED
|
@@ -1,133 +1,69 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import securityPlugin from
|
|
9
|
-
import sessionPlugin from
|
|
10
|
-
import staticPlugin from
|
|
11
|
-
import viewPlugin from
|
|
12
|
-
import watcherPlugin from
|
|
13
|
-
|
|
1
|
+
import schedulePlugin from "@eggjs/schedule";
|
|
2
|
+
import developmentPlugin from "@eggjs/development";
|
|
3
|
+
import i18nPlugin from "@eggjs/i18n";
|
|
4
|
+
import jsonpPlugin from "@eggjs/jsonp";
|
|
5
|
+
import logrotatorPlugin from "@eggjs/logrotator";
|
|
6
|
+
import multipartPlugin from "@eggjs/multipart";
|
|
7
|
+
import onerrorPlugin from "@eggjs/onerror";
|
|
8
|
+
import securityPlugin from "@eggjs/security";
|
|
9
|
+
import sessionPlugin from "@eggjs/session";
|
|
10
|
+
import staticPlugin from "@eggjs/static";
|
|
11
|
+
import viewPlugin from "@eggjs/view";
|
|
12
|
+
import watcherPlugin from "@eggjs/watcher";
|
|
13
|
+
|
|
14
|
+
//#region src/config/plugin.ts
|
|
15
|
+
const enableTeggPlugins = process.env.DISABLE_TEGG_PLUGINS !== "true";
|
|
14
16
|
const plugins = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
...logrotatorPlugin(),
|
|
64
|
-
/**
|
|
65
|
-
* schedule tasks
|
|
66
|
-
* @member {Object} Plugin#schedule
|
|
67
|
-
* @property {Boolean} enable - `true` by default
|
|
68
|
-
* @since 2.7.0
|
|
69
|
-
*/
|
|
70
|
-
...schedulePlugin(),
|
|
71
|
-
/**
|
|
72
|
-
* `app/public` dir static serve
|
|
73
|
-
* @member {Object} Plugin#static
|
|
74
|
-
* @property {Boolean} enable - `true` by default
|
|
75
|
-
* @since 1.0.0
|
|
76
|
-
*/
|
|
77
|
-
...staticPlugin(),
|
|
78
|
-
/**
|
|
79
|
-
* jsonp support for egg
|
|
80
|
-
* @member {Function} Plugin#jsonp
|
|
81
|
-
* @property {Boolean} enable - `true` by default
|
|
82
|
-
* @since 1.0.0
|
|
83
|
-
*/
|
|
84
|
-
...jsonpPlugin(),
|
|
85
|
-
/**
|
|
86
|
-
* view plugin
|
|
87
|
-
* @member {Function} Plugin#view
|
|
88
|
-
* @property {Boolean} enable - `true` by default
|
|
89
|
-
* @since 1.0.0
|
|
90
|
-
*/
|
|
91
|
-
...viewPlugin(),
|
|
92
|
-
// tegg plugins
|
|
93
|
-
teggConfig: {
|
|
94
|
-
enable: enableTeggPlugins,
|
|
95
|
-
package: '@eggjs/tegg-config',
|
|
96
|
-
},
|
|
97
|
-
tegg: {
|
|
98
|
-
enable: enableTeggPlugins,
|
|
99
|
-
package: '@eggjs/tegg-plugin',
|
|
100
|
-
},
|
|
101
|
-
teggAjv: {
|
|
102
|
-
enable: enableTeggPlugins,
|
|
103
|
-
package: '@eggjs/ajv-plugin',
|
|
104
|
-
},
|
|
105
|
-
teggAop: {
|
|
106
|
-
enable: enableTeggPlugins,
|
|
107
|
-
package: '@eggjs/aop-plugin',
|
|
108
|
-
},
|
|
109
|
-
teggController: {
|
|
110
|
-
enable: enableTeggPlugins,
|
|
111
|
-
package: '@eggjs/controller-plugin',
|
|
112
|
-
},
|
|
113
|
-
teggDal: {
|
|
114
|
-
enable: enableTeggPlugins,
|
|
115
|
-
package: '@eggjs/dal-plugin',
|
|
116
|
-
},
|
|
117
|
-
// FIXME: AgentWorkerLoader.requireFile() load file: ~/tegg/plugin/eventbus/src/app/extend/context.ts, error: Invalid or unexpected token on worker_threads mode
|
|
118
|
-
teggEventbus: {
|
|
119
|
-
// FIXME: MultiPrototypeFound: multi proto found for name:eventContextFactory and qualifiers [{"value":"SINGLETON"}] [ https://eggjs.org/faq/TEGG_MULTI_PROTO_FOUND ]
|
|
120
|
-
enable: enableTeggPlugins,
|
|
121
|
-
package: '@eggjs/eventbus-plugin',
|
|
122
|
-
},
|
|
123
|
-
teggOrm: {
|
|
124
|
-
enable: enableTeggPlugins,
|
|
125
|
-
package: '@eggjs/orm-plugin',
|
|
126
|
-
},
|
|
127
|
-
teggSchedule: {
|
|
128
|
-
enable: enableTeggPlugins,
|
|
129
|
-
package: '@eggjs/schedule-plugin',
|
|
130
|
-
},
|
|
17
|
+
...onerrorPlugin(),
|
|
18
|
+
...sessionPlugin(),
|
|
19
|
+
...i18nPlugin(),
|
|
20
|
+
...watcherPlugin(),
|
|
21
|
+
...multipartPlugin(),
|
|
22
|
+
...securityPlugin(),
|
|
23
|
+
...developmentPlugin(),
|
|
24
|
+
...logrotatorPlugin(),
|
|
25
|
+
...schedulePlugin(),
|
|
26
|
+
...staticPlugin(),
|
|
27
|
+
...jsonpPlugin(),
|
|
28
|
+
...viewPlugin(),
|
|
29
|
+
teggConfig: {
|
|
30
|
+
enable: enableTeggPlugins,
|
|
31
|
+
package: "@eggjs/tegg-config"
|
|
32
|
+
},
|
|
33
|
+
tegg: {
|
|
34
|
+
enable: enableTeggPlugins,
|
|
35
|
+
package: "@eggjs/tegg-plugin"
|
|
36
|
+
},
|
|
37
|
+
teggAjv: {
|
|
38
|
+
enable: enableTeggPlugins,
|
|
39
|
+
package: "@eggjs/ajv-plugin"
|
|
40
|
+
},
|
|
41
|
+
teggAop: {
|
|
42
|
+
enable: enableTeggPlugins,
|
|
43
|
+
package: "@eggjs/aop-plugin"
|
|
44
|
+
},
|
|
45
|
+
teggController: {
|
|
46
|
+
enable: enableTeggPlugins,
|
|
47
|
+
package: "@eggjs/controller-plugin"
|
|
48
|
+
},
|
|
49
|
+
teggDal: {
|
|
50
|
+
enable: enableTeggPlugins,
|
|
51
|
+
package: "@eggjs/dal-plugin"
|
|
52
|
+
},
|
|
53
|
+
teggEventbus: {
|
|
54
|
+
enable: enableTeggPlugins,
|
|
55
|
+
package: "@eggjs/eventbus-plugin"
|
|
56
|
+
},
|
|
57
|
+
teggOrm: {
|
|
58
|
+
enable: enableTeggPlugins,
|
|
59
|
+
package: "@eggjs/orm-plugin"
|
|
60
|
+
},
|
|
61
|
+
teggSchedule: {
|
|
62
|
+
enable: enableTeggPlugins,
|
|
63
|
+
package: "@eggjs/schedule-plugin"
|
|
64
|
+
}
|
|
131
65
|
};
|
|
132
|
-
|
|
133
|
-
|
|
66
|
+
var plugin_default = plugins;
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { plugin_default as default };
|
package/dist/dal.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "@eggjs/tegg/dal";
|
package/dist/dal.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
|
|
1
|
+
export * from "@eggjs/tegg/dal"
|
|
2
|
+
|
|
3
|
+
export { };
|
package/dist/errors.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "@eggjs/errors";
|
package/dist/errors.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
|
|
1
|
+
export * from "@eggjs/errors"
|
|
2
|
+
|
|
3
|
+
export { };
|
package/dist/helper.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "@eggjs/tegg/helper";
|
package/dist/helper.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
|
|
1
|
+
export * from "@eggjs/tegg/helper"
|
|
2
|
+
|
|
3
|
+
export { };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,106 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
* @since 4.1.0
|
|
28
|
-
*/
|
|
29
|
-
EggAppConfig as Config, } from './lib/types.ts';
|
|
30
|
-
export * from './lib/start.ts';
|
|
31
|
-
export { Singleton, type SingletonCreateMethod, type SingletonOptions } from '@eggjs/core';
|
|
32
|
-
export * from './lib/error/index.ts';
|
|
33
|
-
export type { LoggerLevel, EggLogger, EggLogger as Logger } from 'egg-logger';
|
|
34
|
-
export * from './lib/core/httpclient.ts';
|
|
35
|
-
export * from './lib/core/context_httpclient.ts';
|
|
36
|
-
/**
|
|
37
|
-
* Start egg application with cluster mode
|
|
38
|
-
* @since 1.0.0
|
|
39
|
-
*/
|
|
40
|
-
export * from '@eggjs/cluster';
|
|
41
|
-
/**
|
|
42
|
-
* Start egg application with single process mode
|
|
43
|
-
* @since 1.0.0
|
|
44
|
-
*/
|
|
45
|
-
export { startEgg as start, type SingleModeApplication, type SingleModeAgent };
|
|
46
|
-
/**
|
|
47
|
-
* @member {Application} Egg#Application
|
|
48
|
-
* @since 1.0.0
|
|
49
|
-
*/
|
|
50
|
-
export { Application } from './lib/application.ts';
|
|
51
|
-
/**
|
|
52
|
-
* @member {Agent} Egg#Agent
|
|
53
|
-
* @since 1.0.0
|
|
54
|
-
*/
|
|
55
|
-
export { Agent } from './lib/agent.ts';
|
|
56
|
-
/**
|
|
57
|
-
* @member {AppWorkerLoader} Egg#AppWorkerLoader
|
|
58
|
-
* @since 1.0.0
|
|
59
|
-
*/
|
|
60
|
-
/**
|
|
61
|
-
* @member {AgentWorkerLoader} Egg#AgentWorkerLoader
|
|
62
|
-
* @since 1.0.0
|
|
63
|
-
*/
|
|
64
|
-
export { AppWorkerLoader, AgentWorkerLoader } from './lib/loader/index.ts';
|
|
65
|
-
/**
|
|
66
|
-
* @member {Controller} Egg#Controller
|
|
67
|
-
* @since 1.1.0
|
|
68
|
-
*/
|
|
69
|
-
export { BaseContextClass as Controller };
|
|
70
|
-
/**
|
|
71
|
-
* @member {Service} Egg#Service
|
|
72
|
-
* @since 1.1.0
|
|
73
|
-
*/
|
|
74
|
-
export { BaseContextClass as Service };
|
|
75
|
-
/**
|
|
76
|
-
* @member {Subscription} Egg#Subscription
|
|
77
|
-
* @since 1.10.0
|
|
78
|
-
*/
|
|
79
|
-
export { BaseContextClass as Subscription };
|
|
80
|
-
/**
|
|
81
|
-
* @member {BaseContextClass} Egg#BaseContextClass
|
|
82
|
-
* @since 1.2.0
|
|
83
|
-
*/
|
|
84
|
-
export { BaseContextClass } from './lib/core/base_context_class.ts';
|
|
85
|
-
/**
|
|
86
|
-
* @member {Boot} Egg#Boot
|
|
87
|
-
*/
|
|
88
|
-
export { BaseHookClass as Boot } from './lib/core/base_hook_class.ts';
|
|
89
|
-
export { AccessLevel, Acl, ObjectInitType, type ObjectInitTypeLike, type ObjectInfo, type MultiInstancePrototypeGetObjectsContext, QualifierUtil, type EggProtoImplClass, Inject, InjectOptional, EggQualifier, EggType,
|
|
90
|
-
/**
|
|
91
|
-
* @example
|
|
92
|
-
* ```ts
|
|
93
|
-
* import { HTTPContext, Context } from 'egg';
|
|
94
|
-
*
|
|
95
|
-
* @HTTPController()
|
|
96
|
-
* export class FooController {
|
|
97
|
-
* @HTTPMethod({
|
|
98
|
-
* path: '/foo',
|
|
99
|
-
* method: HTTPMethodEnum.GET,
|
|
100
|
-
* })
|
|
101
|
-
* async bar(@HTTPContext() ctx: Context, id: number): Promise<void> {
|
|
102
|
-
* console.log(ctx, id);
|
|
103
|
-
* }
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
HTTPContext, HTTPRequest, HTTPCookies, Cookies, HTTPController, HTTPMethod, HTTPMethodEnum, HTTPBody, HTTPQuery, HTTPQueries, HTTPParam, HTTPHeaders, HTTPParamType, Host, Middleware, Event, EventContext, type EggObjectLifecycle, LifecycleDestroy, LifecycleInit, LifecyclePostConstruct, LifecyclePostInject, LifecyclePreDestroy, LifecyclePreInject, LifecyclePreLoad, SingletonProto, MultiInstanceProto, ContextProto, type ImplDecorator, QualifierImplDecoratorUtil, type EggObjectFactory, type IncomingHttpHeaders, BackgroundTaskHelper, type ContextEventBus, type EventBus, type Events, MetadataUtil, } from '@eggjs/tegg';
|
|
1
|
+
import { EggContextHttpClient as HttpClient, HttpClientOptions, HttpClientRequestOptions, HttpClientRequestURL, HttpClientResponse } from "./lib/core/httpclient.js";
|
|
2
|
+
import { ClientErrorResponse, CustomLoaderConfig, EggAppConfig, EggAppInfo, EggEnvType, EggLoggerConfig, EggPlugin, EggPluginItem, HttpClientConfig, IController, IEggPluginItem, IService, PartialDeep, PowerPartial, RequestObjectBody } from "./lib/types.js";
|
|
3
|
+
import Response from "./app/extend/response.js";
|
|
4
|
+
import Request from "./app/extend/request.js";
|
|
5
|
+
import Context from "./app/extend/context.js";
|
|
6
|
+
import { AppWorkerLoader } from "./lib/loader/AppWorkerLoader.js";
|
|
7
|
+
import { AgentWorkerLoader } from "./lib/loader/AgentWorkerLoader.js";
|
|
8
|
+
import "./lib/loader/index.js";
|
|
9
|
+
import { Agent } from "./lib/agent.js";
|
|
10
|
+
import { ContextHttpClient } from "./lib/core/context_httpclient.js";
|
|
11
|
+
import { EggApplicationCore, EggApplicationCoreOptions, EggContext, IBoot as ILifecycleBoot, MiddlewareFunc, Next, Router } from "./lib/egg.js";
|
|
12
|
+
import { Application } from "./lib/application.js";
|
|
13
|
+
import { BaseContextClass } from "./lib/core/base_context_class.js";
|
|
14
|
+
import Helper from "./app/extend/helper.js";
|
|
15
|
+
import { SingleModeAgent, SingleModeApplication, StartEggOptions, startEgg } from "./lib/start.js";
|
|
16
|
+
import { EggConfigFactory, EggPluginFactory, EggPluginMeta, EggPluginOptions, PartialEggConfig, defineConfig, defineConfigFactory, definePluginFactory } from "./lib/define.js";
|
|
17
|
+
import { CookieLimitExceedError } from "./lib/error/CookieLimitExceedError.js";
|
|
18
|
+
import { MessageUnhandledRejectionError } from "./lib/error/MessageUnhandledRejectionError.js";
|
|
19
|
+
import { BaseHookClass } from "./lib/core/base_hook_class.js";
|
|
20
|
+
import { Singleton, SingletonCreateMethod, SingletonOptions } from "@eggjs/core";
|
|
21
|
+
import { EggLogger, EggLogger as Logger, LoggerLevel } from "egg-logger";
|
|
22
|
+
import { AccessLevel, Acl, BackgroundTaskHelper, ContextEventBus, ContextProto, Cookies, EggObjectFactory, EggObjectLifecycle, EggProtoImplClass, EggQualifier, EggType, Event, EventBus, EventContext, Events, HTTPBody, HTTPContext, HTTPController, HTTPCookies, HTTPHeaders, HTTPMethod, HTTPMethodEnum, HTTPParam, HTTPParamType, HTTPQueries, HTTPQuery, HTTPRequest, Host, ImplDecorator, IncomingHttpHeaders, Inject, InjectOptional, LifecycleDestroy, LifecycleInit, LifecyclePostConstruct, LifecyclePostInject, LifecyclePreDestroy, LifecyclePreInject, LifecyclePreLoad, MetadataUtil, Middleware, MultiInstanceProto, MultiInstancePrototypeGetObjectsContext, ObjectInfo, ObjectInitType, ObjectInitTypeLike, QualifierImplDecoratorUtil, QualifierUtil, SingletonProto } from "@eggjs/tegg";
|
|
23
|
+
export * from "@eggjs/cluster";
|
|
24
|
+
export { AccessLevel, Acl, Agent, AgentWorkerLoader, AppWorkerLoader, Application, BackgroundTaskHelper, BaseContextClass, BaseHookClass as Boot, ClientErrorResponse, type EggAppConfig as Config, Context, type ContextEventBus, ContextHttpClient, ContextProto, BaseContextClass as Controller, BaseContextClass as Service, BaseContextClass as Subscription, CookieLimitExceedError, Cookies, CustomLoaderConfig, EggAppConfig, EggAppInfo, EggApplicationCore, EggApplicationCoreOptions, EggConfigFactory, EggContext, HttpClient as EggContextHttpClient, HttpClient as EggHttpClient, HttpClient, EggEnvType, type EggLogger, EggLoggerConfig, type EggObjectFactory, type EggObjectLifecycle, EggPlugin, EggPluginFactory, EggPluginItem, EggPluginMeta, EggPluginOptions, type EggProtoImplClass, EggQualifier, EggType, Event, type EventBus, EventContext, type Events, HTTPBody, HTTPContext, HTTPController, HTTPCookies, HTTPHeaders, HTTPMethod, HTTPMethodEnum, HTTPParam, HTTPParamType, HTTPQueries, HTTPQuery, HTTPRequest, Helper, type Helper as IHelper, Host, HttpClientConfig, HttpClientOptions, HttpClientRequestOptions, HttpClientRequestURL, HttpClientResponse, ILifecycleBoot as IBoot, ILifecycleBoot, IController, IEggPluginItem, IService, type ImplDecorator, type IncomingHttpHeaders, Inject, InjectOptional, LifecycleDestroy, LifecycleInit, LifecyclePostConstruct, LifecyclePostInject, LifecyclePreDestroy, LifecyclePreInject, LifecyclePreLoad, type Logger, type LoggerLevel, MessageUnhandledRejectionError, MetadataUtil, Middleware, MiddlewareFunc, MultiInstanceProto, type MultiInstancePrototypeGetObjectsContext, Next, type ObjectInfo, ObjectInitType, type ObjectInitTypeLike, PartialDeep, PartialEggConfig, PowerPartial, QualifierImplDecoratorUtil, QualifierUtil, Request, RequestObjectBody, Response, Router, type SingleModeAgent, type SingleModeApplication, Singleton, type SingletonCreateMethod, type SingletonOptions, SingletonProto, StartEggOptions, defineConfig, defineConfigFactory, definePluginFactory, startEgg as start, startEgg };
|
package/dist/index.js
CHANGED
|
@@ -1,91 +1,25 @@
|
|
|
1
|
+
import { BaseHookClass } from "./lib/core/base_hook_class.js";
|
|
1
2
|
import { BaseContextClass } from "./lib/core/base_context_class.js";
|
|
2
|
-
import { startEgg } from "./lib/start.js";
|
|
3
3
|
import Helper from "./app/extend/helper.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export * from
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* @since 1.0.0
|
|
27
|
-
*/
|
|
28
|
-
export { startEgg as start };
|
|
29
|
-
/**
|
|
30
|
-
* @member {Application} Egg#Application
|
|
31
|
-
* @since 1.0.0
|
|
32
|
-
*/
|
|
33
|
-
export { Application } from "./lib/application.js";
|
|
34
|
-
/**
|
|
35
|
-
* @member {Agent} Egg#Agent
|
|
36
|
-
* @since 1.0.0
|
|
37
|
-
*/
|
|
38
|
-
export { Agent } from "./lib/agent.js";
|
|
39
|
-
/**
|
|
40
|
-
* @member {AppWorkerLoader} Egg#AppWorkerLoader
|
|
41
|
-
* @since 1.0.0
|
|
42
|
-
*/
|
|
43
|
-
/**
|
|
44
|
-
* @member {AgentWorkerLoader} Egg#AgentWorkerLoader
|
|
45
|
-
* @since 1.0.0
|
|
46
|
-
*/
|
|
47
|
-
export { AppWorkerLoader, AgentWorkerLoader } from "./lib/loader/index.js";
|
|
48
|
-
/**
|
|
49
|
-
* @member {Controller} Egg#Controller
|
|
50
|
-
* @since 1.1.0
|
|
51
|
-
*/
|
|
52
|
-
export { BaseContextClass as Controller };
|
|
53
|
-
/**
|
|
54
|
-
* @member {Service} Egg#Service
|
|
55
|
-
* @since 1.1.0
|
|
56
|
-
*/
|
|
57
|
-
export { BaseContextClass as Service };
|
|
58
|
-
/**
|
|
59
|
-
* @member {Subscription} Egg#Subscription
|
|
60
|
-
* @since 1.10.0
|
|
61
|
-
*/
|
|
62
|
-
export { BaseContextClass as Subscription };
|
|
63
|
-
/**
|
|
64
|
-
* @member {BaseContextClass} Egg#BaseContextClass
|
|
65
|
-
* @since 1.2.0
|
|
66
|
-
*/
|
|
67
|
-
export { BaseContextClass } from "./lib/core/base_context_class.js";
|
|
68
|
-
/**
|
|
69
|
-
* @member {Boot} Egg#Boot
|
|
70
|
-
*/
|
|
71
|
-
export { BaseHookClass as Boot } from "./lib/core/base_hook_class.js";
|
|
72
|
-
// export tegg decorators
|
|
73
|
-
export { AccessLevel, Acl, ObjectInitType, QualifierUtil, Inject, InjectOptional, EggQualifier, EggType,
|
|
74
|
-
/**
|
|
75
|
-
* @example
|
|
76
|
-
* ```ts
|
|
77
|
-
* import { HTTPContext, Context } from 'egg';
|
|
78
|
-
*
|
|
79
|
-
* @HTTPController()
|
|
80
|
-
* export class FooController {
|
|
81
|
-
* @HTTPMethod({
|
|
82
|
-
* path: '/foo',
|
|
83
|
-
* method: HTTPMethodEnum.GET,
|
|
84
|
-
* })
|
|
85
|
-
* async bar(@HTTPContext() ctx: Context, id: number): Promise<void> {
|
|
86
|
-
* console.log(ctx, id);
|
|
87
|
-
* }
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
HTTPContext, HTTPRequest, HTTPCookies, Cookies, HTTPController, HTTPMethod, HTTPMethodEnum, HTTPBody, HTTPQuery, HTTPQueries, HTTPParam, HTTPHeaders, HTTPParamType, Host, Middleware, Event, EventContext, LifecycleDestroy, LifecycleInit, LifecyclePostConstruct, LifecyclePostInject, LifecyclePreDestroy, LifecyclePreInject, LifecyclePreLoad, SingletonProto, MultiInstanceProto, ContextProto, QualifierImplDecoratorUtil, BackgroundTaskHelper, MetadataUtil, } from '@eggjs/tegg';
|
|
91
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFDcEUsT0FBTyxFQUFFLFFBQVEsRUFBb0QsTUFBTSxnQkFBZ0IsQ0FBQztBQUM1RixPQUFPLE1BQU0sTUFBTSx3QkFBd0IsQ0FBQztBQUU1QyxpQkFBaUI7QUFDakIsT0FBTyxFQUFFLE1BQU0sRUFBRSxDQUFDO0FBTWxCLGVBQWU7QUFDZixjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLGdCQUFnQixDQUFDO0FBQy9CLDBCQUEwQjtBQUMxQixjQUFjLGlCQUFpQixDQUFDO0FBMEJoQyxjQUFjLGdCQUFnQixDQUFDO0FBRS9CLG1CQUFtQjtBQUNuQixPQUFPLEVBQUUsU0FBUyxFQUFxRCxNQUFNLGFBQWEsQ0FBQztBQUUzRixnQkFBZ0I7QUFDaEIsY0FBYyxzQkFBc0IsQ0FBQztBQUtyQyxxQkFBcUI7QUFDckIsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLGtDQUFrQyxDQUFDO0FBRWpEOzs7R0FHRztBQUNILGNBQWMsZ0JBQWdCLENBQUM7QUFFL0I7OztHQUdHO0FBQ0gsT0FBTyxFQUFFLFFBQVEsSUFBSSxLQUFLLEVBQW9ELENBQUM7QUFFL0U7OztHQUdHO0FBQ0gsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBRW5EOzs7R0FHRztBQUNILE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUV2Qzs7O0dBR0c7QUFFSDs7O0dBR0c7QUFFSCxPQUFPLEVBQUUsZUFBZSxFQUFFLGlCQUFpQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFM0U7OztHQUdHO0FBQ0gsT0FBTyxFQUFFLGdCQUFnQixJQUFJLFVBQVUsRUFBRSxDQUFDO0FBRTFDOzs7R0FHRztBQUNILE9BQU8sRUFBRSxnQkFBZ0IsSUFBSSxPQUFPLEVBQUUsQ0FBQztBQUV2Qzs7O0dBR0c7QUFDSCxPQUFPLEVBQUUsZ0JBQWdCLElBQUksWUFBWSxFQUFFLENBQUM7QUFFNUM7OztHQUdHO0FBQ0gsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFFcEU7O0dBRUc7QUFDSCxPQUFPLEVBQUUsYUFBYSxJQUFJLElBQUksRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRXRFLHlCQUF5QjtBQUN6QixPQUFPLEVBQ0wsV0FBVyxFQUNYLEdBQUcsRUFDSCxjQUFjLEVBSWQsYUFBYSxFQUViLE1BQU0sRUFDTixjQUFjLEVBQ2QsWUFBWSxFQUNaLE9BQU87QUFDUDs7Ozs7Ozs7Ozs7Ozs7O0dBZUc7QUFDSCxXQUFXLEVBQ1gsV0FBVyxFQUNYLFdBQVcsRUFDWCxPQUFPLEVBQ1AsY0FBYyxFQUNkLFVBQVUsRUFDVixjQUFjLEVBQ2QsUUFBUSxFQUNSLFNBQVMsRUFDVCxXQUFXLEVBQ1gsU0FBUyxFQUNULFdBQVcsRUFDWCxhQUFhLEVBQ2IsSUFBSSxFQUNKLFVBQVUsRUFDVixLQUFLLEVBQ0wsWUFBWSxFQUVaLGdCQUFnQixFQUNoQixhQUFhLEVBQ2Isc0JBQXNCLEVBQ3RCLG1CQUFtQixFQUNuQixtQkFBbUIsRUFDbkIsa0JBQWtCLEVBQ2xCLGdCQUFnQixFQUNoQixjQUFjLEVBQ2Qsa0JBQWtCLEVBQ2xCLFlBQVksRUFFWiwwQkFBMEIsRUFHMUIsb0JBQW9CLEVBSXBCLFlBQVksR0FDYixNQUFNLGFBQWEsQ0FBQyJ9
|
|
4
|
+
import Context from "./app/extend/context.js";
|
|
5
|
+
import Response from "./app/extend/response.js";
|
|
6
|
+
import Request from "./app/extend/request.js";
|
|
7
|
+
import { ContextHttpClient } from "./lib/core/context_httpclient.js";
|
|
8
|
+
import { HttpClient } from "./lib/core/httpclient.js";
|
|
9
|
+
import { CookieLimitExceedError } from "./lib/error/CookieLimitExceedError.js";
|
|
10
|
+
import { MessageUnhandledRejectionError } from "./lib/error/MessageUnhandledRejectionError.js";
|
|
11
|
+
import { EggApplicationCore, Router } from "./lib/egg.js";
|
|
12
|
+
import { AppWorkerLoader } from "./lib/loader/AppWorkerLoader.js";
|
|
13
|
+
import { AgentWorkerLoader } from "./lib/loader/AgentWorkerLoader.js";
|
|
14
|
+
import "./lib/loader/index.js";
|
|
15
|
+
import { Agent } from "./lib/agent.js";
|
|
16
|
+
import { Application } from "./lib/application.js";
|
|
17
|
+
import "./lib/types.js";
|
|
18
|
+
import { startEgg } from "./lib/start.js";
|
|
19
|
+
import { defineConfig, defineConfigFactory, definePluginFactory } from "./lib/define.js";
|
|
20
|
+
import { Singleton } from "@eggjs/core";
|
|
21
|
+
import { AccessLevel, Acl, BackgroundTaskHelper, ContextProto, Cookies, EggQualifier, EggType, Event, EventContext, HTTPBody, HTTPContext, HTTPController, HTTPCookies, HTTPHeaders, HTTPMethod, HTTPMethodEnum, HTTPParam, HTTPParamType, HTTPQueries, HTTPQuery, HTTPRequest, Host, Inject, InjectOptional, LifecycleDestroy, LifecycleInit, LifecyclePostConstruct, LifecyclePostInject, LifecyclePreDestroy, LifecyclePreInject, LifecyclePreLoad, MetadataUtil, Middleware, MultiInstanceProto, ObjectInitType, QualifierImplDecoratorUtil, QualifierUtil, SingletonProto } from "@eggjs/tegg";
|
|
22
|
+
|
|
23
|
+
export * from "@eggjs/cluster"
|
|
24
|
+
|
|
25
|
+
export { AccessLevel, Acl, Agent, AgentWorkerLoader, AppWorkerLoader, Application, BackgroundTaskHelper, BaseContextClass, BaseHookClass as Boot, Context, ContextHttpClient, ContextProto, BaseContextClass as Controller, BaseContextClass as Service, BaseContextClass as Subscription, CookieLimitExceedError, Cookies, EggApplicationCore, EggQualifier, EggType, Event, EventContext, HTTPBody, HTTPContext, HTTPController, HTTPCookies, HTTPHeaders, HTTPMethod, HTTPMethodEnum, HTTPParam, HTTPParamType, HTTPQueries, HTTPQuery, HTTPRequest, Helper, Host, HttpClient, Inject, InjectOptional, LifecycleDestroy, LifecycleInit, LifecyclePostConstruct, LifecyclePostInject, LifecyclePreDestroy, LifecyclePreInject, LifecyclePreLoad, MessageUnhandledRejectionError, MetadataUtil, Middleware, MultiInstanceProto, ObjectInitType, QualifierImplDecoratorUtil, QualifierUtil, Request, Response, Router, Singleton, SingletonProto, defineConfig, defineConfigFactory, definePluginFactory, startEgg as start, startEgg };
|
package/dist/lib/agent.d.ts
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { AgentWorkerLoader } from "./loader/AgentWorkerLoader.js";
|
|
2
|
+
import "./loader/index.js";
|
|
3
|
+
import { EggApplicationCore, EggApplicationCoreOptions } from "./egg.js";
|
|
4
|
+
|
|
5
|
+
//#region src/lib/agent.d.ts
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
* Singleton instance in Agent Worker, extend {@link EggApplicationCore}
|
|
9
|
+
* @augments EggApplicationCore
|
|
10
|
+
*/
|
|
11
|
+
declare class Agent extends EggApplicationCore {
|
|
12
|
+
#private;
|
|
13
|
+
/**
|
|
14
|
+
* @class
|
|
15
|
+
* @param {Object} options - see {@link EggApplicationCore}
|
|
16
|
+
*/
|
|
17
|
+
constructor(options?: Omit<EggApplicationCoreOptions, "type">);
|
|
18
|
+
protected customEggLoader(): typeof AgentWorkerLoader;
|
|
19
|
+
_wrapMessenger(): void;
|
|
20
|
+
close(): Promise<void>;
|
|
17
21
|
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Agent };
|