@simitgroup/simpleapp-generator 1.6.6-o-alpha → 1.6.6-q-alpha

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 (101) hide show
  1. package/dist/buildinschemas/autoincreament.d.ts.map +1 -1
  2. package/dist/buildinschemas/autoincreament.js +17 -14
  3. package/dist/buildinschemas/autoincreament.js.map +1 -1
  4. package/dist/buildinschemas/branch.d.ts.map +1 -1
  5. package/dist/buildinschemas/branch.js +25 -24
  6. package/dist/buildinschemas/branch.js.map +1 -1
  7. package/dist/buildinschemas/changehistories.d.ts.map +1 -1
  8. package/dist/buildinschemas/changehistories.js +10 -9
  9. package/dist/buildinschemas/changehistories.js.map +1 -1
  10. package/dist/buildinschemas/customfield.d.ts.map +1 -1
  11. package/dist/buildinschemas/customfield.js +16 -15
  12. package/dist/buildinschemas/customfield.js.map +1 -1
  13. package/dist/buildinschemas/docnoformat.d.ts.map +1 -1
  14. package/dist/buildinschemas/docnoformat.js +34 -23
  15. package/dist/buildinschemas/docnoformat.js.map +1 -1
  16. package/dist/buildinschemas/documentevent.d.ts.map +1 -1
  17. package/dist/buildinschemas/documentevent.js +36 -26
  18. package/dist/buildinschemas/documentevent.js.map +1 -1
  19. package/dist/buildinschemas/keyvaluepair.d.ts.map +1 -1
  20. package/dist/buildinschemas/keyvaluepair.js +7 -6
  21. package/dist/buildinschemas/keyvaluepair.js.map +1 -1
  22. package/dist/buildinschemas/organization.d.ts.map +1 -1
  23. package/dist/buildinschemas/organization.js +34 -30
  24. package/dist/buildinschemas/organization.js.map +1 -1
  25. package/dist/buildinschemas/permission.d.ts.map +1 -1
  26. package/dist/buildinschemas/permission.js +16 -7
  27. package/dist/buildinschemas/permission.js.map +1 -1
  28. package/dist/buildinschemas/systemmessage.d.ts.map +1 -1
  29. package/dist/buildinschemas/systemmessage.js +35 -32
  30. package/dist/buildinschemas/systemmessage.js.map +1 -1
  31. package/dist/buildinschemas/tenant.d.ts.map +1 -1
  32. package/dist/buildinschemas/tenant.js +17 -16
  33. package/dist/buildinschemas/tenant.js.map +1 -1
  34. package/dist/buildinschemas/user.d.ts.map +1 -1
  35. package/dist/buildinschemas/user.js +34 -31
  36. package/dist/buildinschemas/user.js.map +1 -1
  37. package/dist/buildinschemas/webhook.d.ts.map +1 -1
  38. package/dist/buildinschemas/webhook.js +24 -23
  39. package/dist/buildinschemas/webhook.js.map +1 -1
  40. package/dist/framework.d.ts +2 -0
  41. package/dist/framework.d.ts.map +1 -1
  42. package/dist/framework.js +92 -57
  43. package/dist/framework.js.map +1 -1
  44. package/dist/generate.d.ts.map +1 -1
  45. package/dist/generate.js +175 -34
  46. package/dist/generate.js.map +1 -1
  47. package/dist/index.js +30 -12
  48. package/dist/index.js.map +1 -1
  49. package/dist/processors/jsonschemabuilder.js +14 -12
  50. package/dist/processors/jsonschemabuilder.js.map +1 -1
  51. package/dist/type.d.ts +44 -5
  52. package/dist/type.d.ts.map +1 -1
  53. package/dist/type.js.map +1 -1
  54. package/package.json +1 -1
  55. package/src/buildinschemas/autoincreament.ts +35 -33
  56. package/src/buildinschemas/branch.ts +47 -47
  57. package/src/buildinschemas/changehistories.ts +31 -30
  58. package/src/buildinschemas/customfield.ts +17 -16
  59. package/src/buildinschemas/docnoformat.ts +54 -43
  60. package/src/buildinschemas/documentevent.ts +42 -33
  61. package/src/buildinschemas/keyvaluepair.ts +25 -25
  62. package/src/buildinschemas/organization.ts +54 -50
  63. package/src/buildinschemas/permission.ts +34 -25
  64. package/src/buildinschemas/systemmessage.ts +39 -38
  65. package/src/buildinschemas/tenant.ts +46 -45
  66. package/src/buildinschemas/user.ts +64 -60
  67. package/src/buildinschemas/webhook.ts +62 -61
  68. package/src/framework.ts +307 -251
  69. package/src/generate.ts +608 -434
  70. package/src/index.ts +136 -118
  71. package/src/processors/jsonschemabuilder.ts +6 -4
  72. package/src/type.ts +287 -226
  73. package/templates/basic/miniAppJsSdk/resource-bridge.service.ts.eta +119 -0
  74. package/templates/basic/miniAppStreamlitSdk/resource-bridge.service.ts.eta +228 -0
  75. package/templates/basic/nuxt/jsonschema.ts.eta +7 -0
  76. package/templates/basic/nuxt/resource-bridge.editable.service.ts.eta +40 -0
  77. package/templates/basic/nuxt/resource-bridge.service.ts.eta +165 -0
  78. package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +27 -9
  79. package/templates/miniAppJsSdk/src/index.ts.eta +28 -0
  80. package/templates/miniAppJsSdk/src/services/bridge-resource-accessor.service.ts.eta +70 -0
  81. package/templates/miniAppJsSdk/src/services/bridge.service.ts.eta +91 -0
  82. package/templates/miniAppJsSdk/src/types/service.type.ts.eta +22 -0
  83. package/templates/miniAppStreamlitSdk/simtrain_eco_mini_app_streamlit_sdk/sdk.py.eta +76 -0
  84. package/templates/nest/src/simpleapp/generate/jsonschemas/index.ts.eta +11 -0
  85. package/templates/nest/src/simpleapp/types/customfield.ts.eta +14 -0
  86. package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +3 -3
  87. package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +0 -1
  88. package/templates/nuxt/plugins/18.simpleapp-custom-field-store.ts.eta +9 -3
  89. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +316 -341
  90. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +32 -21
  91. package/templates/nuxt/simpleapp/generate/jsonSchemas/index.ts.eta +11 -0
  92. package/templates/nuxt/simpleapp/generate/miniApp/bridge/constants/common.constant.ts.eta +16 -0
  93. package/templates/nuxt/simpleapp/generate/miniApp/bridge/constants/resource.constant.ts.eta +46 -0
  94. package/templates/nuxt/simpleapp/generate/miniApp/bridge/services/bridge-resource-accessor.service.ts.eta +63 -0
  95. package/templates/nuxt/simpleapp/generate/miniApp/bridge/services/bridge.service.ts.eta +129 -0
  96. package/templates/nuxt/simpleapp/generate/miniApp/bridge/types/bridge.type.ts.eta +81 -0
  97. package/templates/nuxt/simpleapp/generate/miniApp/bridge/types/resource-mapper.type.ts.eta +55 -0
  98. package/templates/nuxt/types/others.ts.eta +74 -65
  99. package/templates/nuxt/types/schema.ts.eta +225 -188
  100. package/templates/project/build.sh.eta +4 -0
  101. package/templates/nuxt/simpleapp/generate/clients/SimpleAppCustomFieldClient.ts.eta +0 -191
package/src/index.ts CHANGED
@@ -1,149 +1,167 @@
1
1
  #! /usr/bin/env node
2
- import { error } from "console"
3
- import * as fw from './framework'
4
- import * as generate from './generate'
5
- import { chmod } from "fs"
6
- const program = require("commander") // add this line
7
- const Fieldtypes= require( './type')
2
+ import { error } from 'console';
3
+ import * as fw from './framework';
4
+ import * as generate from './generate';
5
+ import { chmod } from 'fs';
6
+ const program = require('commander'); // add this line
7
+ const Fieldtypes = require('./type');
8
8
  // const generate= require( './generate')
9
9
 
10
- const fs = require( 'fs')
10
+ const fs = require('fs');
11
11
  // const createproject =require( './createproject')
12
- const ps = require( "child_process")
13
- const capitalizeFirstLetter= require( './libs')
14
- const {Logger, ILogObj} = require( "tslog");
12
+ const ps = require('child_process');
13
+ const capitalizeFirstLetter = require('./libs');
14
+ const { Logger, ILogObj } = require('tslog');
15
15
 
16
- const log :typeof Logger= new Logger();
16
+ const log: typeof Logger = new Logger();
17
17
 
18
- const figlet = require("figlet");
18
+ const figlet = require('figlet');
19
19
  // const program = new Command();
20
- const pj = require('../package.json')
20
+ const pj = require('../package.json');
21
21
 
22
- let version=pj.version
22
+ let version = pj.version;
23
23
  program
24
24
  .version(version)
25
- .description("An simpleapp CLI tool for generate frontend (vuejs) and backend(nestjs) codes")
26
- .option("-c, --config-file <value>", 'configuration file')
27
- .option("-g, --generate-type <value>", 'generate type init, backend, frontend')
25
+ .description(
26
+ 'An simpleapp CLI tool for generate frontend (vuejs) and backend(nestjs) codes'
27
+ )
28
+ .option('-c, --config-file <value>', 'configuration file')
29
+ .option(
30
+ '-g, --generate-type <value>',
31
+ 'generate type init, backend, frontend'
32
+ )
28
33
  .parse(process.argv);
29
34
 
30
- let path=''
35
+ let path = '';
31
36
  const options = program.opts();
32
37
  console.log(figlet.textSync(`SimpleApp Generator`));
33
38
  console.log(figlet.textSync(`${version}`));
34
- let continueexecute = true
35
- if(options.generateType && options.generateType=='init'){
36
- continueexecute=false
37
-
38
- fw.prepareProject(()=>{
39
- chmod(process.cwd()+'/build.sh',0o755,()=>{
40
- process.exit(1)
41
- })
42
- })
43
-
44
-
39
+ let continueexecute = true;
40
+ if (options.generateType && options.generateType == 'init') {
41
+ continueexecute = false;
42
+
43
+ fw.prepareProject(() => {
44
+ chmod(process.cwd() + '/build.sh', 0o755, () => {
45
+ process.exit(1);
46
+ });
47
+ });
48
+ } else if (!options.configFile) {
49
+ log.error(
50
+ 'Config file parameter is required. Example: simpleapp-generator -c ./config.json'
51
+ );
52
+ throw 'Undefine configuration file';
53
+ } else if (options.configFile && options.configFile[0] == '/') {
54
+ path = options.configFile;
55
+ } else if (options.configFile) {
56
+ path = process.cwd() + '/' + options.configFile;
57
+ } else {
58
+ log.error(
59
+ 'undefine configuration file, use command simpleapp-generator -c <configfilename.json>'
60
+ );
61
+ throw error;
45
62
  }
46
- else if(!options.configFile){
47
- log.error("Config file parameter is required. Example: simpleapp-generator -c ./config.json")
48
- throw "Undefine configuration file"
49
- }
50
- else if(options.configFile && options.configFile[0]=='/'){
51
- path=options.configFile
52
- }
53
- else if(options.configFile){
54
- path=process.cwd()+'/'+options.configFile
55
- }else{
56
- log.error("undefine configuration file, use command simpleapp-generator -c <configfilename.json>")
57
- throw error
58
- }
59
63
 
60
- if(continueexecute){
61
-
62
- const configs = require(path)
63
- // console.log("configurations: ",configs)
64
- const jsonschemaFolder = configs.jsonschemaFolder
65
- const bpmnFolder = configs.bpmnFolder
66
- const backendFolder = configs.backendFolder
67
- const frontendFolder = configs.frontendFolder
64
+ if (continueexecute) {
65
+ const configs = require(path);
66
+ // console.log("configurations: ",configs)
67
+ const jsonschemaFolder = configs.jsonschemaFolder;
68
+ const bpmnFolder = configs.bpmnFolder;
69
+ const backendFolder = configs.backendFolder;
70
+ const frontendFolder = configs.frontendFolder;
68
71
 
72
+ const run = async () => {
73
+ fw.setConfiguration(configs);
74
+ fw.runCreateNuxt(() => {
75
+ fw.runCreateNest(() => {
76
+ fw.prepareNest(() => {
77
+ fw.prepareNuxt(() => {
78
+ // generate.initialize(jsonschemaFolder,configs.groupFolder,bpmnFolder,backendFolder,frontendFolder,()=>{
79
+ generate.run(configs, ['nest', 'nuxt'], () => {
80
+ fw.prettyNuxt();
81
+ fw.prettyNest();
82
+ });
83
+ });
84
+ });
85
+ });
86
+ });
87
+ };
69
88
 
89
+ const runUpdateMiniAppJsSdk = async () => {
90
+ fw.setConfiguration(configs);
91
+ generate.run(configs, ['miniAppJsSdk'], () => {
92
+ fw.prettyMiniAppJsSdk();
93
+ });
94
+ };
70
95
 
71
- const run = async()=>{
72
- fw.setConfiguration(configs)
73
- fw.runCreateNuxt(()=>{
74
- fw.runCreateNest(()=>{
75
- fw.prepareNest(()=>{
76
- fw.prepareNuxt(()=>{
77
- // generate.initialize(jsonschemaFolder,configs.groupFolder,bpmnFolder,backendFolder,frontendFolder,()=>{
78
- generate.run(configs,['nest','nuxt'],()=>{
79
- fw.prettyNuxt()
80
- fw.prettyNest()
81
- })
82
- })
83
- })
84
- })
85
- })
86
- }
87
- const reGenFrontend = async()=>{
88
- fw.setConfiguration(configs)
89
- generate.run(configs,['nuxt'],()=>{
90
- fw.prettyNuxt()
91
- })
92
- }
93
- const reGenBackend = async()=>{
94
- fw.setConfiguration(configs)
95
- generate.run(configs,['nest'],()=>{
96
- fw.prettyNest()
97
- })
98
- }
96
+ const runUpdateMiniAppStreamlitSdk = async () => {
97
+ fw.setConfiguration(configs);
98
+ generate.run(configs, ['miniAppStreamlitSdk'], () => {
99
+ fw.prettyMiniAppStreamlitSdk();
100
+ });
101
+ };
99
102
 
100
- const runbackend = async()=>{
101
- fw.setConfiguration(configs)
102
- fw.setConfiguration(configs)
103
- fw.runCreateNest(()=>{
104
- fw.prepareNest(()=>{
105
- // generate.run(jsonschemaFolder,configs.groupFolder,bpmnFolder,backendFolder,frontendFolder,()=>{
106
- generate.run(configs,['nest'],()=>{
107
- fw.prettyNest()
108
- })
109
- })
110
-
111
- })
112
- }
103
+ const reGenFrontend = async () => {
104
+ fw.setConfiguration(configs);
105
+ generate.run(configs, ['nuxt'], () => {
106
+ fw.prettyNuxt();
107
+ });
108
+ };
109
+ const reGenBackend = async () => {
110
+ fw.setConfiguration(configs);
111
+ generate.run(configs, ['nest'], () => {
112
+ fw.prettyNest();
113
+ });
114
+ };
113
115
 
114
- const runfrontend = async()=>{
115
- fw.setConfiguration(configs)
116
- fw.runCreateNuxt(()=>{
117
- fw.prepareNuxt(()=>{
118
- // generate.initialize(jsonschemaFolder,configs.groupFolder,bpmnFolder,backendFolder,frontendFolder,()=>{
119
- generate.run(configs,['nuxt'],()=>{
120
- fw.prettyNuxt()
121
- })
122
- })
123
- })
124
- }
116
+ const runbackend = async () => {
117
+ fw.setConfiguration(configs);
118
+ fw.setConfiguration(configs);
119
+ fw.runCreateNest(() => {
120
+ fw.prepareNest(() => {
121
+ // generate.run(jsonschemaFolder,configs.groupFolder,bpmnFolder,backendFolder,frontendFolder,()=>{
122
+ generate.run(configs, ['nest'], () => {
123
+ fw.prettyNest();
124
+ });
125
+ });
126
+ });
127
+ };
125
128
 
129
+ const runfrontend = async () => {
130
+ fw.setConfiguration(configs);
131
+ fw.runCreateNuxt(() => {
132
+ fw.prepareNuxt(() => {
133
+ // generate.initialize(jsonschemaFolder,configs.groupFolder,bpmnFolder,backendFolder,frontendFolder,()=>{
134
+ generate.run(configs, ['nuxt'], () => {
135
+ fw.prettyNuxt();
136
+ });
137
+ });
138
+ });
139
+ };
126
140
 
127
- switch(options.generateType){
141
+ switch (options.generateType) {
128
142
  case 'updatefrontend':
129
- reGenFrontend()
130
- break;
143
+ reGenFrontend();
144
+ break;
131
145
  case 'updatebackend':
132
- reGenBackend()
133
- break;
146
+ reGenBackend();
147
+ break;
134
148
  case 'frontend':
135
- runfrontend()
136
- break;
149
+ runfrontend();
150
+ break;
137
151
  case 'backend':
138
- runbackend()
139
- break;
152
+ runbackend();
153
+ break;
154
+ case 'updateMiniAppJsSdk':
155
+ runUpdateMiniAppJsSdk();
156
+ break;
157
+ case 'updateMiniAppStreamlitSdk':
158
+ runUpdateMiniAppStreamlitSdk();
159
+ break;
140
160
  case 'all':
141
- run()
142
- break;
161
+ run();
162
+ break;
143
163
  default:
144
- log.error("unknown generate type")
145
- break;
146
-
164
+ log.error('unknown generate type');
165
+ break;
147
166
  }
148
-
149
- }
167
+ }
@@ -177,10 +177,12 @@ const genSchema = async (
177
177
 
178
178
  if (schematype === 'object' && !_.isEmpty(jsondata) && _.isEmpty(parentObj)) {
179
179
  if (!parentObj[FOREIGNKEY_PROPERTY]) {
180
- jsondata['more'] = {
181
- type: 'object',
182
- properties: {}
183
- };
180
+ if (schemaconfigs?.customField?.isEnable) {
181
+ jsondata['more'] = {
182
+ type: 'object',
183
+ properties: {}
184
+ };
185
+ }
184
186
  }
185
187
  }
186
188