nsgm-cli 2.0.6 → 2.0.7
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/LICENSE +201 -201
- package/README.md +161 -161
- package/client/layout/index.tsx +248 -245
- package/client/redux/reducers.ts +4 -4
- package/client/redux/store.ts +50 -50
- package/client/redux/template/manage/actions.ts +190 -190
- package/client/redux/template/manage/reducers.ts +118 -118
- package/client/redux/template/manage/types.ts +24 -24
- package/client/service/template/manage.ts +96 -96
- package/client/styled/common.ts +30 -26
- package/client/styled/layout/index.ts +25 -25
- package/client/styled/template/manage.ts +51 -51
- package/client/utils/common.ts +89 -86
- package/client/utils/cookie.ts +51 -51
- package/client/utils/fetch.ts +25 -25
- package/client/utils/menu.tsx +27 -27
- package/client/utils/sso.ts +205 -0
- package/generation/README.md +19 -19
- package/generation/app.js +2 -2
- package/generation/client/redux/reducers.ts +4 -4
- package/generation/client/utils/menu.tsx +27 -27
- package/generation/gitignore +4 -4
- package/generation/mysql.config.js +12 -13
- package/generation/next.config.js +6 -6
- package/generation/package.json +21 -26
- package/generation/project.config.js +13 -12
- package/generation/server/rest.js +23 -20
- package/generation/tsconfig.json +30 -30
- package/index.js +10 -10
- package/lib/args.d.ts +6 -6
- package/lib/args.js +53 -53
- package/lib/generate.d.ts +3 -3
- package/lib/generate.js +751 -736
- package/lib/index.d.ts +2 -2
- package/lib/index.js +272 -272
- package/lib/server/db.d.ts +5 -5
- package/lib/server/db.js +110 -110
- package/lib/server/graphql.d.ts +7 -7
- package/lib/server/graphql.js +119 -119
- package/lib/server/plugins/date.d.ts +5 -5
- package/lib/server/plugins/date.js +16 -16
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/mysql.config.js +14 -14
- package/next-env.d.ts +6 -6
- package/next.config.js +2 -2
- package/package.json +126 -126
- package/pages/_app.tsx +54 -44
- package/pages/login.tsx +65 -0
- package/pages/template/manage.tsx +278 -278
- package/project.config.js +16 -14
- package/public/slbhealthcheck.html +9 -9
- package/scripts/shutdown.sh +9 -9
- package/scripts/startup.sh +34 -34
- package/server/apis/sso.js +44 -0
- package/server/apis/template.js +17 -17
- package/server/modules/template/schema.js +33 -33
- package/server/rest.js +24 -20
- package/server/sql/template.sql +8 -8
- package/generation/.DS_Store +0 -0
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
const express = require('express')
|
|
2
|
-
const moment = require('moment')
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
const express = require('express')
|
|
2
|
+
const moment = require('moment')
|
|
3
|
+
const sso = require('./apis/sso')
|
|
4
|
+
//const template = require('./apis/template')
|
|
5
|
+
|
|
6
|
+
const router = express.Router()
|
|
7
|
+
|
|
8
|
+
router.use((req, res, next) => {
|
|
9
|
+
const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl
|
|
10
|
+
console.log(moment().format('YYYY-MM-DD HH:mm:ss') + ' ' + fullUrl)
|
|
11
|
+
next()
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
router.use('/sso', sso)
|
|
15
|
+
|
|
16
|
+
//router.use('/template', template)
|
|
17
|
+
|
|
18
|
+
router.get('/*', (req, res) => {
|
|
19
|
+
res.statusCode = 200
|
|
20
|
+
res.json({ name: 'REST' })
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
module.exports = router
|
package/generation/tsconfig.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
|
-
"lib": [
|
|
5
|
-
"dom",
|
|
6
|
-
"dom.iterable",
|
|
7
|
-
"esnext"
|
|
8
|
-
],
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"strict": false,
|
|
12
|
-
"forceConsistentCasingInFileNames": true,
|
|
13
|
-
"noEmit": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"module": "esnext",
|
|
16
|
-
"moduleResolution": "node",
|
|
17
|
-
"resolveJsonModule": true,
|
|
18
|
-
"isolatedModules": true,
|
|
19
|
-
"jsx": "preserve",
|
|
20
|
-
"incremental": true
|
|
21
|
-
},
|
|
22
|
-
"include": [
|
|
23
|
-
"next-env.d.ts",
|
|
24
|
-
"**/*.ts",
|
|
25
|
-
"**/*.tsx"
|
|
26
|
-
],
|
|
27
|
-
"exclude": [
|
|
28
|
-
"node_modules"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"strict": false,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"module": "esnext",
|
|
16
|
+
"moduleResolution": "node",
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"isolatedModules": true,
|
|
19
|
+
"jsx": "preserve",
|
|
20
|
+
"incremental": true
|
|
21
|
+
},
|
|
22
|
+
"include": [
|
|
23
|
+
"next-env.d.ts",
|
|
24
|
+
"**/*.ts",
|
|
25
|
+
"**/*.tsx"
|
|
26
|
+
],
|
|
27
|
+
"exclude": [
|
|
28
|
+
"node_modules"
|
|
29
|
+
]
|
|
30
|
+
}
|
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const nextConfig = require('./next.config')
|
|
2
|
-
const projectConfig = require('./project.config')
|
|
3
|
-
const mysqlConfig = require('./mysql.config')
|
|
4
|
-
const serverDB = require('./lib/server/db').default
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
nextConfig,
|
|
8
|
-
projectConfig,
|
|
9
|
-
mysqlConfig,
|
|
10
|
-
serverDB
|
|
1
|
+
const nextConfig = require('./next.config')
|
|
2
|
+
const projectConfig = require('./project.config')
|
|
3
|
+
const mysqlConfig = require('./mysql.config')
|
|
4
|
+
const serverDB = require('./lib/server/db').default
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
nextConfig,
|
|
8
|
+
projectConfig,
|
|
9
|
+
mysqlConfig,
|
|
10
|
+
serverDB
|
|
11
11
|
}
|
package/lib/args.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const getProcessArgvs: (removeItems?: number) => {
|
|
2
|
-
command: string;
|
|
3
|
-
dictionary: string;
|
|
4
|
-
controller: string;
|
|
5
|
-
action: string;
|
|
6
|
-
};
|
|
1
|
+
export declare const getProcessArgvs: (removeItems?: number) => {
|
|
2
|
+
command: string;
|
|
3
|
+
dictionary: string;
|
|
4
|
+
controller: string;
|
|
5
|
+
action: string;
|
|
6
|
+
};
|
package/lib/args.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getProcessArgvs = void 0;
|
|
7
|
-
var lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
var getProcessArgvs = function (removeItems) {
|
|
9
|
-
if (removeItems === void 0) { removeItems = 2; }
|
|
10
|
-
var args = process.argv.slice(removeItems);
|
|
11
|
-
var result = {
|
|
12
|
-
command: '',
|
|
13
|
-
dictionary: '',
|
|
14
|
-
controller: '',
|
|
15
|
-
action: '' // create/delete controller=${controller} action=${action}
|
|
16
|
-
};
|
|
17
|
-
lodash_1.default.each(args, function (item, index) {
|
|
18
|
-
if (item.indexOf('=') !== -1) {
|
|
19
|
-
var itemArr = item.split('=');
|
|
20
|
-
var key = itemArr[0].toLowerCase();
|
|
21
|
-
result[key] = itemArr[1];
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
var command = result.command;
|
|
25
|
-
switch (index) {
|
|
26
|
-
case 0:
|
|
27
|
-
result.command = item;
|
|
28
|
-
break;
|
|
29
|
-
case 1:
|
|
30
|
-
if (command === 'create' ||
|
|
31
|
-
command === '-c' ||
|
|
32
|
-
command.indexOf('delete') !== -1 ||
|
|
33
|
-
command.indexOf('-d') !== -1) {
|
|
34
|
-
result.controller = item;
|
|
35
|
-
}
|
|
36
|
-
if (command === 'export' || command === 'init' || command === '-i') {
|
|
37
|
-
result.dictionary = item;
|
|
38
|
-
}
|
|
39
|
-
break;
|
|
40
|
-
case 2:
|
|
41
|
-
if (command === 'create' ||
|
|
42
|
-
command === '-c' ||
|
|
43
|
-
command.indexOf('delete') !== -1 ||
|
|
44
|
-
command.indexOf('-d') !== -1) {
|
|
45
|
-
result.action = item;
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return result;
|
|
52
|
-
};
|
|
53
|
-
exports.getProcessArgvs = getProcessArgvs;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getProcessArgvs = void 0;
|
|
7
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
var getProcessArgvs = function (removeItems) {
|
|
9
|
+
if (removeItems === void 0) { removeItems = 2; }
|
|
10
|
+
var args = process.argv.slice(removeItems);
|
|
11
|
+
var result = {
|
|
12
|
+
command: '',
|
|
13
|
+
dictionary: '',
|
|
14
|
+
controller: '',
|
|
15
|
+
action: '' // create/delete controller=${controller} action=${action}
|
|
16
|
+
};
|
|
17
|
+
lodash_1.default.each(args, function (item, index) {
|
|
18
|
+
if (item.indexOf('=') !== -1) {
|
|
19
|
+
var itemArr = item.split('=');
|
|
20
|
+
var key = itemArr[0].toLowerCase();
|
|
21
|
+
result[key] = itemArr[1];
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
var command = result.command;
|
|
25
|
+
switch (index) {
|
|
26
|
+
case 0:
|
|
27
|
+
result.command = item;
|
|
28
|
+
break;
|
|
29
|
+
case 1:
|
|
30
|
+
if (command === 'create' ||
|
|
31
|
+
command === '-c' ||
|
|
32
|
+
command.indexOf('delete') !== -1 ||
|
|
33
|
+
command.indexOf('-d') !== -1) {
|
|
34
|
+
result.controller = item;
|
|
35
|
+
}
|
|
36
|
+
if (command === 'export' || command === 'init' || command === '-i') {
|
|
37
|
+
result.dictionary = item;
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
case 2:
|
|
41
|
+
if (command === 'create' ||
|
|
42
|
+
command === '-c' ||
|
|
43
|
+
command.indexOf('delete') !== -1 ||
|
|
44
|
+
command.indexOf('-d') !== -1) {
|
|
45
|
+
result.action = item;
|
|
46
|
+
}
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
exports.getProcessArgvs = getProcessArgvs;
|
package/lib/generate.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const initFiles: (dictionary: string, upgradeFlag?: boolean) => void;
|
|
2
|
-
export declare const createFiles: (controller: string, action: string) => void;
|
|
3
|
-
export declare const deleteFiles: (controller: string, action: string, deleteDBFlag?: boolean) => void;
|
|
1
|
+
export declare const initFiles: (dictionary: string, upgradeFlag?: boolean) => void;
|
|
2
|
+
export declare const createFiles: (controller: string, action: string) => void;
|
|
3
|
+
export declare const deleteFiles: (controller: string, action: string, deleteDBFlag?: boolean) => void;
|