ee-core 1.2.8 → 1.2.9

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 (44) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +2 -2
  3. package/bin/tools.js +22 -22
  4. package/config/config.default.js +262 -250
  5. package/core/index.js +12 -12
  6. package/core/lib/ee.js +209 -209
  7. package/core/lib/loader/context_loader.js +105 -105
  8. package/core/lib/loader/ee_loader.js +447 -451
  9. package/core/lib/loader/file_loader.js +262 -262
  10. package/core/lib/loader/mixin/config.js +138 -138
  11. package/core/lib/loader/mixin/controller.js +123 -123
  12. package/core/lib/loader/mixin/service.js +29 -29
  13. package/core/lib/utils/base_context_class.js +34 -34
  14. package/core/lib/utils/index.js +100 -100
  15. package/core/lib/utils/sequencify.js +59 -59
  16. package/core/lib/utils/timing.js +77 -77
  17. package/index.js +49 -49
  18. package/lib/appLoader.js +45 -45
  19. package/lib/application.js +81 -80
  20. package/lib/baseApp.js +133 -118
  21. package/lib/constant.js +28 -28
  22. package/lib/eeApp.js +321 -326
  23. package/lib/helper.js +51 -51
  24. package/lib/httpclient.js +136 -136
  25. package/lib/logger.js +46 -46
  26. package/lib/socket/httpServer.js +134 -102
  27. package/lib/socket/io.js +23 -23
  28. package/lib/socket/ipcServer.js +128 -128
  29. package/lib/socket/socketClient.js +50 -50
  30. package/lib/socket/socketServer.js +76 -76
  31. package/lib/socket/start.js +22 -22
  32. package/lib/storage/index.js +33 -33
  33. package/lib/storage/lowdbStorage.js +98 -98
  34. package/lib/storage/sqliteStorage.js +58 -58
  35. package/package.json +45 -45
  36. package/tools/codeCompress.js +204 -204
  37. package/tools/replaceDist.js +76 -76
  38. package/utils/common.js +90 -90
  39. package/utils/index.js +151 -207
  40. package/utils/wrap.js +37 -37
  41. package/resource/images/loding.gif +0 -0
  42. package/resource/images/tray_logo.png +0 -0
  43. package/resource/loading.html +0 -22
  44. package/resource/view_example.html +0 -22
@@ -1,138 +1,138 @@
1
- 'use strict';
2
-
3
- const debug = require('debug')('ee-core:config');
4
- const path = require('path');
5
- const extend = require('extend2');
6
- const assert = require('assert');
7
- const { Console } = require('console');
8
-
9
- module.exports = {
10
-
11
- /**
12
- * Load config/config.js
13
- *
14
- * Will merge config.default.js 和 config.${env}.js
15
- *
16
- * @function EggLoader#loadConfig
17
- * @since 1.0.0
18
- */
19
- loadConfig() {
20
- this.timing.start('Load Config');
21
- this.configMeta = {};
22
-
23
- const target = {};
24
-
25
- // Load Application config first
26
- const appConfig = this._preloadAppConfig();
27
- //console.log('----------------------- appConfig:', appConfig);
28
-
29
- // plugin config.default
30
- // framework config.default
31
- // app config.default
32
- // plugin config.{env}
33
- // framework config.{env}
34
- // app config.{env}
35
- for (const filename of this.getTypeFiles('config')) {
36
- for (const unit of this.getLoadUnits()) {
37
- const isApp = unit.type === 'app';
38
- const config = this._loadConfig(unit.path, filename, isApp ? undefined : appConfig, unit.type);
39
-
40
- if (!config) {
41
- continue;
42
- }
43
-
44
- debug('Loaded config %s, %s, %j', unit.path, filename, config);
45
- extend(true, target, config);
46
- }
47
- }
48
-
49
- // load env from process.env.EE_APP_CONFIG
50
- const envConfig = this._loadConfigFromEnv();
51
- debug('Loaded config from private env, %j', envConfig);
52
- extend(true, target, envConfig);
53
-
54
- // You can manipulate the order of app.config.coreMiddleware and app.config.appMiddleware in app.js
55
- target.coreMiddleware = target.coreMiddlewares = target.coreMiddleware || [];
56
- target.appMiddleware = target.appMiddlewares = target.middleware || [];
57
-
58
- this.config = target;
59
- this.timing.end('Load Config');
60
- },
61
-
62
- _preloadAppConfig() {
63
- const names = [
64
- 'config.default',
65
- `config.${this.serverEnv}`,
66
- ];
67
- const target = {};
68
- for (const filename of names) {
69
- const config = this._loadConfig(this.options.baseDir, filename, undefined, 'app');
70
- extend(true, target, config);
71
- }
72
- return target;
73
- },
74
-
75
- _loadConfig(dirpath, filename, extraInject, type) {
76
- const isPlugin = type === 'plugin';
77
- const isApp = type === 'app';
78
-
79
- let filepath = this.resolveModule(path.join(dirpath, 'config', filename));
80
-
81
- //console.log("_loadConfig filepath:", filepath);
82
-
83
- // let config.js compatible
84
- if (filename === 'config.default' && !filepath) {
85
- filepath = this.resolveModule(path.join(dirpath, 'config/config'));
86
- }
87
-
88
- const config = this.loadFile(filepath, this.appInfo, extraInject);
89
-
90
- if (!config) return null;
91
-
92
- if (isPlugin || isApp) {
93
- assert(!config.coreMiddleware, 'Can not define coreMiddleware in app or plugin');
94
- }
95
- if (!isApp) {
96
- assert(!config.middleware, 'Can not define middleware in ' + filepath);
97
- }
98
-
99
- // store config meta, check where is the property of config come from.
100
- this._setConfigMeta(config, filepath);
101
-
102
- return config;
103
- },
104
-
105
- _loadConfigFromEnv() {
106
- const envConfigStr = process.env.EE_APP_CONFIG;
107
- if (!envConfigStr) return;
108
- try {
109
- const envConfig = JSON.parse(envConfigStr);
110
- this._setConfigMeta(envConfig, '<process.env.EE_APP_CONFIG>');
111
- return envConfig;
112
- } catch (err) {
113
- this.options.logger.warn('[egg-loader] process.env.EE_APP_CONFIG is not invalid JSON: %s', envConfigStr);
114
- }
115
- },
116
-
117
- _setConfigMeta(config, filepath) {
118
- config = extend(true, {}, config);
119
- setConfig(config, filepath);
120
- extend(true, this.configMeta, config);
121
- },
122
- };
123
-
124
- function setConfig(obj, filepath) {
125
- for (const key of Object.keys(obj)) {
126
- const val = obj[key];
127
- // ignore console
128
- if (key === 'console' && val && typeof val.Console === 'function' && val.Console === Console) {
129
- obj[key] = filepath;
130
- continue;
131
- }
132
- if (val && Object.getPrototypeOf(val) === Object.prototype && Object.keys(val).length > 0) {
133
- setConfig(val, filepath);
134
- continue;
135
- }
136
- obj[key] = filepath;
137
- }
138
- }
1
+ 'use strict';
2
+
3
+ const debug = require('debug')('ee-core:config');
4
+ const path = require('path');
5
+ const extend = require('extend2');
6
+ const assert = require('assert');
7
+ const { Console } = require('console');
8
+
9
+ module.exports = {
10
+
11
+ /**
12
+ * Load config/config.js
13
+ *
14
+ * Will merge config.default.js 和 config.${env}.js
15
+ *
16
+ * @function EggLoader#loadConfig
17
+ * @since 1.0.0
18
+ */
19
+ loadConfig() {
20
+ this.timing.start('Load Config');
21
+ this.configMeta = {};
22
+
23
+ const target = {};
24
+
25
+ // Load Application config first
26
+ const appConfig = this._preloadAppConfig();
27
+ //console.log('----------------------- appConfig:', appConfig);
28
+
29
+ // plugin config.default
30
+ // framework config.default
31
+ // app config.default
32
+ // plugin config.{env}
33
+ // framework config.{env}
34
+ // app config.{env}
35
+ for (const filename of this.getTypeFiles('config')) {
36
+ for (const unit of this.getLoadUnits()) {
37
+ const isApp = unit.type === 'app';
38
+ const config = this._loadConfig(unit.path, filename, isApp ? undefined : appConfig, unit.type);
39
+
40
+ if (!config) {
41
+ continue;
42
+ }
43
+
44
+ debug('Loaded config %s, %s, %j', unit.path, filename, config);
45
+ extend(true, target, config);
46
+ }
47
+ }
48
+
49
+ // load env from process.env.EE_APP_CONFIG
50
+ const envConfig = this._loadConfigFromEnv();
51
+ debug('Loaded config from private env, %j', envConfig);
52
+ extend(true, target, envConfig);
53
+
54
+ // You can manipulate the order of app.config.coreMiddleware and app.config.appMiddleware in app.js
55
+ target.coreMiddleware = target.coreMiddlewares = target.coreMiddleware || [];
56
+ target.appMiddleware = target.appMiddlewares = target.middleware || [];
57
+
58
+ this.config = target;
59
+ this.timing.end('Load Config');
60
+ },
61
+
62
+ _preloadAppConfig() {
63
+ const names = [
64
+ 'config.default',
65
+ `config.${this.serverEnv}`,
66
+ ];
67
+ const target = {};
68
+ for (const filename of names) {
69
+ const config = this._loadConfig(this.options.baseDir, filename, undefined, 'app');
70
+ extend(true, target, config);
71
+ }
72
+ return target;
73
+ },
74
+
75
+ _loadConfig(dirpath, filename, extraInject, type) {
76
+ const isPlugin = type === 'plugin';
77
+ const isApp = type === 'app';
78
+
79
+ let filepath = this.resolveModule(path.join(dirpath, 'config', filename));
80
+
81
+ //console.log("_loadConfig filepath:", filepath);
82
+
83
+ // let config.js compatible
84
+ if (filename === 'config.default' && !filepath) {
85
+ filepath = this.resolveModule(path.join(dirpath, 'config/config'));
86
+ }
87
+
88
+ const config = this.loadFile(filepath, this.appInfo, extraInject);
89
+
90
+ if (!config) return null;
91
+
92
+ if (isPlugin || isApp) {
93
+ assert(!config.coreMiddleware, 'Can not define coreMiddleware in app or plugin');
94
+ }
95
+ if (!isApp) {
96
+ assert(!config.middleware, 'Can not define middleware in ' + filepath);
97
+ }
98
+
99
+ // store config meta, check where is the property of config come from.
100
+ this._setConfigMeta(config, filepath);
101
+
102
+ return config;
103
+ },
104
+
105
+ _loadConfigFromEnv() {
106
+ const envConfigStr = process.env.EE_APP_CONFIG;
107
+ if (!envConfigStr) return;
108
+ try {
109
+ const envConfig = JSON.parse(envConfigStr);
110
+ this._setConfigMeta(envConfig, '<process.env.EE_APP_CONFIG>');
111
+ return envConfig;
112
+ } catch (err) {
113
+ this.options.logger.warn('[egg-loader] process.env.EE_APP_CONFIG is not invalid JSON: %s', envConfigStr);
114
+ }
115
+ },
116
+
117
+ _setConfigMeta(config, filepath) {
118
+ config = extend(true, {}, config);
119
+ setConfig(config, filepath);
120
+ extend(true, this.configMeta, config);
121
+ },
122
+ };
123
+
124
+ function setConfig(obj, filepath) {
125
+ for (const key of Object.keys(obj)) {
126
+ const val = obj[key];
127
+ // ignore console
128
+ if (key === 'console' && val && typeof val.Console === 'function' && val.Console === Console) {
129
+ obj[key] = filepath;
130
+ continue;
131
+ }
132
+ if (val && Object.getPrototypeOf(val) === Object.prototype && Object.keys(val).length > 0) {
133
+ setConfig(val, filepath);
134
+ continue;
135
+ }
136
+ obj[key] = filepath;
137
+ }
138
+ }
@@ -1,123 +1,123 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
- const is = require('is-type-of');
5
- const utility = require('utility');
6
- const utils = require('../../utils');
7
- const FULLPATH = require('../file_loader').FULLPATH;
8
-
9
-
10
- module.exports = {
11
-
12
- /**
13
- * Load app/controller
14
- * @param {Object} opt - LoaderOptions
15
- * @since 1.0.0
16
- */
17
- loadController(opt) {
18
- this.timing.start('Load Controller');
19
- opt = Object.assign({
20
- caseStyle: 'lower',
21
- directory: path.join(this.options.baseDir, 'controller'),
22
- initializer: (obj, opt) => {
23
- // return class if it exports a function
24
- // ```js
25
- // module.exports = app => {
26
- // return class HomeController extends app.Controller {};
27
- // }
28
- // ```
29
- if (is.function(obj) && !is.generatorFunction(obj) && !is.class(obj) && !is.asyncFunction(obj)) {
30
- obj = obj(this.app);
31
- }
32
- if (is.class(obj)) {
33
- obj.prototype.pathName = opt.pathName;
34
- obj.prototype.fullPath = opt.path;
35
- return wrapClass(obj);
36
- }
37
- if (is.object(obj)) {
38
- return wrapObject(obj, opt.path);
39
- }
40
- // support generatorFunction for forward compatbility
41
- if (is.generatorFunction(obj) || is.asyncFunction(obj)) {
42
- return wrapObject({ 'module.exports': obj }, opt.path)['module.exports'];
43
- }
44
- return obj;
45
- },
46
- }, opt);
47
- const controllerBase = opt.directory;
48
-
49
- this.loadToApp(controllerBase, 'controller', opt);
50
- this.options.logger.info('[egg:loader] Controller loaded: %s', controllerBase);
51
- this.timing.end('Load Controller');
52
- },
53
-
54
- };
55
-
56
- // wrap the class, yield a object with middlewares
57
- function wrapClass(Controller) {
58
- let proto = Controller.prototype;
59
- const ret = {};
60
- // tracing the prototype chain
61
- while (proto !== Object.prototype) {
62
- const keys = Object.getOwnPropertyNames(proto);
63
- for (const key of keys) {
64
- // getOwnPropertyNames will return constructor
65
- // that should be ignored
66
- if (key === 'constructor') {
67
- continue;
68
- }
69
- // skip getter, setter & non-function properties
70
- const d = Object.getOwnPropertyDescriptor(proto, key);
71
- // prevent to override sub method
72
- if (is.function(d.value) && !ret.hasOwnProperty(key)) {
73
- ret[key] = methodToMiddleware(Controller, key);
74
- ret[key][FULLPATH] = Controller.prototype.fullPath + '#' + Controller.name + '.' + key + '()';
75
- }
76
- }
77
- proto = Object.getPrototypeOf(proto);
78
- }
79
- return ret;
80
-
81
- function methodToMiddleware(Controller, key) {
82
- return function classControllerMiddleware(...args) {
83
- const controller = new Controller(this);
84
- // if (!this.app.config.controller || !this.app.config.controller.supportParams) {
85
- // args = [ this ];
86
- // }
87
- //args = [ this ];
88
- return utils.callFn(controller[key], args, controller);
89
- };
90
- }
91
- }
92
-
93
- // wrap the method of the object, method can receive ctx as it's first argument
94
- function wrapObject(obj, path, prefix) {
95
- const keys = Object.keys(obj);
96
- const ret = {};
97
- for (const key of keys) {
98
- if (is.function(obj[key])) {
99
- const names = utility.getParamNames(obj[key]);
100
- if (names[0] === 'next') {
101
- throw new Error(`controller \`${prefix || ''}${key}\` should not use next as argument from file ${path}`);
102
- }
103
- ret[key] = functionToMiddleware(obj[key]);
104
- ret[key][FULLPATH] = `${path}#${prefix || ''}${key}()`;
105
- } else if (is.object(obj[key])) {
106
- ret[key] = wrapObject(obj[key], path, `${prefix || ''}${key}.`);
107
- }
108
- }
109
- return ret;
110
-
111
- function functionToMiddleware(func) {
112
- const objectControllerMiddleware = async function(...args) {
113
- // if (!this.app.config.controller || !this.app.config.controller.supportParams) {
114
- // args = [ this ];
115
- // }
116
- return await utils.callFn(func, args, this);
117
- };
118
- for (const key in func) {
119
- objectControllerMiddleware[key] = func[key];
120
- }
121
- return objectControllerMiddleware;
122
- }
123
- }
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const is = require('is-type-of');
5
+ const utility = require('utility');
6
+ const utils = require('../../utils');
7
+ const FULLPATH = require('../file_loader').FULLPATH;
8
+
9
+
10
+ module.exports = {
11
+
12
+ /**
13
+ * Load app/controller
14
+ * @param {Object} opt - LoaderOptions
15
+ * @since 1.0.0
16
+ */
17
+ loadController(opt) {
18
+ this.timing.start('Load Controller');
19
+ opt = Object.assign({
20
+ caseStyle: 'lower',
21
+ directory: path.join(this.options.baseDir, 'controller'),
22
+ initializer: (obj, opt) => {
23
+ // return class if it exports a function
24
+ // ```js
25
+ // module.exports = app => {
26
+ // return class HomeController extends app.Controller {};
27
+ // }
28
+ // ```
29
+ if (is.function(obj) && !is.generatorFunction(obj) && !is.class(obj) && !is.asyncFunction(obj)) {
30
+ obj = obj(this.app);
31
+ }
32
+ if (is.class(obj)) {
33
+ obj.prototype.pathName = opt.pathName;
34
+ obj.prototype.fullPath = opt.path;
35
+ return wrapClass(obj);
36
+ }
37
+ if (is.object(obj)) {
38
+ return wrapObject(obj, opt.path);
39
+ }
40
+ // support generatorFunction for forward compatbility
41
+ if (is.generatorFunction(obj) || is.asyncFunction(obj)) {
42
+ return wrapObject({ 'module.exports': obj }, opt.path)['module.exports'];
43
+ }
44
+ return obj;
45
+ },
46
+ }, opt);
47
+ const controllerBase = opt.directory;
48
+
49
+ this.loadToApp(controllerBase, 'controller', opt);
50
+ this.options.logger.info('[egg:loader] Controller loaded: %s', controllerBase);
51
+ this.timing.end('Load Controller');
52
+ },
53
+
54
+ };
55
+
56
+ // wrap the class, yield a object with middlewares
57
+ function wrapClass(Controller) {
58
+ let proto = Controller.prototype;
59
+ const ret = {};
60
+ // tracing the prototype chain
61
+ while (proto !== Object.prototype) {
62
+ const keys = Object.getOwnPropertyNames(proto);
63
+ for (const key of keys) {
64
+ // getOwnPropertyNames will return constructor
65
+ // that should be ignored
66
+ if (key === 'constructor') {
67
+ continue;
68
+ }
69
+ // skip getter, setter & non-function properties
70
+ const d = Object.getOwnPropertyDescriptor(proto, key);
71
+ // prevent to override sub method
72
+ if (is.function(d.value) && !ret.hasOwnProperty(key)) {
73
+ ret[key] = methodToMiddleware(Controller, key);
74
+ ret[key][FULLPATH] = Controller.prototype.fullPath + '#' + Controller.name + '.' + key + '()';
75
+ }
76
+ }
77
+ proto = Object.getPrototypeOf(proto);
78
+ }
79
+ return ret;
80
+
81
+ function methodToMiddleware(Controller, key) {
82
+ return function classControllerMiddleware(...args) {
83
+ const controller = new Controller(this);
84
+ // if (!this.app.config.controller || !this.app.config.controller.supportParams) {
85
+ // args = [ this ];
86
+ // }
87
+ //args = [ this ];
88
+ return utils.callFn(controller[key], args, controller);
89
+ };
90
+ }
91
+ }
92
+
93
+ // wrap the method of the object, method can receive ctx as it's first argument
94
+ function wrapObject(obj, path, prefix) {
95
+ const keys = Object.keys(obj);
96
+ const ret = {};
97
+ for (const key of keys) {
98
+ if (is.function(obj[key])) {
99
+ const names = utility.getParamNames(obj[key]);
100
+ if (names[0] === 'next') {
101
+ throw new Error(`controller \`${prefix || ''}${key}\` should not use next as argument from file ${path}`);
102
+ }
103
+ ret[key] = functionToMiddleware(obj[key]);
104
+ ret[key][FULLPATH] = `${path}#${prefix || ''}${key}()`;
105
+ } else if (is.object(obj[key])) {
106
+ ret[key] = wrapObject(obj[key], path, `${prefix || ''}${key}.`);
107
+ }
108
+ }
109
+ return ret;
110
+
111
+ function functionToMiddleware(func) {
112
+ const objectControllerMiddleware = async function(...args) {
113
+ // if (!this.app.config.controller || !this.app.config.controller.supportParams) {
114
+ // args = [ this ];
115
+ // }
116
+ return await utils.callFn(func, args, this);
117
+ };
118
+ for (const key in func) {
119
+ objectControllerMiddleware[key] = func[key];
120
+ }
121
+ return objectControllerMiddleware;
122
+ }
123
+ }
@@ -1,29 +1,29 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
-
5
-
6
- module.exports = {
7
-
8
- /**
9
- * Load app/service
10
- * @function EeLoader#loadService
11
- * @param {Object} opt - LoaderOptions
12
- * @since 1.0.0
13
- */
14
- loadService(opt) {
15
- this.timing.start('Load Service');
16
- // 载入到 app.serviceClasses
17
- opt = Object.assign({
18
- call: true,
19
- caseStyle: 'lower',
20
- fieldClass: 'serviceClasses',
21
- directory: this.getLoadUnits().map(unit => path.join(unit.path, 'service')), // this.getLoadUnits().map(unit => path.join(unit.path, 'app/service'))
22
- }, opt);
23
-
24
- const servicePaths = opt.directory;
25
- this.loadToContext(servicePaths, 'service', opt);
26
- this.timing.end('Load Service');
27
- },
28
-
29
- };
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+
6
+ module.exports = {
7
+
8
+ /**
9
+ * Load app/service
10
+ * @function EeLoader#loadService
11
+ * @param {Object} opt - LoaderOptions
12
+ * @since 1.0.0
13
+ */
14
+ loadService(opt) {
15
+ this.timing.start('Load Service');
16
+ // 载入到 app.serviceClasses
17
+ opt = Object.assign({
18
+ call: true,
19
+ caseStyle: 'lower',
20
+ fieldClass: 'serviceClasses',
21
+ directory: this.getLoadUnits().map(unit => path.join(unit.path, 'service')), // this.getLoadUnits().map(unit => path.join(unit.path, 'app/service'))
22
+ }, opt);
23
+
24
+ const servicePaths = opt.directory;
25
+ this.loadToContext(servicePaths, 'service', opt);
26
+ this.timing.end('Load Service');
27
+ },
28
+
29
+ };
@@ -1,34 +1,34 @@
1
- 'use strict';
2
-
3
- /**
4
- * BaseContextClass is a base class that can be extended,
5
- * it's instantiated in context level,
6
- * {@link Helper}, {@link Service} is extending it.
7
- */
8
- class BaseContextClass {
9
-
10
- /**
11
- * @class
12
- * @param {Context} ctx - context instance
13
- * @since 1.0.0
14
- */
15
- constructor(ctx) {
16
- /**
17
- * @member {Application} BaseContextClass#app
18
- * @since 1.0.0
19
- */
20
- this.app = ctx;
21
- /**
22
- * @member {Config} BaseContextClass#config
23
- * @since 1.0.0
24
- */
25
- this.config = ctx.config;
26
- /**
27
- * @member {Service} BaseContextClass#service
28
- * @since 1.0.0
29
- */
30
- this.service = ctx.service;
31
- }
32
- }
33
-
34
- module.exports = BaseContextClass;
1
+ 'use strict';
2
+
3
+ /**
4
+ * BaseContextClass is a base class that can be extended,
5
+ * it's instantiated in context level,
6
+ * {@link Helper}, {@link Service} is extending it.
7
+ */
8
+ class BaseContextClass {
9
+
10
+ /**
11
+ * @class
12
+ * @param {Context} ctx - context instance
13
+ * @since 1.0.0
14
+ */
15
+ constructor(ctx) {
16
+ /**
17
+ * @member {Application} BaseContextClass#app
18
+ * @since 1.0.0
19
+ */
20
+ this.app = ctx;
21
+ /**
22
+ * @member {Config} BaseContextClass#config
23
+ * @since 1.0.0
24
+ */
25
+ this.config = ctx.config;
26
+ /**
27
+ * @member {Service} BaseContextClass#service
28
+ * @since 1.0.0
29
+ */
30
+ this.service = ctx.service;
31
+ }
32
+ }
33
+
34
+ module.exports = BaseContextClass;