@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.
- package/dist/buildinschemas/autoincreament.d.ts.map +1 -1
- package/dist/buildinschemas/autoincreament.js +17 -14
- package/dist/buildinschemas/autoincreament.js.map +1 -1
- package/dist/buildinschemas/branch.d.ts.map +1 -1
- package/dist/buildinschemas/branch.js +25 -24
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/changehistories.d.ts.map +1 -1
- package/dist/buildinschemas/changehistories.js +10 -9
- package/dist/buildinschemas/changehistories.js.map +1 -1
- package/dist/buildinschemas/customfield.d.ts.map +1 -1
- package/dist/buildinschemas/customfield.js +16 -15
- package/dist/buildinschemas/customfield.js.map +1 -1
- package/dist/buildinschemas/docnoformat.d.ts.map +1 -1
- package/dist/buildinschemas/docnoformat.js +34 -23
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/documentevent.d.ts.map +1 -1
- package/dist/buildinschemas/documentevent.js +36 -26
- package/dist/buildinschemas/documentevent.js.map +1 -1
- package/dist/buildinschemas/keyvaluepair.d.ts.map +1 -1
- package/dist/buildinschemas/keyvaluepair.js +7 -6
- package/dist/buildinschemas/keyvaluepair.js.map +1 -1
- package/dist/buildinschemas/organization.d.ts.map +1 -1
- package/dist/buildinschemas/organization.js +34 -30
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/buildinschemas/permission.d.ts.map +1 -1
- package/dist/buildinschemas/permission.js +16 -7
- package/dist/buildinschemas/permission.js.map +1 -1
- package/dist/buildinschemas/systemmessage.d.ts.map +1 -1
- package/dist/buildinschemas/systemmessage.js +35 -32
- package/dist/buildinschemas/systemmessage.js.map +1 -1
- package/dist/buildinschemas/tenant.d.ts.map +1 -1
- package/dist/buildinschemas/tenant.js +17 -16
- package/dist/buildinschemas/tenant.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +34 -31
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/buildinschemas/webhook.d.ts.map +1 -1
- package/dist/buildinschemas/webhook.js +24 -23
- package/dist/buildinschemas/webhook.js.map +1 -1
- package/dist/framework.d.ts +2 -0
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +92 -57
- package/dist/framework.js.map +1 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +175 -34
- package/dist/generate.js.map +1 -1
- package/dist/index.js +30 -12
- package/dist/index.js.map +1 -1
- package/dist/processors/jsonschemabuilder.js +14 -12
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/type.d.ts +44 -5
- 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 +35 -33
- package/src/buildinschemas/branch.ts +47 -47
- package/src/buildinschemas/changehistories.ts +31 -30
- package/src/buildinschemas/customfield.ts +17 -16
- package/src/buildinschemas/docnoformat.ts +54 -43
- package/src/buildinschemas/documentevent.ts +42 -33
- package/src/buildinschemas/keyvaluepair.ts +25 -25
- package/src/buildinschemas/organization.ts +54 -50
- package/src/buildinschemas/permission.ts +34 -25
- package/src/buildinschemas/systemmessage.ts +39 -38
- package/src/buildinschemas/tenant.ts +46 -45
- package/src/buildinschemas/user.ts +64 -60
- package/src/buildinschemas/webhook.ts +62 -61
- package/src/framework.ts +307 -251
- package/src/generate.ts +608 -434
- package/src/index.ts +136 -118
- package/src/processors/jsonschemabuilder.ts +6 -4
- package/src/type.ts +287 -226
- package/templates/basic/miniAppJsSdk/resource-bridge.service.ts.eta +119 -0
- package/templates/basic/miniAppStreamlitSdk/resource-bridge.service.ts.eta +228 -0
- package/templates/basic/nuxt/jsonschema.ts.eta +7 -0
- package/templates/basic/nuxt/resource-bridge.editable.service.ts.eta +40 -0
- package/templates/basic/nuxt/resource-bridge.service.ts.eta +165 -0
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +27 -9
- 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 +76 -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 +3 -3
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +0 -1
- package/templates/nuxt/plugins/18.simpleapp-custom-field-store.ts.eta +9 -3
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +316 -341
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +32 -21
- package/templates/nuxt/simpleapp/generate/jsonSchemas/index.ts.eta +11 -0
- package/templates/nuxt/simpleapp/generate/miniApp/bridge/constants/common.constant.ts.eta +16 -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 +129 -0
- package/templates/nuxt/simpleapp/generate/miniApp/bridge/types/bridge.type.ts.eta +81 -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 +4 -0
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppCustomFieldClient.ts.eta +0 -191
|
@@ -1,36 +1,45 @@
|
|
|
1
|
-
import {SchemaType,RESTMethods,IsolationType} from '../type'
|
|
1
|
+
import { SchemaType, RESTMethods, IsolationType } from '../type';
|
|
2
2
|
|
|
3
|
-
export const documentevent:SchemaType ={
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
export const documentevent: SchemaType = {
|
|
4
|
+
type: 'object',
|
|
5
|
+
'x-simpleapp-config': {
|
|
6
|
+
documentType: 'docevent',
|
|
7
|
+
documentName: 'documentevent',
|
|
8
|
+
isolationType: IsolationType.org,
|
|
9
|
+
resourceName: 'documentEvent'
|
|
10
|
+
},
|
|
11
|
+
properties: {
|
|
12
|
+
_id: { type: 'string' },
|
|
13
|
+
created: { type: 'string' },
|
|
14
|
+
updated: { type: 'string' },
|
|
15
|
+
createdBy: { type: 'string' },
|
|
16
|
+
updatedBy: { type: 'string' },
|
|
17
|
+
tenantId: { type: 'integer', default: 1 },
|
|
18
|
+
orgId: { type: 'integer', default: 1 },
|
|
19
|
+
branchId: { type: 'integer', default: 1 },
|
|
20
|
+
documentName: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
minLength: 2
|
|
9
23
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"enum": ["create","update","delete","read","print","void","confirm","draft"],
|
|
31
|
-
"examples": ["create","delete"]
|
|
32
|
-
},
|
|
33
|
-
"eventdata": {}
|
|
34
|
-
}
|
|
24
|
+
documentId: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
minLength: 3,
|
|
27
|
+
format: 'uuid'
|
|
28
|
+
},
|
|
29
|
+
eventType: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
enum: [
|
|
32
|
+
'create',
|
|
33
|
+
'update',
|
|
34
|
+
'delete',
|
|
35
|
+
'read',
|
|
36
|
+
'print',
|
|
37
|
+
'void',
|
|
38
|
+
'confirm',
|
|
39
|
+
'draft'
|
|
40
|
+
],
|
|
41
|
+
examples: ['create', 'delete']
|
|
42
|
+
},
|
|
43
|
+
eventdata: {}
|
|
35
44
|
}
|
|
36
|
-
|
|
45
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {SchemaType,RESTMethods,IsolationType} from '../type'
|
|
2
|
-
|
|
3
|
-
export const keyvaluepair:SchemaType = {
|
|
4
|
-
type: "object",
|
|
5
|
-
"x-simpleapp-config":{
|
|
6
|
-
documentType:'kvpair',
|
|
7
|
-
documentName:'keyvaluepair',
|
|
8
|
-
isolationType:IsolationType.org,
|
|
9
|
-
uniqueKey:'key',
|
|
10
|
-
pageType:"crud",
|
|
11
|
-
},
|
|
12
|
-
required:["key","value"],
|
|
13
|
-
properties: {
|
|
14
|
-
_id:{type:'string'},
|
|
15
|
-
created:{type:'string'},
|
|
16
|
-
updated:{type:'string'},
|
|
17
|
-
createdBy:{type:'string'},
|
|
18
|
-
updatedBy:{type:'string'},
|
|
19
|
-
tenantId: {type:'integer',default:1,minimum:0 },
|
|
20
|
-
orgId: {type:'integer',default:1,minimum:0 },
|
|
21
|
-
branchId: {type:'integer',default:1,minimum:0 },
|
|
22
|
-
key: {type: "string",minLength:3,},
|
|
23
|
-
value: {type: "string",minLength:10,},
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
import { SchemaType, RESTMethods, IsolationType } from '../type';
|
|
26
2
|
|
|
3
|
+
export const keyvaluepair: SchemaType = {
|
|
4
|
+
type: 'object',
|
|
5
|
+
'x-simpleapp-config': {
|
|
6
|
+
documentType: 'kvpair',
|
|
7
|
+
documentName: 'keyvaluepair',
|
|
8
|
+
isolationType: IsolationType.org,
|
|
9
|
+
uniqueKey: 'key',
|
|
10
|
+
pageType: 'crud',
|
|
11
|
+
resourceName: 'keyValuePair'
|
|
12
|
+
},
|
|
13
|
+
required: ['key', 'value'],
|
|
14
|
+
properties: {
|
|
15
|
+
_id: { type: 'string' },
|
|
16
|
+
created: { type: 'string' },
|
|
17
|
+
updated: { type: 'string' },
|
|
18
|
+
createdBy: { type: 'string' },
|
|
19
|
+
updatedBy: { type: 'string' },
|
|
20
|
+
tenantId: { type: 'integer', default: 1, minimum: 0 },
|
|
21
|
+
orgId: { type: 'integer', default: 1, minimum: 0 },
|
|
22
|
+
branchId: { type: 'integer', default: 1, minimum: 0 },
|
|
23
|
+
key: { type: 'string', minLength: 3 },
|
|
24
|
+
value: { type: 'string', minLength: 10 }
|
|
25
|
+
}
|
|
26
|
+
};
|
|
@@ -1,51 +1,55 @@
|
|
|
1
|
-
import {SchemaType,RESTMethods,IsolationType} from '../type'
|
|
1
|
+
import { SchemaType, RESTMethods, IsolationType } from '../type';
|
|
2
2
|
|
|
3
|
-
export const organization:SchemaType ={
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
3
|
+
export const organization: SchemaType = {
|
|
4
|
+
type: 'object',
|
|
5
|
+
'x-simpleapp-config': {
|
|
6
|
+
isolationType: IsolationType.tenant,
|
|
7
|
+
documentType: 'org',
|
|
8
|
+
documentName: 'organization',
|
|
9
|
+
pageType: 'crud',
|
|
10
|
+
uniqueKey: 'orgCode',
|
|
11
|
+
uniqueKeys: [['orgId']],
|
|
12
|
+
documentTitle: 'orgName',
|
|
13
|
+
additionalAutoCompleteFields: ['orgId'],
|
|
14
|
+
additionalApis: [
|
|
15
|
+
{
|
|
16
|
+
action: 'getlogo',
|
|
17
|
+
entryPoint: 'logo',
|
|
18
|
+
requiredRole: ['User'],
|
|
19
|
+
method: RESTMethods.get,
|
|
20
|
+
responseType: 'String',
|
|
21
|
+
description: 'obtain avatar base64 jpg image'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
action: 'uploadlogo',
|
|
25
|
+
entryPoint: 'logo',
|
|
26
|
+
requiredRole: ['Admin'],
|
|
27
|
+
method: RESTMethods.post,
|
|
28
|
+
schema: 'KeyValue',
|
|
29
|
+
responseType: 'String',
|
|
30
|
+
description: 'post avatar in base64 jpg image'
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
resourceName: 'organization'
|
|
34
|
+
},
|
|
35
|
+
required: ['orgId', 'orgCode', 'orgName'],
|
|
36
|
+
properties: {
|
|
37
|
+
_id: { type: 'string' },
|
|
38
|
+
created: { type: 'string' },
|
|
39
|
+
updated: { type: 'string' },
|
|
40
|
+
createdBy: { type: 'string' },
|
|
41
|
+
updatedBy: { type: 'string' },
|
|
42
|
+
tenantId: { type: 'integer', default: 1, minimum: 1 },
|
|
43
|
+
orgId: { type: 'integer', default: 1, minimum: 1 },
|
|
44
|
+
branchId: { type: 'integer', default: 1, minimum: 0 },
|
|
45
|
+
orgCode: { type: 'string', minLength: 1 },
|
|
46
|
+
orgName: { type: 'string' },
|
|
47
|
+
registrationNo: { type: 'string' },
|
|
48
|
+
active: { type: 'boolean', default: true },
|
|
49
|
+
description: { type: 'string', format: 'text' },
|
|
50
|
+
timeZone: { type: 'string', examples: ['Asia/Kuala_Lumpur'] },
|
|
51
|
+
offsetMinute: { type: 'number', default: 0 },
|
|
52
|
+
currency: { type: 'string', minimum: 3, maximum: 3 },
|
|
53
|
+
country: { type: 'string', minimum: 2, maximum: 2 }
|
|
54
|
+
}
|
|
55
|
+
};
|
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
import {SchemaType,RESTMethods,IsolationType} from '../type'
|
|
1
|
+
import { SchemaType, RESTMethods, IsolationType } from '../type';
|
|
2
2
|
|
|
3
|
-
export const permission:SchemaType ={
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
export const permission: SchemaType = {
|
|
4
|
+
type: 'object',
|
|
5
|
+
'x-simpleapp-config': {
|
|
6
|
+
documentType: 'perm',
|
|
7
|
+
documentName: 'permission',
|
|
8
|
+
isolationType: IsolationType.org,
|
|
9
|
+
resourceName: 'permission'
|
|
10
|
+
},
|
|
11
|
+
properties: {
|
|
12
|
+
_id: { type: 'string' },
|
|
13
|
+
created: { type: 'string' },
|
|
14
|
+
updated: { type: 'string' },
|
|
15
|
+
createdBy: { type: 'string' },
|
|
16
|
+
updatedBy: { type: 'string' },
|
|
17
|
+
tenantId: { type: 'integer', default: 1, minimum: 0 },
|
|
18
|
+
orgId: { type: 'integer', default: 1, minimum: 0 },
|
|
19
|
+
branchId: { type: 'integer', default: 1, minimum: 0 },
|
|
20
|
+
groups: {
|
|
21
|
+
type: 'array',
|
|
22
|
+
minItems: 1,
|
|
23
|
+
items: { type: 'string' }
|
|
9
24
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
items:{type: "string"}
|
|
23
|
-
},
|
|
24
|
-
uid: {type: "string",description:"sso unique identity, which is keycloak sub"},
|
|
25
|
-
userId : {type:"string","x-foreignkey":"user", format:"uuid",description:"primary key from user" }
|
|
26
|
-
}
|
|
27
|
-
}
|
|
25
|
+
uid: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'sso unique identity, which is keycloak sub'
|
|
28
|
+
},
|
|
29
|
+
userId: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
'x-foreignkey': 'user',
|
|
32
|
+
format: 'uuid',
|
|
33
|
+
description: 'primary key from user'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import {SchemaType,RESTMethods,IsolationType} from '../type'
|
|
1
|
+
import { SchemaType, RESTMethods, IsolationType } from '../type';
|
|
2
2
|
|
|
3
|
-
export const systemmessage:SchemaType =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} ]
|
|
19
|
-
},
|
|
20
|
-
"properties": {
|
|
21
|
-
"_id": { "type": "string","format":"uuid" },
|
|
22
|
-
"created": { "type": "string" },
|
|
23
|
-
"updated": { "type": "string" },
|
|
24
|
-
"createdBy": { "type": "string" },
|
|
25
|
-
"updatedBy": { "type": "string" },
|
|
26
|
-
"tenantId": { "type": "integer", "default": 1 },
|
|
27
|
-
"orgId": { "type": "integer", "default": 1 },
|
|
28
|
-
"branchId": { "type": "integer", "default": 1 },
|
|
29
|
-
"uid": { "type": "string","format":"uuid" },
|
|
30
|
-
"messageType":{"type":"string",minLength:3},
|
|
31
|
-
"messageTitle": {
|
|
32
|
-
"type": "string",
|
|
33
|
-
"minLength": 3
|
|
34
|
-
},
|
|
35
|
-
"read": { "type": "boolean", "default": false},
|
|
36
|
-
"body": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"format": "html"
|
|
3
|
+
export const systemmessage: SchemaType = {
|
|
4
|
+
type: 'object',
|
|
5
|
+
'x-simpleapp-config': {
|
|
6
|
+
documentType: 'sysmsg',
|
|
7
|
+
documentName: 'systemmessage',
|
|
8
|
+
isolationType: IsolationType.tenant,
|
|
9
|
+
documentTitle: 'messageTitle',
|
|
10
|
+
additionalApis: [
|
|
11
|
+
{
|
|
12
|
+
action: 'readmsg',
|
|
13
|
+
entryPoint: ':id/read',
|
|
14
|
+
requiredRole: ['User'],
|
|
15
|
+
responseType: 'Systemmessage',
|
|
16
|
+
method: RESTMethods.get,
|
|
17
|
+
description: 'get message content and mark read'
|
|
39
18
|
}
|
|
19
|
+
],
|
|
20
|
+
resourceName: 'systemMessage'
|
|
21
|
+
},
|
|
22
|
+
properties: {
|
|
23
|
+
_id: { type: 'string', format: 'uuid' },
|
|
24
|
+
created: { type: 'string' },
|
|
25
|
+
updated: { type: 'string' },
|
|
26
|
+
createdBy: { type: 'string' },
|
|
27
|
+
updatedBy: { type: 'string' },
|
|
28
|
+
tenantId: { type: 'integer', default: 1 },
|
|
29
|
+
orgId: { type: 'integer', default: 1 },
|
|
30
|
+
branchId: { type: 'integer', default: 1 },
|
|
31
|
+
uid: { type: 'string', format: 'uuid' },
|
|
32
|
+
messageType: { type: 'string', minLength: 3 },
|
|
33
|
+
messageTitle: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
minLength: 3
|
|
36
|
+
},
|
|
37
|
+
read: { type: 'boolean', default: false },
|
|
38
|
+
body: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
format: 'html'
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
};
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import {SchemaType,RESTMethods,IsolationType} from '../type'
|
|
1
|
+
import { SchemaType, RESTMethods, IsolationType } from '../type';
|
|
2
2
|
|
|
3
|
-
export const tenant:SchemaType ={
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
3
|
+
export const tenant: SchemaType = {
|
|
4
|
+
type: 'object',
|
|
5
|
+
'x-simpleapp-config': {
|
|
6
|
+
isolationType: IsolationType.none,
|
|
7
|
+
requiredRoles: ['SuperAdmin'],
|
|
8
|
+
pageType: 'crud',
|
|
9
|
+
uniqueKey: 'tenantId',
|
|
10
|
+
documentTitle: 'tenantName',
|
|
11
|
+
documentName: 'tenant',
|
|
12
|
+
documentType: 'tenant',
|
|
13
|
+
resourceName: 'tenant'
|
|
14
|
+
},
|
|
15
|
+
required: ['tenantId', 'tenantName', 'owner'],
|
|
16
|
+
properties: {
|
|
17
|
+
_id: { type: 'string' },
|
|
18
|
+
created: { type: 'string' },
|
|
19
|
+
updated: { type: 'string' },
|
|
20
|
+
createdBy: { type: 'string' },
|
|
21
|
+
updatedBy: { type: 'string' },
|
|
22
|
+
tenantId: { type: 'integer', default: 1, minimum: 0 },
|
|
23
|
+
orgId: { type: 'integer', default: 1, minimum: 0 },
|
|
24
|
+
branchId: { type: 'integer', default: 1, minimum: 0 },
|
|
25
|
+
tenantName: { type: 'string', minLength: 3 },
|
|
26
|
+
active: { type: 'boolean', examples: [true], default: true },
|
|
27
|
+
businessType: { type: 'string' },
|
|
28
|
+
clientSetting: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
auditTrail: { type: 'boolean', default: false },
|
|
32
|
+
webhook: { type: 'boolean', default: false },
|
|
33
|
+
support: { type: 'boolean', default: false }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
description: { type: 'string' },
|
|
37
|
+
owner: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
'x-foreignkey': 'user',
|
|
40
|
+
required: ['_id', 'label', 'uid'],
|
|
41
|
+
properties: {
|
|
42
|
+
_id: { type: 'string' },
|
|
43
|
+
label: { type: 'string' },
|
|
44
|
+
uid: { type: 'string' }
|
|
45
|
+
}
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -1,63 +1,67 @@
|
|
|
1
|
-
import {SchemaType,RESTMethods,IsolationType} from '../type'
|
|
1
|
+
import { SchemaType, RESTMethods, IsolationType } from '../type';
|
|
2
2
|
|
|
3
|
-
export const user:SchemaType ={
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{"action":"updatePermission",
|
|
24
|
-
"entryPoint":":id/permission",
|
|
25
|
-
"requiredRole":[],
|
|
26
|
-
"method":RESTMethods.put,
|
|
27
|
-
"schema":"[UserPermission]",
|
|
28
|
-
"description":"set user permissoin"
|
|
29
|
-
}
|
|
30
|
-
]
|
|
3
|
+
export const user: SchemaType = {
|
|
4
|
+
type: 'object',
|
|
5
|
+
'x-simpleapp-config': {
|
|
6
|
+
documentType: 'user',
|
|
7
|
+
documentName: 'user',
|
|
8
|
+
pageType: 'crud',
|
|
9
|
+
loseDataIsolation: true,
|
|
10
|
+
isolationType: IsolationType.tenant,
|
|
11
|
+
uniqueKey: 'email',
|
|
12
|
+
documentTitle: 'fullname',
|
|
13
|
+
requiredRoles: ['SuperUser'],
|
|
14
|
+
additionalAutoCompleteFields: ['uid'],
|
|
15
|
+
additionalApis: [
|
|
16
|
+
{
|
|
17
|
+
action: 'getPermission',
|
|
18
|
+
entryPoint: ':id/permission',
|
|
19
|
+
requiredRole: [],
|
|
20
|
+
method: RESTMethods.get,
|
|
21
|
+
responseType: '[UserPermission]',
|
|
22
|
+
description: 'Get user permissoin'
|
|
31
23
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
orgId: {type:'integer',default:1,minimum:0 },
|
|
40
|
-
branchId: {type:'integer',default:1,minimum:0 },
|
|
41
|
-
uid: {
|
|
42
|
-
type: "string",
|
|
43
|
-
oneOf:[{"format":"uuid"},{const:""}],
|
|
44
|
-
description:"sso unique id, such as keycloak sub id, empty during invitation",
|
|
45
|
-
},
|
|
46
|
-
fullName: {type: "string",minLength:3},
|
|
47
|
-
email: {type: "string",minLength:10,format: "email"},
|
|
48
|
-
mobileNo: {
|
|
49
|
-
type: "string",
|
|
50
|
-
anyOf:[
|
|
51
|
-
{"const":""},
|
|
52
|
-
{"format": "tel","examples": ["0123456789"]}
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
active: {type: "boolean",default:true},
|
|
56
|
-
description: {type:"string"},
|
|
57
|
-
lastActivity: {type: "string",description:"capture ISO8601 last api call"},
|
|
58
|
-
completedTours: {
|
|
59
|
-
type: "array",
|
|
60
|
-
items: { "type": "string", "examples": ["mainpage"] }
|
|
61
|
-
}
|
|
24
|
+
{
|
|
25
|
+
action: 'updatePermission',
|
|
26
|
+
entryPoint: ':id/permission',
|
|
27
|
+
requiredRole: [],
|
|
28
|
+
method: RESTMethods.put,
|
|
29
|
+
schema: '[UserPermission]',
|
|
30
|
+
description: 'set user permissoin'
|
|
62
31
|
}
|
|
63
|
-
|
|
32
|
+
],
|
|
33
|
+
resourceName: 'user'
|
|
34
|
+
},
|
|
35
|
+
properties: {
|
|
36
|
+
_id: { type: 'string' },
|
|
37
|
+
created: { type: 'string' },
|
|
38
|
+
updated: { type: 'string' },
|
|
39
|
+
createdBy: { type: 'string' },
|
|
40
|
+
updatedBy: { type: 'string' },
|
|
41
|
+
tenantId: { type: 'integer', default: 1, minimum: 0 },
|
|
42
|
+
orgId: { type: 'integer', default: 1, minimum: 0 },
|
|
43
|
+
branchId: { type: 'integer', default: 1, minimum: 0 },
|
|
44
|
+
uid: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
oneOf: [{ format: 'uuid' }, { const: '' }],
|
|
47
|
+
description:
|
|
48
|
+
'sso unique id, such as keycloak sub id, empty during invitation'
|
|
49
|
+
},
|
|
50
|
+
fullName: { type: 'string', minLength: 3 },
|
|
51
|
+
email: { type: 'string', minLength: 10, format: 'email' },
|
|
52
|
+
mobileNo: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
anyOf: [{ const: '' }, { format: 'tel', examples: ['0123456789'] }]
|
|
55
|
+
},
|
|
56
|
+
active: { type: 'boolean', default: true },
|
|
57
|
+
description: { type: 'string' },
|
|
58
|
+
lastActivity: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'capture ISO8601 last api call'
|
|
61
|
+
},
|
|
62
|
+
completedTours: {
|
|
63
|
+
type: 'array',
|
|
64
|
+
items: { type: 'string', examples: ['mainpage'] }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|