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.
Files changed (59) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +161 -161
  3. package/client/layout/index.tsx +248 -245
  4. package/client/redux/reducers.ts +4 -4
  5. package/client/redux/store.ts +50 -50
  6. package/client/redux/template/manage/actions.ts +190 -190
  7. package/client/redux/template/manage/reducers.ts +118 -118
  8. package/client/redux/template/manage/types.ts +24 -24
  9. package/client/service/template/manage.ts +96 -96
  10. package/client/styled/common.ts +30 -26
  11. package/client/styled/layout/index.ts +25 -25
  12. package/client/styled/template/manage.ts +51 -51
  13. package/client/utils/common.ts +89 -86
  14. package/client/utils/cookie.ts +51 -51
  15. package/client/utils/fetch.ts +25 -25
  16. package/client/utils/menu.tsx +27 -27
  17. package/client/utils/sso.ts +205 -0
  18. package/generation/README.md +19 -19
  19. package/generation/app.js +2 -2
  20. package/generation/client/redux/reducers.ts +4 -4
  21. package/generation/client/utils/menu.tsx +27 -27
  22. package/generation/gitignore +4 -4
  23. package/generation/mysql.config.js +12 -13
  24. package/generation/next.config.js +6 -6
  25. package/generation/package.json +21 -26
  26. package/generation/project.config.js +13 -12
  27. package/generation/server/rest.js +23 -20
  28. package/generation/tsconfig.json +30 -30
  29. package/index.js +10 -10
  30. package/lib/args.d.ts +6 -6
  31. package/lib/args.js +53 -53
  32. package/lib/generate.d.ts +3 -3
  33. package/lib/generate.js +751 -736
  34. package/lib/index.d.ts +2 -2
  35. package/lib/index.js +272 -272
  36. package/lib/server/db.d.ts +5 -5
  37. package/lib/server/db.js +110 -110
  38. package/lib/server/graphql.d.ts +7 -7
  39. package/lib/server/graphql.js +119 -119
  40. package/lib/server/plugins/date.d.ts +5 -5
  41. package/lib/server/plugins/date.js +16 -16
  42. package/lib/tsconfig.build.tsbuildinfo +1 -1
  43. package/mysql.config.js +14 -14
  44. package/next-env.d.ts +6 -6
  45. package/next.config.js +2 -2
  46. package/package.json +126 -126
  47. package/pages/_app.tsx +54 -44
  48. package/pages/login.tsx +65 -0
  49. package/pages/template/manage.tsx +278 -278
  50. package/project.config.js +16 -14
  51. package/public/slbhealthcheck.html +9 -9
  52. package/scripts/shutdown.sh +9 -9
  53. package/scripts/startup.sh +34 -34
  54. package/server/apis/sso.js +44 -0
  55. package/server/apis/template.js +17 -17
  56. package/server/modules/template/schema.js +33 -33
  57. package/server/rest.js +24 -20
  58. package/server/sql/template.sql +8 -8
  59. package/generation/.DS_Store +0 -0
@@ -1,20 +1,23 @@
1
- const express = require('express')
2
- const moment = require('moment')
3
- //const template = require('./apis/template')
4
-
5
- const router = express.Router()
6
-
7
- router.use((req, res, next) => {
8
- const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl
9
- console.log(moment().format('YYYY-MM-DD HH:mm:ss') + ' ' + fullUrl)
10
- next()
11
- })
12
-
13
- //router.use('/template', template)
14
-
15
- router.get('/*', (req, res) => {
16
- res.statusCode = 200
17
- res.json({ name: 'REST' })
18
- })
19
-
20
- module.exports = router
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
@@ -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;