evaengine 0.11.2 → 1.0.0
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/.ai/analysis.md +657 -0
- package/.ai/architecture/runtime.md +504 -0
- package/.ai/contracts/public-api.md +447 -0
- package/.ai/external-project-guide.md +248 -0
- package/.ai/vision.md +314 -0
- package/README.md +51 -62
- package/bin/engine +15 -21
- package/index.js +2 -18
- package/package.json +60 -64
- package/src/index.js +57 -0
- package/bin/engine-babel +0 -38
- package/lib/commands/index.js +0 -25
- package/lib/commands/index.js.map +0 -1
- package/lib/commands/interface.js +0 -51
- package/lib/commands/interface.js.map +0 -1
- package/lib/commands/make_entity.js +0 -549
- package/lib/commands/make_entity.js.map +0 -1
- package/lib/commands/tramp.js +0 -53
- package/lib/commands/tramp.js.map +0 -1
- package/lib/config/index.js +0 -98
- package/lib/config/index.js.map +0 -1
- package/lib/di.js +0 -99
- package/lib/di.js.map +0 -1
- package/lib/engine.js +0 -558
- package/lib/engine.js.map +0 -1
- package/lib/entities/index.js +0 -283
- package/lib/entities/index.js.map +0 -1
- package/lib/exceptions/index.js +0 -522
- package/lib/exceptions/index.js.map +0 -1
- package/lib/index.js +0 -105
- package/lib/index.js.map +0 -1
- package/lib/middlewares/auth.js +0 -97
- package/lib/middlewares/auth.js.map +0 -1
- package/lib/middlewares/auth_kong.js +0 -48
- package/lib/middlewares/auth_kong.js.map +0 -1
- package/lib/middlewares/debug.js +0 -68
- package/lib/middlewares/debug.js.map +0 -1
- package/lib/middlewares/index.js +0 -45
- package/lib/middlewares/index.js.map +0 -1
- package/lib/middlewares/providers.js +0 -102
- package/lib/middlewares/providers.js.map +0 -1
- package/lib/middlewares/session.js +0 -76
- package/lib/middlewares/session.js.map +0 -1
- package/lib/middlewares/trace.js +0 -241
- package/lib/middlewares/trace.js.map +0 -1
- package/lib/middlewares/validator.js +0 -71
- package/lib/middlewares/validator.js.map +0 -1
- package/lib/middlewares/view_cache.js +0 -160
- package/lib/middlewares/view_cache.js.map +0 -1
- package/lib/services/cache.js +0 -234
- package/lib/services/cache.js.map +0 -1
- package/lib/services/config.js +0 -140
- package/lib/services/config.js.map +0 -1
- package/lib/services/env.js +0 -40
- package/lib/services/env.js.map +0 -1
- package/lib/services/event_manager.js +0 -110
- package/lib/services/event_manager.js.map +0 -1
- package/lib/services/http_client.js +0 -178
- package/lib/services/http_client.js.map +0 -1
- package/lib/services/index.js +0 -70
- package/lib/services/index.js.map +0 -1
- package/lib/services/interface.js +0 -12
- package/lib/services/interface.js.map +0 -1
- package/lib/services/joi.js +0 -28
- package/lib/services/joi.js.map +0 -1
- package/lib/services/jwt_token.js +0 -120
- package/lib/services/jwt_token.js.map +0 -1
- package/lib/services/jwt_token_kong.js +0 -111
- package/lib/services/jwt_token_kong.js.map +0 -1
- package/lib/services/logger.js +0 -172
- package/lib/services/logger.js.map +0 -1
- package/lib/services/namespace.js +0 -188
- package/lib/services/namespace.js.map +0 -1
- package/lib/services/now.js +0 -69
- package/lib/services/now.js.map +0 -1
- package/lib/services/providers.js +0 -195
- package/lib/services/providers.js.map +0 -1
- package/lib/services/redis.js +0 -77
- package/lib/services/redis.js.map +0 -1
- package/lib/services/rest_client.js +0 -136
- package/lib/services/rest_client.js.map +0 -1
- package/lib/swagger/index.js +0 -684
- package/lib/swagger/index.js.map +0 -1
- package/lib/utils/api_scaffold.js +0 -253
- package/lib/utils/api_scaffold.js.map +0 -1
- package/lib/utils/case_converter.js +0 -48
- package/lib/utils/case_converter.js.map +0 -1
- package/lib/utils/crc32.js +0 -22
- package/lib/utils/crc32.js.map +0 -1
- package/lib/utils/datetime.js +0 -21
- package/lib/utils/datetime.js.map +0 -1
- package/lib/utils/host.js +0 -48
- package/lib/utils/host.js.map +0 -1
- package/lib/utils/index.js +0 -61
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/pagination.js +0 -269
- package/lib/utils/pagination.js.map +0 -1
- package/lib/utils/random.js +0 -33
- package/lib/utils/random.js.map +0 -1
- package/lib/utils/smart_query.js +0 -342
- package/lib/utils/smart_query.js.map +0 -1
- package/lib/utils/test.js +0 -62
- package/lib/utils/test.js.map +0 -1
- package/lib/utils/wrapper.js +0 -9
- package/lib/utils/wrapper.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "evaengine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "EvaEngine for Node.js, a micro service development engine",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"package-lock": false,
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "https://github.com/EvaEngine/EvaEngine.js.git"
|
|
10
11
|
},
|
|
11
12
|
"scripts": {
|
|
12
|
-
"prestart": "
|
|
13
|
-
"prepublish": "
|
|
13
|
+
"prestart": "node src/index.js",
|
|
14
|
+
"prepublish": "npm run test",
|
|
14
15
|
"ava": "cross-env LOG_LEVEL=error NODE_ENV=test ava --verbose --serial",
|
|
15
16
|
"test": "nyc -a --reporter=lcov --reporter=text --reporter=html npm run ava",
|
|
16
|
-
"lint": "eslint src
|
|
17
|
-
"build": "
|
|
18
|
-
"
|
|
19
|
-
"semantic-release": "semantic-release"
|
|
17
|
+
"lint": "eslint src test index.js",
|
|
18
|
+
"build": "node --check src/index.js",
|
|
19
|
+
"ci:check": "npm run lint && npm run build",
|
|
20
|
+
"semantic-release": "semantic-release",
|
|
21
|
+
"release": "semantic-release"
|
|
20
22
|
},
|
|
21
23
|
"engines": {
|
|
22
|
-
"node": ">=
|
|
24
|
+
"node": ">=24.0.0"
|
|
23
25
|
},
|
|
24
26
|
"keywords": [
|
|
25
27
|
"es7",
|
|
@@ -28,10 +30,9 @@
|
|
|
28
30
|
"micro service",
|
|
29
31
|
"orm"
|
|
30
32
|
],
|
|
31
|
-
"main": "index.js",
|
|
33
|
+
"main": "src/index.js",
|
|
32
34
|
"bin": {
|
|
33
|
-
"engine": "./bin/engine"
|
|
34
|
-
"engine-babel": "./bin/engine-babel"
|
|
35
|
+
"engine": "./bin/engine"
|
|
35
36
|
},
|
|
36
37
|
"pre-commit": [
|
|
37
38
|
"lint"
|
|
@@ -50,11 +51,8 @@
|
|
|
50
51
|
"failFast": false,
|
|
51
52
|
"tap": false,
|
|
52
53
|
"require": [
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
"./test/bootstrap"
|
|
56
|
-
],
|
|
57
|
-
"babel": "inherit"
|
|
54
|
+
"./test/bootstrap.js"
|
|
55
|
+
]
|
|
58
56
|
},
|
|
59
57
|
"nyc": {
|
|
60
58
|
"require": [],
|
|
@@ -66,58 +64,56 @@
|
|
|
66
64
|
]
|
|
67
65
|
},
|
|
68
66
|
"dependencies": {
|
|
69
|
-
"acorn": "^
|
|
70
|
-
"app-root-path": "^
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"connect-redis": "^3.3.3",
|
|
67
|
+
"acorn": "^8.18.0",
|
|
68
|
+
"app-root-path": "^3.1.0",
|
|
69
|
+
"cloud-config-client": "^1.6.2",
|
|
70
|
+
"connect-redis": "^10.0.0",
|
|
74
71
|
"constitute": "^1.6.2",
|
|
75
72
|
"continuation-local-storage": "^3.2.1",
|
|
76
|
-
"doctrine": "^
|
|
77
|
-
"express": "^
|
|
78
|
-
"express-session": "^1.
|
|
79
|
-
"glob": "^
|
|
80
|
-
"ioredis": "^
|
|
81
|
-
"joi": "^
|
|
82
|
-
"js-yaml": "^
|
|
83
|
-
"jwt-simple": "^0.5.
|
|
73
|
+
"doctrine": "^3.0.0",
|
|
74
|
+
"express": "^5.2.1",
|
|
75
|
+
"express-session": "^1.19.0",
|
|
76
|
+
"glob": "^13.0.6",
|
|
77
|
+
"ioredis": "^5.11.1",
|
|
78
|
+
"joi": "^18.2.3",
|
|
79
|
+
"js-yaml": "^5.2.2",
|
|
80
|
+
"jwt-simple": "^0.5.6",
|
|
84
81
|
"later": "^1.2.0",
|
|
85
|
-
"lodash": "^4.
|
|
86
|
-
"mkdirp": "^0.
|
|
87
|
-
"moment": "^2.
|
|
88
|
-
"moment-timezone": "^0.
|
|
89
|
-
"morgan": "^1.
|
|
90
|
-
"mysql": "^2.
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"request
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
82
|
+
"lodash": "^4.18.1",
|
|
83
|
+
"mkdirp": "^3.0.1",
|
|
84
|
+
"moment": "^2.30.1",
|
|
85
|
+
"moment-timezone": "^0.6.3",
|
|
86
|
+
"morgan": "^1.11.0",
|
|
87
|
+
"mysql": "^2.18.1",
|
|
88
|
+
"mysql2": "^3.23.2",
|
|
89
|
+
"node-mocks-http": "~1.18.1",
|
|
90
|
+
"on-headers": "^1.1.0",
|
|
91
|
+
"pug": "^3.0.4",
|
|
92
|
+
"request": "^2.88.2",
|
|
93
|
+
"request-promise-native": "^1.0.9",
|
|
94
|
+
"sequelize": "^6.37.8",
|
|
95
|
+
"swagger-ui-dist": "^5.32.11",
|
|
96
|
+
"winston": "^3.19.0",
|
|
97
|
+
"yargs": "^18.1.0"
|
|
100
98
|
},
|
|
101
99
|
"devDependencies": {
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"eslint
|
|
113
|
-
"eslint-plugin-import": "^2.
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"semantic-release": "^15.1.5",
|
|
121
|
-
"travis-deploy-once": "^4.4.1"
|
|
100
|
+
"@eslint/js": "^9.39.5",
|
|
101
|
+
"@semantic-release/changelog": "^6.0.0",
|
|
102
|
+
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
103
|
+
"@semantic-release/git": "^10.0.0",
|
|
104
|
+
"@semantic-release/github": "^11.0.0",
|
|
105
|
+
"@semantic-release/npm": "^12.0.0",
|
|
106
|
+
"@semantic-release/release-notes-generator": "^14.0.0",
|
|
107
|
+
"ava": "^8.0.1",
|
|
108
|
+
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
109
|
+
"cross-env": "^10.1.0",
|
|
110
|
+
"eslint": "^9.39.5",
|
|
111
|
+
"eslint-plugin-import": "^2.32.0",
|
|
112
|
+
"globals": "^17.8.0",
|
|
113
|
+
"is-type-of": "^2.2.0",
|
|
114
|
+
"nock": "^14.0.17",
|
|
115
|
+
"nyc": "^18.0.0",
|
|
116
|
+
"pre-commit": "^2.0.0",
|
|
117
|
+
"semantic-release": "^25.0.8"
|
|
122
118
|
}
|
|
123
119
|
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import constitute from 'constitute';
|
|
2
|
+
import * as mysql from 'mysql';
|
|
3
|
+
import sequelize from 'sequelize';
|
|
4
|
+
import Joi from 'joi';
|
|
5
|
+
import EvaEngine, * as engine from './engine.js';
|
|
6
|
+
import * as swagger from './swagger/index.js';
|
|
7
|
+
import * as exceptions from './exceptions/index.js';
|
|
8
|
+
import * as services from './services/index.js';
|
|
9
|
+
import * as middlewares from './middlewares/index.js';
|
|
10
|
+
import * as ServiceProviders from './services/providers.js';
|
|
11
|
+
import * as MiddlewareProviders from './middlewares/providers.js';
|
|
12
|
+
import * as utils from './utils/index.js';
|
|
13
|
+
import Command, * as commands from './commands/index.js';
|
|
14
|
+
import Entities from './entities/index.js';
|
|
15
|
+
|
|
16
|
+
const providers = {
|
|
17
|
+
services: ServiceProviders,
|
|
18
|
+
middlewares: MiddlewareProviders
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const { wrapper } = utils;
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
DI,
|
|
25
|
+
express
|
|
26
|
+
} = engine;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @typedef {Object} engineCore
|
|
30
|
+
*/
|
|
31
|
+
const core = {
|
|
32
|
+
EvaEngine,
|
|
33
|
+
Command,
|
|
34
|
+
DI,
|
|
35
|
+
Entities,
|
|
36
|
+
engine,
|
|
37
|
+
express,
|
|
38
|
+
commands,
|
|
39
|
+
dependencies: {
|
|
40
|
+
Joi,
|
|
41
|
+
constitute,
|
|
42
|
+
sequelize,
|
|
43
|
+
mysql
|
|
44
|
+
},
|
|
45
|
+
exceptions,
|
|
46
|
+
middlewares,
|
|
47
|
+
sequelize,
|
|
48
|
+
Joi,
|
|
49
|
+
swagger,
|
|
50
|
+
services,
|
|
51
|
+
providers,
|
|
52
|
+
wrapper,
|
|
53
|
+
utils
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default core;
|
|
57
|
+
export { core };
|
package/bin/engine-babel
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env babel-node
|
|
2
|
-
const { EvaEngine, DI, exceptions, commands } = require('../');
|
|
3
|
-
const co = (fn) => { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; }
|
|
4
|
-
|
|
5
|
-
const engine = new EvaEngine({
|
|
6
|
-
projectRoot: process.cwd()
|
|
7
|
-
}, 'cli');
|
|
8
|
-
engine.registerCommands([
|
|
9
|
-
commands
|
|
10
|
-
]);
|
|
11
|
-
|
|
12
|
-
const logger = DI.get('logger');
|
|
13
|
-
co(function* () {
|
|
14
|
-
if (process.env.SPRING_CONFIG_ENDPOINT) {
|
|
15
|
-
const springOptions = {
|
|
16
|
-
endpoint: process.env.SPRING_CONFIG_ENDPOINT,
|
|
17
|
-
name: process.env.SPRING_CONFIG_NAME || 'unknown-spring-config-name',
|
|
18
|
-
profiles: process.env.SPRING_CONFIG_PROFILES || process.env.NODE_ENV,
|
|
19
|
-
label: process.env.SPRING_CONFIG_LABEL || 'master'
|
|
20
|
-
};
|
|
21
|
-
logger.info(`Loading configs from Spring Cloud Config, options:${JSON.stringify(springOptions)}`);
|
|
22
|
-
yield DI.get('config').resolveSpringConfig(springOptions);
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
yield engine.runCLI();
|
|
26
|
-
} catch (e) {
|
|
27
|
-
if (e instanceof exceptions.StandardException) {
|
|
28
|
-
logger.warn(e.getDetails());
|
|
29
|
-
return logger.warn(e.message);
|
|
30
|
-
}
|
|
31
|
-
logger.error(e);
|
|
32
|
-
}
|
|
33
|
-
const redis = DI.get('redis');
|
|
34
|
-
if (redis.isConnected()) {
|
|
35
|
-
redis.cleanup();
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
})();
|
package/lib/commands/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TrampConfig = exports.MakeGraphql = exports.MakeDbView = exports.MakeEntity = undefined;
|
|
7
|
-
|
|
8
|
-
var _interface = require('./interface');
|
|
9
|
-
|
|
10
|
-
var _interface2 = _interopRequireDefault(_interface);
|
|
11
|
-
|
|
12
|
-
var _make_entity = require('./make_entity');
|
|
13
|
-
|
|
14
|
-
var _tramp = require('./tramp');
|
|
15
|
-
|
|
16
|
-
var _tramp2 = _interopRequireDefault(_tramp);
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
exports.default = _interface2.default;
|
|
21
|
-
exports.MakeEntity = _make_entity.MakeEntity;
|
|
22
|
-
exports.MakeDbView = _make_entity.MakeDbView;
|
|
23
|
-
exports.MakeGraphql = _make_entity.MakeGraphql;
|
|
24
|
-
exports.TrampConfig = _tramp2.default;
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/index.js"],"names":["Command","MakeEntity","MakeDbView","MakeGraphql","TrampConfig"],"mappings":";;;;;;;AAAA;;;;AACA;;AACA;;;;;;kBAEeA,mB;QAGbC,U,GAAAA,uB;QACAC,U,GAAAA,uB;QACAC,W,GAAAA,wB;QACAC,W,GAAAA,e","file":"index.js","sourcesContent":["import Command from './interface';\nimport { MakeEntity, MakeDbView, MakeGraphql } from './make_entity';\nimport TrampConfig from './tramp';\n\nexport default Command;\n\nexport {\n MakeEntity,\n MakeDbView,\n MakeGraphql,\n TrampConfig\n};\n"]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
let Command = class Command {
|
|
7
|
-
constructor(argv) {
|
|
8
|
-
this.argv = argv;
|
|
9
|
-
this.options = null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
getArgv() {
|
|
13
|
-
return this.argv;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
setArgv(argv) {
|
|
17
|
-
this.argv = argv;
|
|
18
|
-
return this;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
setOptions(options) {
|
|
22
|
-
this.options = options;
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getOptions() {
|
|
27
|
-
const options = {};
|
|
28
|
-
Object.keys(this.argv).forEach(key => {
|
|
29
|
-
if (key !== '$0' && ['string', 'number'].includes(typeof this.argv[key])) {
|
|
30
|
-
options[key] = this.argv[key];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return options;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static getName() {
|
|
37
|
-
return '';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static getDescription() {
|
|
41
|
-
return '';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static getSpec() {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
run() {}
|
|
49
|
-
};
|
|
50
|
-
exports.default = Command;
|
|
51
|
-
//# sourceMappingURL=interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/interface.js"],"names":["Command","constructor","argv","options","getArgv","setArgv","setOptions","getOptions","Object","keys","forEach","key","includes","getName","getDescription","getSpec","run"],"mappings":";;;;;IAAqBA,O,GAAN,MAAMA,OAAN,CAAc;AAC3BC,cAAYC,IAAZ,EAAkB;AAChB,SAAKA,IAAL,GAAYA,IAAZ;AACA,SAAKC,OAAL,GAAe,IAAf;AACD;;AAEDC,YAAU;AACR,WAAO,KAAKF,IAAZ;AACD;;AAEDG,UAAQH,IAAR,EAAc;AACZ,SAAKA,IAAL,GAAYA,IAAZ;AACA,WAAO,IAAP;AACD;;AAEDI,aAAWH,OAAX,EAAoB;AAClB,SAAKA,OAAL,GAAeA,OAAf;AACA,WAAO,IAAP;AACD;;AAEDI,eAAa;AACX,UAAMJ,UAAU,EAAhB;AACAK,WAAOC,IAAP,CAAY,KAAKP,IAAjB,EAAuBQ,OAAvB,CAAgCC,GAAD,IAAS;AACtC,UAAIA,QAAQ,IAAR,IAAgB,CAAC,QAAD,EAAW,QAAX,EAAqBC,QAArB,CAA8B,OAAO,KAAKV,IAAL,CAAUS,GAAV,CAArC,CAApB,EAA0E;AACxER,gBAAQQ,GAAR,IAAe,KAAKT,IAAL,CAAUS,GAAV,CAAf;AACD;AACF,KAJD;AAKA,WAAOR,OAAP;AACD;;AAED,SAAOU,OAAP,GAAiB;AACf,WAAO,EAAP;AACD;;AAED,SAAOC,cAAP,GAAwB;AACtB,WAAO,EAAP;AACD;;AAED,SAAOC,OAAP,GAAiB;AACf,WAAO,EAAP;AACD;;AAEDC,QAAM,CACL;AA3C0B,C;kBAARhB,O","file":"interface.js","sourcesContent":["export default class Command {\n constructor(argv) {\n this.argv = argv;\n this.options = null;\n }\n\n getArgv() {\n return this.argv;\n }\n\n setArgv(argv) {\n this.argv = argv;\n return this;\n }\n\n setOptions(options) {\n this.options = options;\n return this;\n }\n\n getOptions() {\n const options = {};\n Object.keys(this.argv).forEach((key) => {\n if (key !== '$0' && ['string', 'number'].includes(typeof this.argv[key])) {\n options[key] = this.argv[key];\n }\n });\n return options;\n }\n\n static getName() {\n return '';\n }\n\n static getDescription() {\n return '';\n }\n\n static getSpec() {\n return {};\n }\n\n run() {\n }\n}\n"]}
|