@simitgroup/simpleapp-generator 1.0.46 → 1.0.48
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/README.md +35 -1
- package/buildinschemas copy/docnoformat.docno.jsonschema.json +2 -20
- package/dist/buildinschemas/autoincreament.js +1 -1
- package/dist/buildinschemas/autoincreament.js.map +1 -1
- package/dist/buildinschemas/branch.js +1 -1
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/docnoformat.d.ts.map +1 -1
- package/dist/buildinschemas/docnoformat.js +12 -25
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +1 -0
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +11 -3
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +33 -22
- package/dist/generate.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +10 -0
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/type.d.ts +115 -22
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/autoincreament.ts +1 -1
- package/src/buildinschemas/branch.ts +1 -1
- package/src/buildinschemas/docnoformat.ts +13 -27
- package/src/buildinschemas/user.ts +1 -0
- package/src/framework.ts +11 -3
- package/src/generate.ts +35 -22
- package/src/index.ts +1 -1
- package/src/processors/jsonschemabuilder.ts +14 -1
- package/src/type.ts +137 -22
- package/templates/basic/nest/processor.ts.eta +5 -3
- package/templates/basic/nest/service.ts.eta +2 -4
- package/templates/basic/nuxt/pages.crud.vue.eta +3 -2
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +18 -2
- package/templates/nest/src/app.controller.ts.eta +6 -0
- package/templates/nest/src/app.module.ts.eta +9 -1
- package/templates/nest/src/app.service.ts.eta +6 -0
- package/templates/nest/src/main.ts.eta +7 -0
- package/templates/nest/src/simpleapp/generate/apischemas/index.ts.eta +6 -2
- package/templates/nest/src/simpleapp/generate/commons/audittrail.service.ts.eta +17 -0
- package/templates/nest/src/simpleapp/generate/commons/decorators/appuser.decorator.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/dicts/documents.ts.eta +14 -0
- package/templates/nest/src/simpleapp/generate/commons/dicts/foreignkeys.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +9 -3
- package/templates/nest/src/simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta +23 -3
- package/templates/nest/src/simpleapp/generate/commons/interceptors/response.interceptor.ts.eta +52 -10
- package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/providers/workflow.provider.ts.etax +6 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.decorator.ts.eta +6 -1
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.enum.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.guard.ts.eta +6 -1
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +15 -7
- package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/models/apievent.model.ts.eta +27 -0
- package/templates/nest/src/simpleapp/generate/models/perm.model.ts.eta +3 -4
- package/templates/nest/src/simpleapp/generate/models/tenant.model.ts.eta +3 -5
- package/templates/nest/src/simpleapp/generate/models/user.model.ts.eta +3 -4
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +54 -12
- package/templates/nest/src/simpleapp/generate/types/apievent.type.ts.eta +22 -0
- package/templates/nest/src/simpleapp/generate/types/index.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.apischema.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.types.ts.eta +6 -0
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.eta +5 -6
- package/templates/nest/src/simpleapp/services/branch.service.ts.eta +50 -10
- package/templates/nest/src/simpleapp/services/docno.service.ts.eta +9 -10
- package/templates/nest/src/simpleapp/services/org.service.ts.eta +4 -6
- package/templates/nest/src/simpleapp/services/perm.service.ts.eta +6 -7
- package/templates/nest/src/simpleapp/services/tenant.service.ts.eta +5 -6
- package/templates/nest/src/simpleapp/services/user.service.ts.eta +5 -6
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +6 -8
- package/templates/nuxt/app.vue.eta +6 -1
- package/templates/nuxt/assets/css/style.css._eta +12 -0
- package/templates/nuxt/assets/css/tailwind.css._eta +10 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +37 -0
- package/templates/nuxt/components/ButtonCreateTenant.vue.eta +68 -0
- package/templates/nuxt/components/ButtonHome.vue.eta +10 -0
- package/templates/nuxt/components/ButtonLogout.vue.eta +9 -0
- package/templates/nuxt/components/ButtonMenuPicker.vue.eta +55 -0
- package/templates/nuxt/components/ButtonPermissionInfo.vue.eta +113 -0
- package/templates/nuxt/components/ButtonProfile.vue.eta +52 -0
- package/templates/nuxt/components/CrudNestedDoc.vue.eta +16 -8
- package/templates/nuxt/components/CrudSimple.vue.eta +13 -11
- package/templates/nuxt/components/DebugDocumentData.vue.eta +1 -1
- package/templates/nuxt/components/HeaderBar.vue.eta +39 -0
- package/templates/nuxt/components/Invitation.vue.eta +2 -2
- package/templates/nuxt/components/ListView.vue.eta +52 -0
- package/templates/nuxt/components/Menus.vue.eta +6 -6
- package/templates/nuxt/components/SelectBranch.vue.eta +35 -0
- package/templates/nuxt/components/SimpleAppDatatable.vue.eta +0 -1
- package/templates/nuxt/components/SimpleAppDocumentNo.vue.eta +2 -2
- package/templates/nuxt/components/SimpleAppInputTable.vue.eta +2 -2
- package/templates/nuxt/components/SimpleFieldContainer.vue.eta +18 -12
- package/templates/nuxt/components/Spinner.vue.eta +9 -0
- package/templates/nuxt/composables/getMenus.generate.ts.eta +5 -4
- package/templates/nuxt/layouts/default.vue.eta +3 -12
- package/templates/nuxt/layouts/sidelistcrud.vue.eta +43 -0
- package/templates/nuxt/middleware/{10.acl.global.ts.eta → 30.acl.global.ts.eta} +6 -0
- package/templates/nuxt/nuxt.config.ts.eta +55 -12
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +274 -247
- package/templates/nuxt/pages/[xorg]/index.vue._eta +13 -0
- package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +89 -65
- package/templates/nuxt/pages/[xorg]/permission/index.vue.eta +7 -7
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +33 -33
- package/templates/nuxt/pages/index.vue.eta +10 -85
- package/templates/nuxt/pages/login.vue.eta +9 -3
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +16 -19
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +19 -3
- package/templates/nuxt/plugins/50.simpleapp-client.ts.eta +4 -4
- package/templates/nuxt/server/api/[xorg]/[...].ts.eta +4 -4
- package/templates/nuxt/server/api/auth/[...].ts.eta +6 -0
- package/templates/nuxt/server/api/auth/logout.ts.eta +6 -1
- package/templates/nuxt/server/api/profile/[...].ts.eta +4 -5
- package/templates/nuxt/server/api/profile/index.ts.eta +4 -6
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +9 -2
- package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +12 -3
- package/templates/nuxt/simpleapp/generate/commons/events.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/commons/groups.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/commons/roles.ts.eta +6 -0
- package/templates/nuxt/tailwind.config.ts._eta +66 -0
- package/templates/nuxt/types/index.ts.eta +22 -1
- package/templates/project/build.sh.eta +4 -4
- package/templates/project/schemas/category.ts.eta +40 -27
- package/templates/project/schemas/customer.ts.eta +35 -0
- package/templates/project/schemas/index.ts.eta +4 -4
- package/templates/project/schemas/invoice.ts.eta +56 -0
- package/templates/project/schemas/product.ts.eta +41 -57
- package/templates/project/sharelibs/index.ts.eta +2 -0
- package/templates/project/sharelibs/money.ts.eta +17 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/assets/css/tailwind.css.eta +0 -35
- package/templates/nuxt/components/PermissionInfo.vue.eta +0 -92
- package/templates/nuxt/pages/[xorg]/index.vue.eta +0 -36
- package/templates/nuxt/tailwind.config.ts.eta +0 -9
- package/templates/project/shares/index.ts.eta +0 -2
- /package/templates/nest/{.env.eta → .env._eta} +0 -0
- /package/templates/nuxt/{.env.eta → .env._eta} +0 -0
- /package/templates/nuxt/pages/[xorg]/branch/{index.vue.eta → index.vue.etax} +0 -0
- /package/templates/project/{config.json.eta → config.json._eta} +0 -0
- /package/templates/project/{shares → sharelibs}/hello.ts.eta +0 -0
package/dist/type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JSONSchema7Type, JSONSchema7Version, JSONSchema7TypeName, JSONSchema7Definition } from 'json-schema';
|
|
2
2
|
export type ChildModels = {
|
|
3
3
|
[key: string]: {
|
|
4
4
|
type: string;
|
|
@@ -51,6 +51,7 @@ export type ModuleObject = {
|
|
|
51
51
|
docname: string;
|
|
52
52
|
pagetype: string;
|
|
53
53
|
api: DocumentApi[];
|
|
54
|
+
schema: SimpleAppJSONSchema7;
|
|
54
55
|
};
|
|
55
56
|
export type TypeGenerateDocumentVariable = {
|
|
56
57
|
name: string;
|
|
@@ -64,7 +65,7 @@ export type TypeGenerateDocumentVariable = {
|
|
|
64
65
|
typename: string;
|
|
65
66
|
fullApiSchemaName: string;
|
|
66
67
|
fullTypeName: string;
|
|
67
|
-
jsonschema:
|
|
68
|
+
jsonschema: SimpleAppJSONSchema7;
|
|
68
69
|
bothEndCode: string;
|
|
69
70
|
frontEndCode: string;
|
|
70
71
|
backEndCode: string;
|
|
@@ -116,10 +117,6 @@ export declare enum IsolationType {
|
|
|
116
117
|
"org" = "org",
|
|
117
118
|
"branch" = "branch"
|
|
118
119
|
}
|
|
119
|
-
export type ImportLibs = {
|
|
120
|
-
"lib": string;
|
|
121
|
-
"as": string;
|
|
122
|
-
};
|
|
123
120
|
export type Formula = {
|
|
124
121
|
"jsonpath": string;
|
|
125
122
|
"formula": string;
|
|
@@ -135,30 +132,126 @@ export type SchemaConfig = {
|
|
|
135
132
|
allStatus?: DocumentStatus[];
|
|
136
133
|
additionalApis?: DocumentApi[];
|
|
137
134
|
additionalAutoCompleteFields?: string[];
|
|
138
|
-
libs?: ImportLibs[];
|
|
139
135
|
formulas?: Formula[];
|
|
140
136
|
documentType: string;
|
|
141
137
|
documentName: string;
|
|
142
138
|
collectionName?: string;
|
|
143
139
|
foreignKeys?: MyForeignKey;
|
|
144
140
|
};
|
|
145
|
-
export type ForeignKeyProperty = {
|
|
146
|
-
'x-foreignkey'?: string;
|
|
147
|
-
};
|
|
148
141
|
export type SchemaFields = {
|
|
149
|
-
_id:
|
|
150
|
-
tenantId:
|
|
151
|
-
orgId:
|
|
152
|
-
branchId:
|
|
153
|
-
created:
|
|
154
|
-
updated:
|
|
155
|
-
createdby:
|
|
156
|
-
updatedby:
|
|
157
|
-
[key: string]:
|
|
158
|
-
};
|
|
159
|
-
export type
|
|
142
|
+
_id: SimpleAppJSONSchema7;
|
|
143
|
+
tenantId: SimpleAppJSONSchema7;
|
|
144
|
+
orgId: SimpleAppJSONSchema7;
|
|
145
|
+
branchId: SimpleAppJSONSchema7;
|
|
146
|
+
created: SimpleAppJSONSchema7;
|
|
147
|
+
updated: SimpleAppJSONSchema7;
|
|
148
|
+
createdby: SimpleAppJSONSchema7;
|
|
149
|
+
updatedby: SimpleAppJSONSchema7;
|
|
150
|
+
[key: string]: SimpleAppJSONSchema7 | SimpleAppJSONSchema7[] | undefined;
|
|
151
|
+
};
|
|
152
|
+
export type SchemaType = {
|
|
153
|
+
type: string;
|
|
154
|
+
definitions?: SimpleAppJSONSchema7;
|
|
155
|
+
required?: string[];
|
|
160
156
|
"x-simpleapp-config": SchemaConfig;
|
|
161
157
|
properties: SchemaFields;
|
|
162
158
|
};
|
|
163
|
-
export type
|
|
159
|
+
export type SimpleAppJSONSchema7Definition = SimpleAppJSONSchema7 | boolean;
|
|
160
|
+
export interface SimpleAppJSONSchema7 {
|
|
161
|
+
'x-foreignkey'?: string;
|
|
162
|
+
$id?: string | undefined;
|
|
163
|
+
$ref?: string | undefined;
|
|
164
|
+
$schema?: JSONSchema7Version | undefined;
|
|
165
|
+
$comment?: string | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
|
|
168
|
+
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
|
|
169
|
+
*/
|
|
170
|
+
$defs?: {
|
|
171
|
+
[key: string]: JSONSchema7Definition;
|
|
172
|
+
} | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
|
|
175
|
+
*/
|
|
176
|
+
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
|
|
177
|
+
enum?: JSONSchema7Type[] | undefined;
|
|
178
|
+
const?: JSONSchema7Type | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
|
|
181
|
+
*/
|
|
182
|
+
multipleOf?: number | undefined;
|
|
183
|
+
maximum?: number | undefined;
|
|
184
|
+
exclusiveMaximum?: number | undefined;
|
|
185
|
+
minimum?: number | undefined;
|
|
186
|
+
exclusiveMinimum?: number | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
|
|
189
|
+
*/
|
|
190
|
+
maxLength?: number | undefined;
|
|
191
|
+
minLength?: number | undefined;
|
|
192
|
+
pattern?: string | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
|
195
|
+
*/
|
|
196
|
+
items?: SimpleAppJSONSchema7Definition | SimpleAppJSONSchema7Definition[] | undefined;
|
|
197
|
+
additionalItems?: JSONSchema7Definition | undefined;
|
|
198
|
+
maxItems?: number | undefined;
|
|
199
|
+
minItems?: number | undefined;
|
|
200
|
+
uniqueItems?: boolean | undefined;
|
|
201
|
+
contains?: SimpleAppJSONSchema7Definition | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
|
204
|
+
*/
|
|
205
|
+
maxProperties?: number | undefined;
|
|
206
|
+
minProperties?: number | undefined;
|
|
207
|
+
required?: string[] | undefined;
|
|
208
|
+
properties?: {
|
|
209
|
+
[key: string]: SimpleAppJSONSchema7Definition;
|
|
210
|
+
} | undefined;
|
|
211
|
+
patternProperties?: {
|
|
212
|
+
[key: string]: SimpleAppJSONSchema7Definition;
|
|
213
|
+
} | undefined;
|
|
214
|
+
additionalProperties?: SimpleAppJSONSchema7Definition | undefined;
|
|
215
|
+
dependencies?: {
|
|
216
|
+
[key: string]: SimpleAppJSONSchema7Definition | string[];
|
|
217
|
+
} | undefined;
|
|
218
|
+
propertyNames?: SimpleAppJSONSchema7Definition | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
|
221
|
+
*/
|
|
222
|
+
if?: SimpleAppJSONSchema7Definition | undefined;
|
|
223
|
+
then?: SimpleAppJSONSchema7Definition | undefined;
|
|
224
|
+
else?: SimpleAppJSONSchema7Definition | undefined;
|
|
225
|
+
/**
|
|
226
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
|
227
|
+
*/
|
|
228
|
+
allOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
229
|
+
anyOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
230
|
+
oneOf?: SimpleAppJSONSchema7Definition[] | undefined;
|
|
231
|
+
not?: SimpleAppJSONSchema7Definition | undefined;
|
|
232
|
+
/**
|
|
233
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
|
234
|
+
*/
|
|
235
|
+
format?: string | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
|
238
|
+
*/
|
|
239
|
+
contentMediaType?: string | undefined;
|
|
240
|
+
contentEncoding?: string | undefined;
|
|
241
|
+
/**
|
|
242
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
|
243
|
+
*/
|
|
244
|
+
definitions?: {
|
|
245
|
+
[key: string]: JSONSchema7Definition;
|
|
246
|
+
} | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
|
249
|
+
*/
|
|
250
|
+
title?: string | undefined;
|
|
251
|
+
description?: string | undefined;
|
|
252
|
+
default?: JSONSchema7Type | undefined;
|
|
253
|
+
readOnly?: boolean | undefined;
|
|
254
|
+
writeOnly?: boolean | undefined;
|
|
255
|
+
examples?: JSONSchema7Type | undefined;
|
|
256
|
+
}
|
|
164
257
|
//# sourceMappingURL=type.d.ts.map
|
package/dist/type.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"AAAA,OAAQ,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"AAAA,OAAQ,EAAc,eAAe,EAAC,kB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,SAAS,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,QAAQ,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;CAC1C"}
|
package/dist/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":";;;AAgBA,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,iCAAqB,CAAA;IACrB,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;AACrB,CAAC,EAPW,UAAU,0BAAV,UAAU,QAOrB;
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":";;;AAgBA,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,iCAAqB,CAAA;IACrB,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;AACrB,CAAC,EAPW,UAAU,0BAAV,UAAU,QAOrB;AA4FD,IAAY,WAAuF;AAAnG,WAAY,WAAW;IAAE,4BAAa,CAAA;IAAC,0BAAW,CAAA;IAAE,gCAAiB,CAAA;IAAC,0BAAW,CAAA;IAAE,8BAAe,CAAA;AAAA,CAAC,EAAvF,WAAW,2BAAX,WAAW,QAA4E;AAUnG,IAAY,aAAgF;AAA5F,WAAY,aAAa;IAAE,8BAAa,CAAA;IAAG,kCAAiB,CAAA;IAAC,4BAAW,CAAA;IAAE,kCAAiB,CAAA;AAAA,CAAC,EAAhF,aAAa,6BAAb,aAAa,QAAmE"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ export const autoincreament:SchemaType = {
|
|
|
5
5
|
"x-simpleapp-config":{
|
|
6
6
|
documentType:'autoinc',
|
|
7
7
|
documentName:'autoincreament',
|
|
8
|
-
isolationType:IsolationType.
|
|
8
|
+
isolationType:IsolationType.none,
|
|
9
9
|
pageType:"crud",
|
|
10
10
|
additionalApis:[{
|
|
11
11
|
action:"genNextNumber",
|
|
@@ -6,7 +6,7 @@ export const branch:SchemaType ={
|
|
|
6
6
|
isolationType:IsolationType.tenant,
|
|
7
7
|
documentType:'branch',
|
|
8
8
|
documentName:'branch',
|
|
9
|
-
pageType:"crud",
|
|
9
|
+
// pageType:"crud",
|
|
10
10
|
uniqueKey:'branchCode',
|
|
11
11
|
documentTitle:'branchName',
|
|
12
12
|
additionalAutoCompleteFields: ['branchId']
|
|
@@ -18,8 +18,7 @@ export const docnoformat:SchemaType ={
|
|
|
18
18
|
"execute":"listDocFormats",
|
|
19
19
|
"description":"get list of document format for 1 doctype"
|
|
20
20
|
} ]
|
|
21
|
-
},
|
|
22
|
-
|
|
21
|
+
},
|
|
23
22
|
properties: {
|
|
24
23
|
_id:{type:'string'},
|
|
25
24
|
created:{type:'string'},
|
|
@@ -29,30 +28,17 @@ export const docnoformat:SchemaType ={
|
|
|
29
28
|
tenantId: {type:'integer',default:1,minimum:1 },
|
|
30
29
|
orgId: {type:'integer',default:1,minimum:1 },
|
|
31
30
|
branchId: {type:'integer',default:1,minimum:1 },
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
"feb": {"type": "integer","default":1},
|
|
45
|
-
"mar": {"type": "integer","default":1},
|
|
46
|
-
"apr": {"type": "integer","default":1},
|
|
47
|
-
"may": {"type": "integer","default":1},
|
|
48
|
-
"jun": {"type": "integer","default":1},
|
|
49
|
-
"jul": {"type": "integer","default":1},
|
|
50
|
-
"aug": {"type": "integer","default":1},
|
|
51
|
-
"sep": {"type": "integer","default":1},
|
|
52
|
-
"oct": {"type": "integer","default":1},
|
|
53
|
-
"nov": {"type": "integer","default":1},
|
|
54
|
-
"dec": {"type": "integer","default":1}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
31
|
+
branch:{type:"object", "x-foreignkey":"branch",properties:{
|
|
32
|
+
"_id":{"type":"string"},
|
|
33
|
+
"label":{"type":"string"},
|
|
34
|
+
"branchId":{type:"integer"},
|
|
35
|
+
}},
|
|
36
|
+
docNoFormatNo: {"type": "string","examples": ["INV"]},
|
|
37
|
+
docNoFormatName: { "type": "string", "examples": ["Invoice Default Format"]},
|
|
38
|
+
active: {type: "boolean","examples": [true],default:true},
|
|
39
|
+
default:{type: "boolean","examples": [true],default:true},
|
|
40
|
+
docNoType: {type: "string","examples": ["SI","PI"]},
|
|
41
|
+
docNoPattern: {type: "string","examples": ["SI{YYMM}-<000>","PI-2023-<0000>"],"description":"{date} format as ISO8601 symbol"},
|
|
42
|
+
nextNumber:{type:"integer",default:1}
|
|
57
43
|
}
|
|
58
44
|
}
|
package/src/framework.ts
CHANGED
|
@@ -12,7 +12,7 @@ let config = {
|
|
|
12
12
|
"backendFolder":"./backend",
|
|
13
13
|
"groupFolder":"./groups",
|
|
14
14
|
"backendPort":"8000",
|
|
15
|
-
"mongoConnectStr":'mongodb://
|
|
15
|
+
"mongoConnectStr":'mongodb://localhost:27017/simpleapp',
|
|
16
16
|
"frontendFolder":"./frontend",
|
|
17
17
|
"frontendPort":"8080",
|
|
18
18
|
"oauthSetting":{
|
|
@@ -126,6 +126,14 @@ export const prepareProject = async (callback)=>{
|
|
|
126
126
|
// log.info(fullfilename+"====>>"+tofilename)
|
|
127
127
|
// console.log(txt)
|
|
128
128
|
writeFileSync(tofilename,txt)
|
|
129
|
+
}else if(filename.includes('._eta')){
|
|
130
|
+
const tofilename =targetfolder + filename.replace('._eta','')
|
|
131
|
+
log.info(tofilename,"Render file")
|
|
132
|
+
const txt = eta.render(fullfilename,vars)
|
|
133
|
+
if(!existsSync(tofilename)){
|
|
134
|
+
writeFileSync(tofilename,txt)
|
|
135
|
+
}
|
|
136
|
+
|
|
129
137
|
}else if(filename.includes('.md')){
|
|
130
138
|
const tofilename =dir + filename.replace('.eta','')
|
|
131
139
|
log.info(tofilename,"Copy")
|
|
@@ -149,10 +157,10 @@ export const prepareNuxt = (callback:Function)=>{
|
|
|
149
157
|
const targetfolder = config.frontendFolder
|
|
150
158
|
if(!fs.existsSync(`${targetfolder}/.env`)){
|
|
151
159
|
//asume no environment. prepare now
|
|
152
|
-
exec(`cd ${targetfolder};pnpm install;pnpm install -D @nuxtjs/tailwindcss @sidebase/nuxt-auth @nuxt/ui @types/node @vueuse/nuxt @sidebase/nuxt-auth @vueuse/core
|
|
160
|
+
exec(`cd ${targetfolder};pnpm install;pnpm install -D nuxt-primevue @nuxtjs/tailwindcss @sidebase/nuxt-auth @nuxt/ui @types/node @vueuse/nuxt @sidebase/nuxt-auth @vueuse/core prettier `, (error, stdout, stderr)=>{
|
|
153
161
|
//;pnpm install
|
|
154
162
|
console.log(error, stdout, stderr)
|
|
155
|
-
exec(`cd ${targetfolder};pnpm install --save pinia @pinia/nuxt @nuxt/kit lodash @types/lodash @darkwolf/base64url next-auth@4.21.1 @darkwolf/base64url @nuxt/ui ajv ajv-formats ajv-errors dotenv @fullcalendar/core @fullcalendar/vue3 quill
|
|
163
|
+
exec(`cd ${targetfolder};pnpm install --save primeicons moment memory-cache jsonpath pinia @pinia/nuxt @nuxt/kit lodash @types/lodash @darkwolf/base64url next-auth@4.21.1 @darkwolf/base64url @nuxt/ui ajv ajv-formats ajv-errors dotenv @fullcalendar/core @fullcalendar/vue3 quill prettier axios json-schema mitt `, (error, stdout, stderr)=>{
|
|
156
164
|
console.log(error, stdout, stderr)
|
|
157
165
|
|
|
158
166
|
// fs.mkdirSync(`${targetfolder}/assets/css/`,{recursive:true})
|
package/src/generate.ts
CHANGED
|
@@ -12,14 +12,14 @@ import * as buildinschemas from './buildinschemas'
|
|
|
12
12
|
import { JSONSchema7 } from 'json-schema';
|
|
13
13
|
const { Eta } = require('eta');
|
|
14
14
|
const { capitalizeFirstLetter }= require('./libs');
|
|
15
|
-
const X_DOCUMENT_TYPE='x-document-type'
|
|
16
|
-
const X_DOCUMENT_NAME='x-document-name'
|
|
17
|
-
const X_COLLECTION_NAME='x-collection-name'
|
|
18
|
-
const
|
|
19
|
-
const extFb = '.xfb.json';
|
|
20
|
-
const extHfb = '.xhfb.json';
|
|
21
|
-
const extjsonschema = '.jsonschema.json';
|
|
22
|
-
const extgroups = '.group.json';
|
|
15
|
+
// const X_DOCUMENT_TYPE='x-document-type'
|
|
16
|
+
// const X_DOCUMENT_NAME='x-document-name'
|
|
17
|
+
// const X_COLLECTION_NAME='x-collection-name'
|
|
18
|
+
const X_SIMPLEAPP_CONFIG='x-simpleapp-config'
|
|
19
|
+
// const extFb = '.xfb.json';
|
|
20
|
+
// const extHfb = '.xhfb.json';
|
|
21
|
+
// const extjsonschema = '.jsonschema.json';
|
|
22
|
+
// const extgroups = '.group.json';
|
|
23
23
|
let jsonschemas = {};
|
|
24
24
|
let configs:any = {}
|
|
25
25
|
const docs = [];
|
|
@@ -92,15 +92,15 @@ export const run = async (paraconfigs:any,genFor:string[],callback:Function) =>
|
|
|
92
92
|
await processSchema(file.replace('.json',''),jsonschema)
|
|
93
93
|
}
|
|
94
94
|
// //generate groups
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
const systemgroups = readdirSync(`${groupFolder}`)
|
|
96
|
+
for(let g = 0; g< systemgroups.length;g++){
|
|
97
|
+
const groupfile = systemgroups[g]
|
|
98
|
+
const groupjsonstr = readFileSync(`${groupFolder}/${groupfile}`, 'utf-8');
|
|
99
|
+
const groupdata = JSON.parse(groupjsonstr);
|
|
100
|
+
const documentname = groupfile.split('.')[0]
|
|
101
|
+
const roles = prepareRoles(groupdata)
|
|
102
|
+
allroles[documentname]=roles
|
|
103
|
+
}
|
|
104
104
|
finalize(activatemodules)
|
|
105
105
|
callback()
|
|
106
106
|
}
|
|
@@ -128,6 +128,7 @@ const processSchema= async (schemaname:string,jsondata:JSONSchema7)=>{
|
|
|
128
128
|
// const jsondata = JSON.parse(jsonstring);
|
|
129
129
|
const rendertype = 'basic';
|
|
130
130
|
jsonschemas[docname] = jsondata;
|
|
131
|
+
const copyofjsonschema = {...jsondata}
|
|
131
132
|
const allmodels:ChildModels = await readJsonSchemaBuilder(docname, jsondata);
|
|
132
133
|
// log.error("allmodels",docname,schemaname)
|
|
133
134
|
generateSchema(docname, doctype, rendertype, allmodels);
|
|
@@ -135,7 +136,8 @@ const processSchema= async (schemaname:string,jsondata:JSONSchema7)=>{
|
|
|
135
136
|
doctype:doctype,
|
|
136
137
|
docname:capitalizeFirstLetter(docname),
|
|
137
138
|
pagetype: config.pageType??'',
|
|
138
|
-
api:config.additionalApis
|
|
139
|
+
api:config.additionalApis,
|
|
140
|
+
schema : copyofjsonschema
|
|
139
141
|
})
|
|
140
142
|
// } else {
|
|
141
143
|
// log.warn(`Load `+clc.yellow(file) + ` but it is not supported`)
|
|
@@ -242,7 +244,7 @@ const generateSchema = ( docname: string,
|
|
|
242
244
|
}else if(foldertype=='nuxt'){
|
|
243
245
|
const capname = capitalizeFirstLetter(docname)
|
|
244
246
|
const validateWritePage = (folder:string,isexists:boolean)=>{
|
|
245
|
-
if(!jsonschemas[docname][
|
|
247
|
+
if(!jsonschemas[docname][X_SIMPLEAPP_CONFIG]['pageType'] ){
|
|
246
248
|
return false
|
|
247
249
|
}else if(!isexists){
|
|
248
250
|
return true
|
|
@@ -339,15 +341,26 @@ const finalize=(modules:ModuleObject[])=>{
|
|
|
339
341
|
const arrfilename:string[] = filename.split('.')
|
|
340
342
|
// log.info("check longfilename:::",longfilename,"become====",arrfilename)
|
|
341
343
|
//only process .eta
|
|
342
|
-
if(_.last(arrfilename)=='eta'){
|
|
344
|
+
if(_.last(arrfilename)=='eta'|| _.last(arrfilename)=='_eta'){
|
|
343
345
|
const relativepath = longfilename.includes('/') ? longfilename.replace(`/${filename}`,'') : ''
|
|
344
346
|
const foldername = `${frameworkpath}/${relativepath}`
|
|
345
|
-
const shortfilename = filename.replace('.eta','')
|
|
347
|
+
const shortfilename = filename.replace('.eta','').replace('._eta','')
|
|
346
348
|
const targetfilename = `${foldername}/${shortfilename}`
|
|
349
|
+
let forceoverride=true
|
|
350
|
+
if(filename.includes('._eta')){
|
|
351
|
+
forceoverride=false
|
|
352
|
+
}
|
|
353
|
+
// log.warn("Process=== ",targetfilename)
|
|
354
|
+
if(existsSync(targetfilename) && forceoverride == false){
|
|
355
|
+
log.info("file exists, skip: ",targetfilename)
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
|
|
347
360
|
if(!existsSync(foldername)){
|
|
348
361
|
mkdirSync(foldername,{recursive:true})
|
|
349
362
|
}
|
|
350
|
-
const templatename = `${frameworkfolder}/${longfilename}`.replace(".eta","")
|
|
363
|
+
// const templatename = `${frameworkfolder}/${longfilename}`.replace(".eta","").replace('._eta','')
|
|
351
364
|
log.info("Write template:",targetfilename)
|
|
352
365
|
const txt = eta.render(longfilename, renderProperties)
|
|
353
366
|
writeFileSync(targetfilename,txt)
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { JSONSchema7, JSONSchema7Definition,JSONSchema7Array,JSONSchema7TypeName
|
|
|
3
3
|
import * as js7 from 'json-schema';
|
|
4
4
|
import _ from 'lodash'
|
|
5
5
|
import { capitalizeFirstLetter } from '../libs';
|
|
6
|
-
import {SchemaType,SchemaConfig,JsonSchemaProperties
|
|
6
|
+
import {SchemaType,SchemaConfig,JsonSchemaProperties} from "../type"
|
|
7
7
|
// import * as schematemplates from '../schematype'
|
|
8
8
|
import { Logger, ILogObj } from "tslog";
|
|
9
9
|
import $RefParser from "@apidevtools/json-schema-ref-parser";
|
|
@@ -43,6 +43,7 @@ export const readJsonSchemaBuilder = async (docname: string,orijsondata:JSONSche
|
|
|
43
43
|
|
|
44
44
|
let schemaconfigs:SchemaConfig = orijsondata[configname]
|
|
45
45
|
const doctype=schemaconfigs.documentType
|
|
46
|
+
|
|
46
47
|
if(!schemaconfigs.collectionName){
|
|
47
48
|
schemaconfigs.documentName
|
|
48
49
|
}
|
|
@@ -51,6 +52,18 @@ export const readJsonSchemaBuilder = async (docname: string,orijsondata:JSONSche
|
|
|
51
52
|
schemaconfigs.foreignKeys={}
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
if(schemaconfigs.generateDocumentNumber){
|
|
56
|
+
const tmp = {
|
|
57
|
+
type: "object",
|
|
58
|
+
"x-foreignkey":"docnoformat",
|
|
59
|
+
properties: {_id: {type: "string"},label: {type: "string"}}
|
|
60
|
+
}
|
|
61
|
+
orijsondata.properties["docNoFormat"] = tmp as JSONSchema7Definition
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//apply some controls
|
|
65
|
+
//control docnoformatis required
|
|
66
|
+
|
|
54
67
|
// let schemaprops:any = targettemplate.properties
|
|
55
68
|
// console.log("just want process targettemplate ######>>>",orijsondata)
|
|
56
69
|
// let schemadefinitions = targettemplate.definitions
|