@simitgroup/simpleapp-generator 1.6.6-n-alpha → 1.6.6-p-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.
- package/ReleaseNote.md +3 -0
- package/dist/buildinschemas/customfield.d.ts.map +1 -1
- package/dist/buildinschemas/customfield.js +13 -2
- package/dist/buildinschemas/customfield.js.map +1 -1
- package/dist/framework.d.ts +2 -0
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +94 -57
- package/dist/framework.js.map +1 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +160 -34
- package/dist/generate.js.map +1 -1
- package/dist/index.js +30 -12
- package/dist/index.js.map +1 -1
- package/dist/type.d.ts +5 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/customfield.ts +14 -3
- package/src/framework.ts +309 -251
- package/src/generate.ts +592 -434
- package/src/index.ts +136 -118
- package/src/type.ts +5 -0
- package/templates/basic/miniAppJsSdk/resource-bridge.service.ts.eta +117 -0
- package/templates/basic/miniAppStreamlitSdk/resource-bridge.service.ts.eta +213 -0
- package/templates/basic/nest/apischema.ts.eta +56 -27
- package/templates/basic/nest/controller.ts.eta +2 -1
- package/templates/basic/nest/type.ts.eta +28 -10
- package/templates/basic/nuxt/resource-bridge.service.ts.eta +162 -0
- package/templates/miniAppJsSdk/src/index.ts.eta +28 -0
- package/templates/miniAppJsSdk/src/services/bridge-resource-accessor.service.ts.eta +70 -0
- package/templates/miniAppJsSdk/src/services/bridge.service.ts.eta +91 -0
- package/templates/miniAppJsSdk/src/types/service.type.ts.eta +22 -0
- package/templates/miniAppStreamlitSdk/simtrain_eco_mini_app_streamlit_sdk/sdk.py.eta +73 -0
- package/templates/nest/src/simpleapp/apischemas/customfield.ts.eta +21 -0
- package/templates/nest/src/simpleapp/generate/jsonschemas/index.ts.eta +11 -0
- package/templates/nest/src/simpleapp/types/customfield.ts.eta +14 -0
- package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +2 -3
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +13 -12
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppCustomFieldClient.ts.eta +122 -125
- package/templates/nuxt/simpleapp/generate/miniApp/bridge/constants/common.constant.ts.eta +15 -0
- package/templates/nuxt/simpleapp/generate/miniApp/bridge/constants/resource.constant.ts.eta +46 -0
- package/templates/nuxt/simpleapp/generate/miniApp/bridge/services/bridge-resource-accessor.service.ts.eta +63 -0
- package/templates/nuxt/simpleapp/generate/miniApp/bridge/services/bridge.service.ts.eta +110 -0
- package/templates/nuxt/simpleapp/generate/miniApp/bridge/types/bridge.type.ts.eta +72 -0
- package/templates/nuxt/simpleapp/generate/miniApp/bridge/types/resource-mapper.type.ts.eta +55 -0
- package/templates/nuxt/types/others.ts.eta +74 -65
- package/templates/nuxt/types/schema.ts.eta +225 -188
- package/templates/project/build.sh.eta +9 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
+
* last change 2025-06-18
|
|
5
|
+
* Author: --
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
<%
|
|
9
|
+
const upperFirstCase = (value) => {
|
|
10
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const camelToKebab = (value) => {
|
|
14
|
+
return value.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const getMiniAppInfo = (module) => {
|
|
18
|
+
const config = module.schema['x-simpleapp-config'];
|
|
19
|
+
const resourceName = config?.resourceName ?? config.documentName;
|
|
20
|
+
|
|
21
|
+
const pascalName = upperFirstCase(resourceName);
|
|
22
|
+
const kebabName = camelToKebab(resourceName);
|
|
23
|
+
|
|
24
|
+
const miniAppWhitelistApis = config?.miniApp?.whitelist || [];
|
|
25
|
+
const hasMiniAppWhitelistedApi = miniAppWhitelistApis.length > 0;
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
resourceName,
|
|
29
|
+
pascalName,
|
|
30
|
+
kebabName,
|
|
31
|
+
hasMiniAppWhitelistedApi,
|
|
32
|
+
miniAppWhitelistApis,
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
%>
|
|
36
|
+
|
|
37
|
+
<% for (let i = 0; i < it.modules.length; i++) { %>
|
|
38
|
+
<%
|
|
39
|
+
const { pascalName, kebabName, hasMiniAppWhitelistedApi } = getMiniAppInfo(it.modules[i]);
|
|
40
|
+
%>
|
|
41
|
+
<% if(hasMiniAppWhitelistedApi) { %>
|
|
42
|
+
import { MiniApp<%= pascalName %>BridgeService } from "../services/resources/<%= kebabName %>-bridge.service";
|
|
43
|
+
<% } %>
|
|
44
|
+
<% } %>
|
|
45
|
+
|
|
46
|
+
export type MiniAppResourceMap = {
|
|
47
|
+
<% for (let i = 0; i < it.modules.length; i++) { %>
|
|
48
|
+
<%
|
|
49
|
+
const { resourceName, pascalName, hasMiniAppWhitelistedApi } = getMiniAppInfo(it.modules[i]);
|
|
50
|
+
%>
|
|
51
|
+
<% if(hasMiniAppWhitelistedApi) { %>
|
|
52
|
+
<%= resourceName %>: MiniApp<%= pascalName %>BridgeService;
|
|
53
|
+
<% } %>
|
|
54
|
+
<% } %>
|
|
55
|
+
};
|
|
@@ -4,69 +4,78 @@
|
|
|
4
4
|
* last change 2024-04-14
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
|
-
import {SimpleAppClient} from
|
|
8
|
-
import { SimpleAppDocumentType } from
|
|
9
|
-
export type NameValue={
|
|
10
|
-
name:string;
|
|
11
|
-
value:number
|
|
12
|
-
}
|
|
13
|
-
export type ForeignKey = {
|
|
14
|
-
_id: string;
|
|
15
|
-
label: string;
|
|
16
|
-
code?: string
|
|
17
|
-
[key:string]: any
|
|
18
|
-
};
|
|
19
|
-
export type TextSearchBody = {
|
|
20
|
-
keyword: string;
|
|
21
|
-
fields?: string[];
|
|
22
|
-
sorts?: string[][];
|
|
23
|
-
lookup?: Record<string, string>;
|
|
24
|
-
};
|
|
7
|
+
import { SimpleAppClient } from "~/simpleapp/generate/clients/SimpleAppClient";
|
|
8
|
+
import { SimpleAppDocumentType } from "./documentlist";
|
|
25
9
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
10
|
+
export type NameValue = {
|
|
11
|
+
name: string;
|
|
12
|
+
value: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type ForeignKey = {
|
|
16
|
+
_id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
code?: string;
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type TextSearchBody = {
|
|
23
|
+
keyword: string;
|
|
24
|
+
fields?: string[];
|
|
25
|
+
sorts?: string[][];
|
|
26
|
+
lookup?: Record<string, string>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type DocumentMetaData = {
|
|
30
|
+
docName: string;
|
|
31
|
+
docType: string;
|
|
32
|
+
page: string;
|
|
33
|
+
isolationType: string;
|
|
34
|
+
documentDate: string;
|
|
35
|
+
docNumber: boolean;
|
|
36
|
+
webhook: string[] | undefined;
|
|
37
|
+
docClass: SimpleAppClient<any, any>;
|
|
38
|
+
viewer?: Function;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type MenuData = {
|
|
42
|
+
label: string;
|
|
43
|
+
icon?: string;
|
|
44
|
+
command?: Function;
|
|
45
|
+
items?: MenuData[];
|
|
46
|
+
isolationType?: string;
|
|
47
|
+
url?: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type RecentlyValue = {
|
|
51
|
+
docName: string;
|
|
52
|
+
label: string;
|
|
53
|
+
branchId: number;
|
|
54
|
+
time: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type DocNoFormat = {
|
|
58
|
+
docNoFormatName: string;
|
|
59
|
+
docNoFormatNo: string;
|
|
60
|
+
docNoPattern: string;
|
|
61
|
+
active: boolean;
|
|
62
|
+
sample: string;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type RendererSetting = {
|
|
66
|
+
documentName: SimpleAppDocumentType;
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type SearchBody = {
|
|
71
|
+
filter?: object;
|
|
72
|
+
|
|
73
|
+
fields?: any[];
|
|
74
|
+
|
|
75
|
+
sorts?: any[];
|
|
76
|
+
lookup?: { [key: string]: string };
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type DynamicObject = {
|
|
80
|
+
[key: string]: any;
|
|
81
|
+
};
|
|
@@ -4,201 +4,238 @@
|
|
|
4
4
|
* last change 2024-02-23
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import {
|
|
8
|
+
JSONSchema7,
|
|
9
|
+
JSONSchema7Type,
|
|
10
|
+
JSONSchema7Version,
|
|
11
|
+
JSONSchema7TypeName,
|
|
12
|
+
JSONSchema7Definition,
|
|
13
|
+
} from "json-schema";
|
|
8
14
|
export type DocumentStatus = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
status: string; //'CO', 'V', 'CL', 'D' and etc
|
|
16
|
+
statusName: string;
|
|
17
|
+
readOnly: boolean;
|
|
18
|
+
actions: string[]; //api name ['confirm','revert','close','void' and etc]
|
|
19
|
+
};
|
|
20
|
+
export enum RESTMethods {
|
|
21
|
+
"post" = "post",
|
|
22
|
+
"get" = "get",
|
|
23
|
+
"delete" = "delete",
|
|
24
|
+
"put" = "put",
|
|
25
|
+
"patch" = "patch",
|
|
26
|
+
}
|
|
27
|
+
export type DocumentApi = {
|
|
28
|
+
action: string; //api action name
|
|
29
|
+
entryPoint: string; //api entry point example:':id', ':id/confirm'
|
|
30
|
+
queryPara?: string[]; //what query parameter wish to accept, example: ['description','date']
|
|
31
|
+
requiredRole?: string[]; // what special user role wish to allow for this api, example: ['SuperUser']
|
|
32
|
+
workflowSetting?: { bpmn: string }; //optional property, once define code gen connect the bpmn workflow
|
|
33
|
+
method: RESTMethods;
|
|
34
|
+
schema?: string; //any schema/type name in types & apischemas
|
|
35
|
+
responseType?: string; //any schema/type name for response
|
|
36
|
+
description: string; //description of api
|
|
37
|
+
};
|
|
38
|
+
export enum IsolationType {
|
|
39
|
+
"none" = "none",
|
|
40
|
+
"tenant" = "tenant",
|
|
41
|
+
"org" = "org",
|
|
42
|
+
"branch" = "branch",
|
|
43
|
+
}
|
|
44
|
+
// export type ImportLibs = {"lib":string,"as":string}
|
|
45
|
+
export type Formula = {
|
|
46
|
+
jsonPath: string; //example: "$.subtotal","$.details[*]"
|
|
47
|
+
formula: string; //example "jslib.getDocumentSubTotal(@F{$.details})"
|
|
48
|
+
};
|
|
32
49
|
export type SchemaConfig = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
isolationType: string;
|
|
51
|
+
requiredRoles?: string[];
|
|
52
|
+
pageType?: string;
|
|
53
|
+
uniqueKey?: string;
|
|
54
|
+
uniqueKeys?: string[][];
|
|
55
|
+
documentTitle?: string;
|
|
56
|
+
generateDocumentNumber?: boolean;
|
|
57
|
+
docNoPattern?: string;
|
|
58
|
+
documentDate?: string;
|
|
59
|
+
allStatus?: DocumentStatus[];
|
|
60
|
+
additionalApis?: DocumentApi[];
|
|
61
|
+
search?: string[];
|
|
62
|
+
additionalAutoCompleteFields?: string[];
|
|
63
|
+
// libs?:ImportLibs[] // both process class and frontend client class will import same lib
|
|
64
|
+
formulas?: Formula[];
|
|
65
|
+
documentType: string;
|
|
66
|
+
documentName: string;
|
|
67
|
+
collectionName?: string;
|
|
68
|
+
foreignKeys?: MyForeignKey;
|
|
69
|
+
printFormats?: SchemaPrintFormat[];
|
|
70
|
+
};
|
|
54
71
|
|
|
55
72
|
export type SchemaPrintFormat = {
|
|
56
|
-
formatName: string
|
|
57
|
-
formatId: string
|
|
58
|
-
description?: string
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
73
|
+
formatName: string;
|
|
74
|
+
formatId: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
};
|
|
77
|
+
export type MyForeignKey = {
|
|
78
|
+
[collectionname: string]: string[];
|
|
79
|
+
};
|
|
80
|
+
|
|
64
81
|
export type SchemaType = {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
type: string;
|
|
83
|
+
definitions?: SimpleAppJSONSchema7;
|
|
84
|
+
required?: string[];
|
|
85
|
+
|
|
86
|
+
"x-simpleapp-config": SchemaConfig;
|
|
87
|
+
properties: SchemaFields;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type CustomFieldJsonSchemaMore = {
|
|
91
|
+
more?: CustomFieldJsonSchemaMoreSchema;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export type CustomFieldJsonSchemaMoreSchema = SimpleAppJSONSchema7 & {
|
|
95
|
+
properties: CustomFieldJsonSchemaMoreSchemaGroup;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type CustomFieldJsonSchemaMoreSchemaGroup = {
|
|
99
|
+
[key: string]: SimpleAppJSONSchema7Definition;
|
|
100
|
+
};
|
|
101
|
+
|
|
74
102
|
export type SchemaFields = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
pattern?: string | undefined;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
|
132
|
-
*/
|
|
133
|
-
items?: SimpleAppJSONSchema7Definition | SimpleAppJSONSchema7Definition[] | undefined;
|
|
134
|
-
additionalItems?: JSONSchema7Definition | undefined;
|
|
135
|
-
maxItems?: number | undefined;
|
|
136
|
-
minItems?: number | undefined;
|
|
137
|
-
uniqueItems?: boolean | undefined;
|
|
138
|
-
contains?: SimpleAppJSONSchema7Definition | undefined;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
|
142
|
-
*/
|
|
143
|
-
maxProperties?: number | undefined;
|
|
144
|
-
minProperties?: number | undefined;
|
|
145
|
-
required?: string[] | undefined;
|
|
146
|
-
properties?: {
|
|
147
|
-
[key: string]: SimpleAppJSONSchema7Definition;
|
|
148
|
-
} | undefined;
|
|
149
|
-
patternProperties?: {
|
|
150
|
-
[key: string]: SimpleAppJSONSchema7Definition;
|
|
151
|
-
} | undefined;
|
|
152
|
-
additionalProperties?: SimpleAppJSONSchema7Definition | undefined;
|
|
153
|
-
dependencies?: {
|
|
154
|
-
[key: string]: SimpleAppJSONSchema7Definition | string[];
|
|
155
|
-
} | undefined;
|
|
156
|
-
propertyNames?: SimpleAppJSONSchema7Definition | undefined;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
|
160
|
-
*/
|
|
161
|
-
if?: SimpleAppJSONSchema7Definition | undefined;
|
|
162
|
-
then?: SimpleAppJSONSchema7Definition | undefined;
|
|
163
|
-
else?: SimpleAppJSONSchema7Definition | undefined;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
|
167
|
-
*/
|
|
168
|
-
allOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
169
|
-
anyOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
170
|
-
oneOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
171
|
-
not?: SimpleAppJSONSchema7Definition | undefined;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
|
175
|
-
*/
|
|
176
|
-
format?: string | undefined;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
|
180
|
-
*/
|
|
181
|
-
contentMediaType?: string | undefined;
|
|
182
|
-
contentEncoding?: string | undefined;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
|
186
|
-
*/
|
|
187
|
-
definitions?: {
|
|
188
|
-
[key: string]: JSONSchema7Definition;
|
|
189
|
-
} | undefined;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
|
193
|
-
*/
|
|
194
|
-
title?: string | undefined;
|
|
195
|
-
description?: string | undefined;
|
|
196
|
-
default?: JSONSchema7Type | undefined;
|
|
197
|
-
readOnly?: boolean | undefined;
|
|
198
|
-
writeOnly?: boolean | undefined;
|
|
199
|
-
examples?: JSONSchema7Type[] | undefined;
|
|
200
|
-
}
|
|
103
|
+
_id: SimpleAppJSONSchema7;
|
|
104
|
+
tenantId: SimpleAppJSONSchema7;
|
|
105
|
+
orgId: SimpleAppJSONSchema7;
|
|
106
|
+
branchId: SimpleAppJSONSchema7;
|
|
107
|
+
created: SimpleAppJSONSchema7;
|
|
108
|
+
updated: SimpleAppJSONSchema7;
|
|
109
|
+
createdBy: SimpleAppJSONSchema7;
|
|
110
|
+
updatedBy: SimpleAppJSONSchema7;
|
|
111
|
+
[key: string]: SimpleAppJSONSchema7 | SimpleAppJSONSchema7[] | undefined;
|
|
112
|
+
} & CustomFieldJsonSchemaMore;
|
|
113
|
+
|
|
114
|
+
// modified from jsonschemas
|
|
115
|
+
export type SimpleAppJSONSchema7Definition = SimpleAppJSONSchema7 | boolean;
|
|
116
|
+
export interface SimpleAppJSONSchema7 {
|
|
117
|
+
inputType?: string;
|
|
118
|
+
"x-foreignkey"?: string;
|
|
119
|
+
$id?: string | undefined;
|
|
120
|
+
$ref?: string | undefined;
|
|
121
|
+
$schema?: JSONSchema7Version | undefined;
|
|
122
|
+
$comment?: string | undefined;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
|
|
126
|
+
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
|
|
127
|
+
*/
|
|
128
|
+
$defs?:
|
|
129
|
+
| {
|
|
130
|
+
[key: string]: JSONSchema7Definition;
|
|
131
|
+
}
|
|
132
|
+
| undefined;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
|
|
136
|
+
*/
|
|
137
|
+
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
|
|
138
|
+
enum?: JSONSchema7Type[] | undefined;
|
|
139
|
+
const?: JSONSchema7Type | undefined;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
|
|
143
|
+
*/
|
|
144
|
+
multipleOf?: number | undefined;
|
|
145
|
+
maximum?: number | undefined;
|
|
146
|
+
exclusiveMaximum?: number | undefined;
|
|
147
|
+
minimum?: number | undefined;
|
|
148
|
+
exclusiveMinimum?: number | undefined;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
|
|
152
|
+
*/
|
|
153
|
+
maxLength?: number | undefined;
|
|
154
|
+
minLength?: number | undefined;
|
|
155
|
+
pattern?: string | undefined;
|
|
201
156
|
|
|
157
|
+
/**
|
|
158
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
|
159
|
+
*/
|
|
160
|
+
items?:
|
|
161
|
+
| SimpleAppJSONSchema7Definition
|
|
162
|
+
| SimpleAppJSONSchema7Definition[]
|
|
163
|
+
| undefined;
|
|
164
|
+
additionalItems?: JSONSchema7Definition | undefined;
|
|
165
|
+
maxItems?: number | undefined;
|
|
166
|
+
minItems?: number | undefined;
|
|
167
|
+
uniqueItems?: boolean | undefined;
|
|
168
|
+
contains?: SimpleAppJSONSchema7Definition | undefined;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
|
172
|
+
*/
|
|
173
|
+
maxProperties?: number | undefined;
|
|
174
|
+
minProperties?: number | undefined;
|
|
175
|
+
required?: string[] | undefined;
|
|
176
|
+
properties?:
|
|
177
|
+
| {
|
|
178
|
+
[key: string]: SimpleAppJSONSchema7Definition;
|
|
179
|
+
}
|
|
180
|
+
| undefined;
|
|
181
|
+
patternProperties?:
|
|
182
|
+
| {
|
|
183
|
+
[key: string]: SimpleAppJSONSchema7Definition;
|
|
184
|
+
}
|
|
185
|
+
| undefined;
|
|
186
|
+
additionalProperties?: SimpleAppJSONSchema7Definition | undefined;
|
|
187
|
+
dependencies?:
|
|
188
|
+
| {
|
|
189
|
+
[key: string]: SimpleAppJSONSchema7Definition | string[];
|
|
190
|
+
}
|
|
191
|
+
| undefined;
|
|
192
|
+
propertyNames?: SimpleAppJSONSchema7Definition | undefined;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
|
196
|
+
*/
|
|
197
|
+
if?: SimpleAppJSONSchema7Definition | undefined;
|
|
198
|
+
then?: SimpleAppJSONSchema7Definition | undefined;
|
|
199
|
+
else?: SimpleAppJSONSchema7Definition | undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
|
203
|
+
*/
|
|
204
|
+
allOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
205
|
+
anyOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
206
|
+
oneOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
207
|
+
not?: SimpleAppJSONSchema7Definition | undefined;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
|
211
|
+
*/
|
|
212
|
+
format?: string | undefined;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
|
216
|
+
*/
|
|
217
|
+
contentMediaType?: string | undefined;
|
|
218
|
+
contentEncoding?: string | undefined;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
|
222
|
+
*/
|
|
223
|
+
definitions?:
|
|
224
|
+
| {
|
|
225
|
+
[key: string]: JSONSchema7Definition;
|
|
226
|
+
}
|
|
227
|
+
| undefined;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
|
231
|
+
*/
|
|
232
|
+
title?: string | undefined;
|
|
233
|
+
description?: string | undefined;
|
|
234
|
+
default?: JSONSchema7Type | undefined;
|
|
235
|
+
readOnly?: boolean | undefined;
|
|
236
|
+
writeOnly?: boolean | undefined;
|
|
237
|
+
examples?: JSONSchema7Type[] | undefined;
|
|
238
|
+
}
|
|
202
239
|
|
|
203
240
|
// ==================== Start Custom Field ====================
|
|
204
241
|
|
|
@@ -17,6 +17,15 @@ elif [ $type == 'backend' ]; then
|
|
|
17
17
|
elif [ $type == 'updatebackend' ]; then
|
|
18
18
|
simpleapp-generator -c config.json -g updatebackend
|
|
19
19
|
cp -a ./sharelibs backend/src/simpleapp/generate
|
|
20
|
+
elif [ $type == 'updateMiniAppJsSdk' ]; then
|
|
21
|
+
simpleapp-generator -c config.json -g updateMiniAppJsSdk
|
|
22
|
+
mkdir -p ./miniAppSdk/js/src/constants
|
|
23
|
+
mkdir -p ./miniAppSdk/js/src/types
|
|
24
|
+
cp -a ./frontend/simpleapp/generate/miniApp/bridge/constants/* ./miniAppSdk/js/src/constants
|
|
25
|
+
cp -a ./frontend/simpleapp/generate/miniApp/bridge/types/* ./miniAppSdk/js/src/types
|
|
26
|
+
cp -a miniAppSdk/js/src/* ../sdk/simtrain-eco-js-sdk/src
|
|
27
|
+
elif [ $type == 'updateMiniAppStreamlitSdk' ]; then
|
|
28
|
+
simpleapp-generator -c config.json -g updateMiniAppStreamlitSdk
|
|
20
29
|
fi
|
|
21
30
|
|
|
22
31
|
|