@simitgroup/simpleapp-generator 1.6.6-p-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 (90) 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 +14 -24
  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.map +1 -1
  41. package/dist/framework.js +2 -4
  42. package/dist/framework.js.map +1 -1
  43. package/dist/generate.js +17 -2
  44. package/dist/generate.js.map +1 -1
  45. package/dist/processors/jsonschemabuilder.js +14 -12
  46. package/dist/processors/jsonschemabuilder.js.map +1 -1
  47. package/dist/type.d.ts +39 -5
  48. package/dist/type.d.ts.map +1 -1
  49. package/dist/type.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/buildinschemas/autoincreament.ts +35 -33
  52. package/src/buildinschemas/branch.ts +47 -47
  53. package/src/buildinschemas/changehistories.ts +31 -30
  54. package/src/buildinschemas/customfield.ts +14 -24
  55. package/src/buildinschemas/docnoformat.ts +54 -43
  56. package/src/buildinschemas/documentevent.ts +42 -33
  57. package/src/buildinschemas/keyvaluepair.ts +25 -25
  58. package/src/buildinschemas/organization.ts +54 -50
  59. package/src/buildinschemas/permission.ts +34 -25
  60. package/src/buildinschemas/systemmessage.ts +39 -38
  61. package/src/buildinschemas/tenant.ts +46 -45
  62. package/src/buildinschemas/user.ts +64 -60
  63. package/src/buildinschemas/webhook.ts +62 -61
  64. package/src/framework.ts +2 -4
  65. package/src/generate.ts +17 -1
  66. package/src/processors/jsonschemabuilder.ts +6 -4
  67. package/src/type.ts +271 -215
  68. package/templates/basic/miniAppJsSdk/resource-bridge.service.ts.eta +9 -7
  69. package/templates/basic/miniAppStreamlitSdk/resource-bridge.service.ts.eta +22 -7
  70. package/templates/basic/nuxt/jsonschema.ts.eta +7 -0
  71. package/templates/basic/nuxt/resource-bridge.editable.service.ts.eta +40 -0
  72. package/templates/basic/nuxt/resource-bridge.service.ts.eta +24 -21
  73. package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +27 -9
  74. package/templates/miniAppJsSdk/src/services/bridge-resource-accessor.service.ts.eta +2 -2
  75. package/templates/miniAppStreamlitSdk/simtrain_eco_mini_app_streamlit_sdk/sdk.py.eta +5 -2
  76. package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +4 -3
  77. package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +0 -1
  78. package/templates/nuxt/plugins/18.simpleapp-custom-field-store.ts.eta +9 -3
  79. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +316 -341
  80. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +32 -22
  81. package/templates/nuxt/simpleapp/generate/jsonSchemas/index.ts.eta +11 -0
  82. package/templates/nuxt/simpleapp/generate/miniApp/bridge/constants/common.constant.ts.eta +1 -0
  83. package/templates/nuxt/simpleapp/generate/miniApp/bridge/constants/resource.constant.ts.eta +2 -2
  84. package/templates/nuxt/simpleapp/generate/miniApp/bridge/services/bridge-resource-accessor.service.ts.eta +4 -4
  85. package/templates/nuxt/simpleapp/generate/miniApp/bridge/services/bridge.service.ts.eta +20 -1
  86. package/templates/nuxt/simpleapp/generate/miniApp/bridge/types/bridge.type.ts.eta +9 -0
  87. package/templates/nuxt/simpleapp/generate/miniApp/bridge/types/resource-mapper.type.ts.eta +2 -2
  88. package/templates/project/build.sh.eta +0 -5
  89. package/templates/nest/src/simpleapp/apischemas/customfield.ts.eta +0 -21
  90. package/templates/nuxt/simpleapp/generate/clients/SimpleAppCustomFieldClient.ts.eta +0 -188
@@ -1,33 +1,34 @@
1
- import {SchemaType,RESTMethods,IsolationType} from '../type'
1
+ import { SchemaType, RESTMethods, IsolationType } from '../type';
2
2
 
3
- export const permission:SchemaType ={
4
- type: "object",
5
- "x-simpleapp-config":{
6
- documentType:'hist',
7
- documentName:'histories',
8
- isolationType:IsolationType.tenant
9
- },
10
- required:["document"],
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
- document:{type:'string',minLength:3},
21
- histories:{
22
- type:"array",
23
- items:{
24
- type:"object",
25
- properties:{
26
- datetime:{type:"string",format:"datetime"},
27
- uid:{type:"string",format:"uuid"},
28
- action:{type:"string",minLength:3},
29
- }
30
- }
3
+ export const permission: SchemaType = {
4
+ type: 'object',
5
+ 'x-simpleapp-config': {
6
+ documentType: 'hist',
7
+ documentName: 'histories',
8
+ isolationType: IsolationType.tenant,
9
+ resourceName: 'changeHistories'
10
+ },
11
+ required: ['document'],
12
+ properties: {
13
+ _id: { type: 'string' },
14
+ created: { type: 'string' },
15
+ updated: { type: 'string' },
16
+ createdBy: { type: 'string' },
17
+ updatedBy: { type: 'string' },
18
+ tenantId: { type: 'integer', default: 1, minimum: 0 },
19
+ orgId: { type: 'integer', default: 1, minimum: 0 },
20
+ branchId: { type: 'integer', default: 1, minimum: 0 },
21
+ document: { type: 'string', minLength: 3 },
22
+ histories: {
23
+ type: 'array',
24
+ items: {
25
+ type: 'object',
26
+ properties: {
27
+ datetime: { type: 'string', format: 'datetime' },
28
+ uid: { type: 'string', format: 'uuid' },
29
+ action: { type: 'string', minLength: 3 }
31
30
  }
32
31
  }
33
- }
32
+ }
33
+ }
34
+ };
@@ -9,16 +9,7 @@ export const customfield: SchemaType = {
9
9
  uniqueKey: 'collectionName',
10
10
  documentTitle: 'collectionName',
11
11
  pageType: 'pageType',
12
- additionalApis: [
13
- {
14
- action: 'getCompleteCustomFieldResources',
15
- entryPoint: 'complete-custom-field-resources',
16
- requiredRole: ['Customfield_search'],
17
- responseType: '[CompleteCustomFieldResource]',
18
- method: RESTMethods.get,
19
- description: 'Get complete custom field resources'
20
- }
21
- ]
12
+ resourceName: 'customField'
22
13
  },
23
14
  properties: {
24
15
  _id: { type: 'string' },
@@ -36,21 +27,20 @@ export const customfield: SchemaType = {
36
27
  form: {
37
28
  type: 'object',
38
29
  properties: {
39
- schema: {
30
+ jsonSchema: {
40
31
  type: 'object',
41
- properties: {},
42
- examples: [
43
- {
44
- type: 'object',
45
- required: ['hello'],
46
- properties: {
47
- hello: {
48
- type: 'string',
49
- minLength: 2
50
- }
51
- }
52
- }
53
- ]
32
+ properties: {}
33
+ }
34
+ }
35
+ },
36
+ list: {
37
+ type: 'object',
38
+ properties: {
39
+ fields: {
40
+ type: 'array',
41
+ items: {
42
+ type: 'string'
43
+ }
54
44
  }
55
45
  }
56
46
  }
@@ -1,44 +1,55 @@
1
- import {SchemaType,RESTMethods,IsolationType} from '../type'
1
+ import { SchemaType, RESTMethods, IsolationType } from '../type';
2
2
 
3
- export const docnoformat:SchemaType ={
4
- type: "object",
5
- "x-simpleapp-config":{
6
- isolationType:IsolationType.org,
7
- documentType:'docno',
8
- documentName:'docnoformat',
9
- pageType:"crud",
10
- uniqueKey:'docNoFormatNo',
11
- documentTitle:'docNoFormatName',
12
- additionalAutoCompleteFields: ['default'],
13
- additionalApis:[{
14
- "action":"listDocFormats",
15
- "entryPoint":"/listdocformats/:doctype",
16
- "requiredRole":["User"],
17
- "responseType":"[Docnoformat]",
18
- "method":RESTMethods.get,
19
- "description":"get list of document format for 1 doctype"
20
- } ]
21
- },
22
- properties: {
23
- _id:{type:'string'},
24
- created:{type:'string'},
25
- updated:{type:'string'},
26
- createdBy:{type:'string'},
27
- updatedBy:{type:'string'},
28
- tenantId: {type:'integer',default:1,minimum:1 },
29
- orgId: {type:'integer',default:1,minimum:1 },
30
- branchId: {type:'integer',default:1,minimum:1 },
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}
43
- }
44
- }
3
+ export const docnoformat: SchemaType = {
4
+ type: 'object',
5
+ 'x-simpleapp-config': {
6
+ isolationType: IsolationType.org,
7
+ documentType: 'docno',
8
+ documentName: 'docnoformat',
9
+ pageType: 'crud',
10
+ uniqueKey: 'docNoFormatNo',
11
+ documentTitle: 'docNoFormatName',
12
+ additionalAutoCompleteFields: ['default'],
13
+ additionalApis: [
14
+ {
15
+ action: 'listDocFormats',
16
+ entryPoint: '/listdocformats/:doctype',
17
+ requiredRole: ['User'],
18
+ responseType: '[Docnoformat]',
19
+ method: RESTMethods.get,
20
+ description: 'get list of document format for 1 doctype'
21
+ }
22
+ ],
23
+ resourceName: 'documentNoFormat'
24
+ },
25
+ properties: {
26
+ _id: { type: 'string' },
27
+ created: { type: 'string' },
28
+ updated: { type: 'string' },
29
+ createdBy: { type: 'string' },
30
+ updatedBy: { type: 'string' },
31
+ tenantId: { type: 'integer', default: 1, minimum: 1 },
32
+ orgId: { type: 'integer', default: 1, minimum: 1 },
33
+ branchId: { type: 'integer', default: 1, minimum: 1 },
34
+ branch: {
35
+ type: 'object',
36
+ 'x-foreignkey': 'branch',
37
+ properties: {
38
+ _id: { type: 'string' },
39
+ label: { type: 'string' },
40
+ branchId: { type: 'integer' }
41
+ }
42
+ },
43
+ docNoFormatNo: { type: 'string', examples: ['INV'] },
44
+ docNoFormatName: { type: 'string', examples: ['Invoice Default Format'] },
45
+ active: { type: 'boolean', examples: [true], default: true },
46
+ default: { type: 'boolean', examples: [true], default: true },
47
+ docNoType: { type: 'string', examples: ['SI', 'PI'] },
48
+ docNoPattern: {
49
+ type: 'string',
50
+ examples: ['SI{YYMM}-<000>', 'PI-2023-<0000>'],
51
+ description: '{date} format as ISO8601 symbol'
52
+ },
53
+ nextNumber: { type: 'integer', default: 1 }
54
+ }
55
+ };
@@ -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
- "type": "object",
5
- "x-simpleapp-config": {
6
- "documentType": "docevent",
7
- "documentName": "documentevent",
8
- "isolationType": IsolationType.org
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
- "properties": {
11
- "_id": { "type": "string" },
12
- "created": { "type": "string" },
13
- "updated": { "type": "string" },
14
- "createdBy": { "type": "string" },
15
- "updatedBy": { "type": "string" },
16
- "tenantId": { "type": "integer", "default": 1 },
17
- "orgId": { "type": "integer", "default": 1 },
18
- "branchId": { "type": "integer", "default": 1 },
19
- "documentName": {
20
- "type": "string",
21
- "minLength": 2
22
- },
23
- "documentId": {
24
- "type": "string",
25
- "minLength": 3,
26
- "format":"uuid"
27
- },
28
- "eventType": {
29
- "type": "string",
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
- 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
- "action":"getlogo",
16
- "entryPoint":"logo",
17
- "requiredRole":["User"],
18
- "method":RESTMethods.get,
19
- "responseType":"String",
20
- "description":"obtain avatar base64 jpg image"
21
- },{
22
- "action":"uploadlogo",
23
- "entryPoint":"logo",
24
- "requiredRole":["Admin"],
25
- "method":RESTMethods.post,
26
- "schema":"KeyValue",
27
- "responseType":"String",
28
- "description":"post avatar in base64 jpg image"
29
- }]
30
- },
31
- required:["orgId","orgCode","orgName"],
32
- "properties": {
33
- _id:{type:'string'},
34
- created:{type:'string'},
35
- updated:{type:'string'},
36
- createdBy:{type:'string'},
37
- updatedBy:{type:'string'},
38
- tenantId: {type:'integer',default:1,minimum:1 },
39
- orgId: {type:'integer',default:1,minimum:1 },
40
- branchId: {type:'integer',default:1,minimum:0 },
41
- orgCode: {"type": "string", "minLength":1,},
42
- orgName: {type: "string",},
43
- registrationNo:{type:"string"},
44
- active: {type: "boolean","default":true,},
45
- description: {type: "string",format:"text",},
46
- timeZone: {"type": "string","examples": ["Asia/Kuala_Lumpur"]},
47
- offsetMinute:{"type": "number","default":0},
48
- currency:{"type":"string",minimum:3,maximum:3},
49
- country:{"type":"string",minimum:2,maximum:2}
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
- type: "object",
5
- "x-simpleapp-config":{
6
- documentType:'perm',
7
- documentName:'permission',
8
- isolationType:IsolationType.org
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
- properties: {
11
- _id:{type:'string'},
12
- created:{type:'string'},
13
- updated:{type:'string'},
14
- createdBy:{type:'string'},
15
- updatedBy:{type:'string'},
16
- tenantId: {type:'integer',default:1,minimum:0},
17
- orgId: {type:'integer',default:1,minimum:0 },
18
- branchId: {type:'integer',default:1,minimum:0 },
19
- groups: {
20
- type: "array",
21
- minItems:1,
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
- "type": "object",
6
- "x-simpleapp-config": {
7
- "documentType": "sysmsg",
8
- "documentName": "systemmessage",
9
- "isolationType": IsolationType.tenant,
10
- "documentTitle": "messageTitle",
11
- additionalApis:[{
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"
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
+ };