@simitgroup/simpleapp-generator 1.6.6-j-alpha → 1.6.6-k.1-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 (158) hide show
  1. package/ReleaseNote.md +3 -2
  2. package/dist/buildinschemas/docnoformat.js +6 -6
  3. package/dist/buildinschemas/docnoformat.js.map +1 -1
  4. package/dist/buildinschemas/documentevent.js +1 -1
  5. package/dist/buildinschemas/documentevent.js.map +1 -1
  6. package/dist/buildinschemas/organization.js +1 -1
  7. package/dist/buildinschemas/organization.js.map +1 -1
  8. package/dist/buildinschemas/tenant.js +1 -1
  9. package/dist/buildinschemas/tenant.js.map +1 -1
  10. package/dist/buildinschemas/user.js +2 -2
  11. package/dist/buildinschemas/user.js.map +1 -1
  12. package/dist/framework.d.ts.map +1 -1
  13. package/dist/framework.js +2 -0
  14. package/dist/framework.js.map +1 -1
  15. package/dist/generate.d.ts.map +1 -1
  16. package/dist/generate.js +21 -20
  17. package/dist/generate.js.map +1 -1
  18. package/dist/processors/jrxmlbuilder.js +3 -3
  19. package/dist/processors/jrxmlbuilder.js.map +1 -1
  20. package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
  21. package/dist/processors/jsonschemabuilder.js +17 -10
  22. package/dist/processors/jsonschemabuilder.js.map +1 -1
  23. package/dist/type.d.ts +1 -1
  24. package/dist/type.d.ts.map +1 -1
  25. package/package.json +1 -2
  26. package/reset-install.sh +3 -0
  27. package/src/buildinschemas/docnoformat.ts +6 -6
  28. package/src/buildinschemas/documentevent.ts +1 -1
  29. package/src/buildinschemas/organization.ts +1 -1
  30. package/src/buildinschemas/tenant.ts +1 -1
  31. package/src/buildinschemas/user.ts +2 -2
  32. package/src/framework.ts +2 -1
  33. package/src/generate.ts +22 -20
  34. package/src/processors/jrxmlbuilder.ts +3 -3
  35. package/src/processors/jsonschemabuilder.ts +27 -14
  36. package/src/type.ts +1 -1
  37. package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +3 -3
  38. package/templates/nest/.gitignore.eta +4 -5
  39. package/templates/nest/src/{app.module.ts.eta → app.module.ts._eta} +2 -2
  40. package/templates/nest/src/{main.ts.eta → main.ts._eta} +2 -2
  41. package/templates/nest/src/printapi/printapi.service.ts.eta +7 -8
  42. package/templates/nest/src/simpleapp/.gitignore.eta +1 -1
  43. package/templates/nest/src/simpleapp/additional.module.ts._eta +13 -0
  44. package/templates/nest/src/simpleapp/generate/commons/audittrail.service.ts.eta +2 -2
  45. package/templates/nest/src/simpleapp/generate/commons/customkeycloa.guard.ts.eta +14 -12
  46. package/templates/nest/src/simpleapp/generate/commons/customkeycloak.guard.ts.eta +36 -42
  47. package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +6 -3
  48. package/templates/nest/src/simpleapp/generate/commons/encryption.static.ts.eta +56 -61
  49. package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +65 -88
  50. package/templates/nest/src/simpleapp/generate/commons/robotuser.service.ts.eta +10 -9
  51. package/templates/nest/src/simpleapp/generate/commons/roles/roles.guard.ts.eta +10 -3
  52. package/templates/nest/src/simpleapp/generate/commons/runwebhook.service.ts.eta +41 -39
  53. package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +439 -293
  54. package/templates/nest/src/simpleapp/generate/processors/autoinc.processor.ts.eta +20 -5
  55. package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +437 -40
  56. package/templates/nest/src/simpleapp/profile/{profile.controller.ts.eta → profile.controller.ts._eta} +2 -2
  57. package/templates/nest/src/simpleapp/profile/{profile.service.ts.eta → profile.service.ts._eta} +2 -2
  58. package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +19 -15
  59. package/templates/nuxt/components/button/ButtonMultiple.vue._eta +1 -1
  60. package/templates/nuxt/components/calendar/{CalendarByResource.vue.eta → CalendarByResource.vue._eta} +2 -2
  61. package/templates/nuxt/components/calendar/{CalendarInput.vue.eta → CalendarInput.vue._eta} +2 -2
  62. package/templates/nuxt/components/calendar/{CalendarSmall.vue.eta → CalendarSmall.vue._eta} +6 -0
  63. package/templates/nuxt/components/debug/{DebugDocumentData.vue.eta → DebugDocumentData.vue._eta} +2 -2
  64. package/templates/nuxt/components/form/{FormDocnoformat.vue.eta → FormDocnoformat.vue._eta} +2 -1
  65. package/templates/nuxt/components/form/user/{FormUserPermission.vue.eta → FormUserPermission.vue._eta} +6 -0
  66. package/templates/nuxt/components/header/{HeaderBreadcrumb.vue.eta → HeaderBreadcrumb.vue._eta} +2 -2
  67. package/templates/nuxt/components/header/button/{HeaderButtonProfile.vue.eta → HeaderButtonProfile.vue._eta} +2 -2
  68. package/templates/nuxt/components/header/button/task/{HeaderButtonTaskList.vue.eta → HeaderButtonTaskList.vue._eta} +2 -2
  69. package/templates/nuxt/components/image/ImageAvatar.vue.eta +29 -30
  70. package/templates/nuxt/components/image/ImageOrganization.vue.eta +15 -9
  71. package/templates/nuxt/components/image/ImageToBase64Uploader.vue.eta +28 -18
  72. package/templates/nuxt/components/list/{ListDocumentTable.vue.eta → ListDocumentTable.vue._eta} +2 -2
  73. package/templates/nuxt/components/list/{ListItem.vue.eta → ListItem.vue._eta} +2 -2
  74. package/templates/nuxt/components/list/{ListMessages.vue.eta → ListMessages.vue._eta} +6 -0
  75. package/templates/nuxt/components/list/{ListView.vue.eta → ListView.vue._eta} +2 -2
  76. package/templates/nuxt/components/overlay/{OverlayPanelWithToolBar.vue.eta → OverlayPanelWithToolBar.vue._eta} +2 -2
  77. package/templates/nuxt/components/overlay/{OverlaySideBarCrud.vue.eta → OverlaySideBarCrud.vue._eta} +2 -2
  78. package/templates/nuxt/components/overlay/{OverlayViewer.vue.eta → OverlayViewer.vue._eta} +2 -2
  79. package/templates/nuxt/components/page/{PageDocList.vue.eta → PageDocList.vue._eta} +2 -2
  80. package/templates/nuxt/components/renderer/{RendererDateTime.vue.eta → RendererDateTime.vue._eta} +2 -2
  81. package/templates/nuxt/components/renderer/{RendererDocHistories.vue.eta → RendererDocHistories.vue._eta} +6 -0
  82. package/templates/nuxt/components/renderer/{RendererForeignKey.vue.eta → RendererForeignKey.vue._eta} +2 -2
  83. package/templates/nuxt/components/renderer/{RendererLink.vue.eta → RendererLink.vue._eta} +2 -2
  84. package/templates/nuxt/components/renderer/{RendererTime.vue.eta → RendererTime.vue._eta} +2 -2
  85. package/templates/nuxt/components/renderer/{RendererViewer.vue.eta → RendererViewer.vue._eta} +2 -2
  86. package/templates/nuxt/components/select/{SelectTemplate.vue.eta → SelectTemplate.vue._eta} +2 -2
  87. package/templates/nuxt/components/session/{SessionBlock.vue.eta → SessionBlock.vue._eta} +2 -2
  88. package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +55 -55
  89. package/templates/nuxt/components/simpleApp/SimpleAppCalendarInput.vue.eta +13 -11
  90. package/templates/nuxt/components/simpleApp/SimpleAppChildrenList.vue.eta +6 -3
  91. package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +32 -27
  92. package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +19 -28
  93. package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +114 -105
  94. package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +3 -3
  95. package/templates/nuxt/components/simpleApp/SimpleAppJsonSchemaForm.vue.eta +1 -1
  96. package/templates/nuxt/components/simpleApp/SimpleAppUserPicker.vue.eta +10 -12
  97. package/templates/nuxt/components/table/{TableDocuments.vue.eta → TableDocuments.vue._eta} +2 -2
  98. package/templates/nuxt/components/user/{UserButtonPermissionInfo.vue.eta → UserButtonPermissionInfo.vue._eta} +2 -2
  99. package/templates/nuxt/components/user/{UserInvitation.vue.eta → UserInvitation.vue._eta} +2 -2
  100. package/templates/nuxt/components/user/{UserProfileListItem.vue.eta → UserProfileListItem.vue._eta} +2 -2
  101. package/templates/nuxt/components/user/{UserTenantPicker.vue.eta → UserTenantPicker.vue._eta} +2 -2
  102. package/templates/nuxt/composables/getOpenApi.generate.ts.eta +11 -3
  103. package/templates/nuxt/composables/getUserStore.generate.ts.eta +1 -1
  104. package/templates/nuxt/composables/graphquery.generate.ts.eta +1 -1
  105. package/templates/nuxt/composables/recently.generate.ts.eta +0 -1
  106. package/templates/nuxt/composables/stringHelper.generate.ts.eta +5 -2
  107. package/templates/nuxt/pages/[xorg]/docnoformat/[id].vue.eta +0 -1
  108. package/templates/nuxt/pages/[xorg]/{docnoformat.vue.eta → docnoformat.vue._eta} +1 -0
  109. package/templates/nuxt/pages/[xorg]/organization/[id].vue.eta +13 -9
  110. package/templates/nuxt/pages/[xorg]/organization/new.vue.eta +10 -12
  111. package/templates/nuxt/pages/[xorg]/{user.vue.eta → user.vue._eta} +2 -2
  112. package/templates/nuxt/pages/{profile.vue.eta → profile.vue._eta} +2 -2
  113. package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +6 -0
  114. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +89 -12
  115. package/templates/nuxt/plugins/40.pusher.ts.eta +6 -9
  116. package/templates/nuxt/providers/my-provider.ts.eta +1 -1
  117. package/templates/nuxt/server/api/profile/[...].ts.eta +4 -3
  118. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +8 -4
  119. package/templates/nuxt/types/schema.ts.eta +1 -1
  120. package/templates/nuxt/types/user.ts.eta +6 -1
  121. package/templates/project/jsonschemas/appintegration.json_eta +227 -0
  122. package/templates/project/sharelibs/validate.ts.eta +1 -1
  123. package/dist/buildinschemas/message.d.ts +0 -3
  124. package/dist/buildinschemas/message.d.ts.map +0 -1
  125. package/dist/buildinschemas/message.js +0 -34
  126. package/dist/buildinschemas/message.js.map +0 -1
  127. package/dist/buildinschemas/webhookhistory.d.ts +0 -3
  128. package/dist/buildinschemas/webhookhistory.d.ts.map +0 -1
  129. package/dist/buildinschemas/webhookhistory.js +0 -44
  130. package/dist/buildinschemas/webhookhistory.js.map +0 -1
  131. package/dist/createproject.js +0 -138
  132. package/dist/createproject.js.map +0 -1
  133. package/dist/generate-allow-changebackend.js +0 -305
  134. package/dist/generate-allow-changebackend.js.map +0 -1
  135. package/dist/index2.js +0 -118
  136. package/dist/index2.js.map +0 -1
  137. package/dist/installdependency.js +0 -20
  138. package/dist/installdependency.js.map +0 -1
  139. package/dist/installnest.js +0 -2
  140. package/dist/installnest.js.map +0 -1
  141. package/dist/installnuxt.js +0 -2
  142. package/dist/installnuxt.js.map +0 -1
  143. package/dist/processors/groupsbuilder.js +0 -2
  144. package/dist/processors/groupsbuilder.js.map +0 -1
  145. package/dist/schematype/baseschema.js +0 -25
  146. package/dist/schematype/baseschema.js.map +0 -1
  147. package/dist/schematype/default.js +0 -2
  148. package/dist/schematype/default.js.map +0 -1
  149. package/dist/schematype/index.js +0 -12
  150. package/dist/schematype/index.js.map +0 -1
  151. package/dist/schematype/primarymasterdata.js +0 -38
  152. package/dist/schematype/primarymasterdata.js.map +0 -1
  153. package/dist/schematype/simple.js +0 -24
  154. package/dist/schematype/simple.js.map +0 -1
  155. package/dist/schematype/simplemasterdata.js +0 -31
  156. package/dist/schematype/simplemasterdata.js.map +0 -1
  157. package/dist/schematype/transaction.js +0 -74
  158. package/dist/schematype/transaction.js.map +0 -1
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import * as o from "../simpleapp/generate/openapi";
9
- import axios from 'axios'
9
+ import axios, { AxiosInstance } from 'axios'
10
10
 
11
11
 
12
12
  export const getAxiosConfig = () => {
@@ -15,15 +15,23 @@ export const getAxiosConfig = () => {
15
15
 
16
16
  const suffix = xorgdecode.includes('-') ? '/'+getCurrentXorg() : ''
17
17
  const config: o.Configuration = {
18
- basePath: `${useRuntimeConfig().public.APP_URL}/api${suffix}`,
18
+ basePath: `${useRuntimeConfig().public.appUrl}/api${suffix}`,
19
19
  isJsonMime: () => true,
20
20
  };
21
21
  return config
22
22
  }
23
23
 
24
+ export const getDocumentApiClass = <T>(ApiClass: new (config: o.Configuration, basePath?: string, axios?: AxiosInstance) => T): T => {
25
+ const config = getAxiosConfig();
26
+ const axios = useNuxtApp().$axios;
27
+ const api = new ApiClass(config, undefined, axios);
28
+ return api;
29
+ }
30
+
31
+
24
32
  //get apisession exclude from shared axios to separate handle session
25
33
  export const getApiSession = async ()=> {
26
- console.log("getApiSession from computable")
34
+ // console.log("getApiSession from computable")
27
35
  return getUserStore().pingSession()
28
36
  //,useNuxtApp().$axios)
29
37
  // const profileapi = new o.PROFILEApi(getAxiosConfig(),undefined)
@@ -1,4 +1,4 @@
1
- import { getUserProfile } from './getUserStore.generate';
1
+ // import { getUserProfile } from './getUserStore.generate';
2
2
  /**
3
3
  * This file was automatically generated by simpleapp generator. Every
4
4
  * MODIFICATION OVERRIDE BY GENERATEOR
@@ -10,7 +10,7 @@ import { createHttpLink, } from '@apollo/client/core';
10
10
  export const setGraphqlServer=()=>{
11
11
  const apolloclient = useNuxtApp().$apollo.defaultClient
12
12
  const newlink = createHttpLink({
13
- uri: `${useRuntimeConfig().public.API_URL}/${getCurrentXorg()}/graphql`,
13
+ uri: `${useRuntimeConfig().public.apiUrl}/${getCurrentXorg()}/graphql`,
14
14
  })
15
15
  apolloclient.setLink(newlink)
16
16
  apolloclient.defaultOptions={
@@ -7,7 +7,6 @@ export const setRecentDocument = (key:string, value:RecentlyValue)=>{
7
7
  recent.forEach((value,key)=>{
8
8
  tmp[key]=value
9
9
  })
10
- console.log("JSON.stringify(tmp)",tmp)
11
10
  localStorage.setItem('recently', JSON.stringify(tmp)); // Store keys as an array
12
11
 
13
12
  }
@@ -23,7 +23,7 @@ export const md5=(s:string)=> new Md5().appendStr(s).end()
23
23
  // }
24
24
  export const getAvatarByUid = (id:string, size?:number):string=>{
25
25
  if(size===undefined)size=160
26
- return `${useRuntimeConfig().public.AVATAR_URL}/${md5(id)}?size=${size}`
26
+ return `${useRuntimeConfig().public.avatarUrl}/${md5(id)}?size=${size}`
27
27
  }
28
28
  export const updateAvatarVersion = ()=>{
29
29
  myAvatarVersion.value++
@@ -32,7 +32,10 @@ export const updateAvatarVersion = ()=>{
32
32
  export const getAvatarVersion = ()=>myAvatarVersion
33
33
 
34
34
  export const getDefaultLocale =()=> useNuxtApp().$i18n.defaultLocale
35
- export const t = (txt:string,options?:any):string => typeof txt !='string' ?'' : useNuxtApp().$i18n.t(txt.trim(),options)
35
+ export const t = (txt:string,options?:any):string => {
36
+ if (!txt || typeof txt !='string') return ''
37
+ return useNuxtApp().$i18n.t(txt.trim(),options)
38
+ }
36
39
  export const upperFirst = (str:string) => _.upperFirst(str)
37
40
  export const labelSorter = (a,b)=>{
38
41
  const nameA = a.label.toUpperCase(); // ignore upper and lowercase
@@ -14,7 +14,6 @@ const doc = useNuxtApp().$DocnoformatDoc();
14
14
 
15
15
  const props = defineProps<{ _id: string }>();
16
16
  const after = (actionName: string, data: Docnoformat) => {
17
- console.log("Docnoformat capture after emits ", actionName);
18
17
  switch (actionName) {
19
18
  case "new":
20
19
  goTo(doc.getDocName(), "new");
@@ -32,6 +32,7 @@
32
32
  <script setup lang="ts">
33
33
  /**
34
34
  * This file was automatically generated by simpleapp generator.
35
+ * --remove-this-line-to-prevent-override--
35
36
  * last change 2023-09-09
36
37
  * author: Ks Tan
37
38
  */
@@ -14,24 +14,28 @@ const doc = useNuxtApp().$BranchDoc();
14
14
 
15
15
  const props = defineProps<{ _id: string }>();
16
16
  const after = (actionName: string, data: Branch) => {
17
- console.log("Branch capture after emits ", actionName,doc.getDocName().toLowerCase());
17
+ // console.log(
18
+ // "Branch capture after emits ",
19
+ // actionName,
20
+ // doc.getDocName().toLowerCase(),
21
+ // );
18
22
  switch (actionName) {
19
23
  case "new":
20
- goTo('organization');
24
+ goTo("organization");
21
25
  break;
22
26
  case "create":
23
- goTo('organization');
24
- refreshDocumentList('branch');
27
+ goTo("organization");
28
+ refreshDocumentList("branch");
25
29
  useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
26
30
  break;
27
31
  case "update":
28
- goTo('organization');
29
- refreshDocumentList('branch');
30
- useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
32
+ goTo("organization");
33
+ refreshDocumentList("branch");
34
+ useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
31
35
  break;
32
36
  case "delete":
33
- goTo('organization');
34
- refreshDocumentList('branch');
37
+ goTo("organization");
38
+ refreshDocumentList("branch");
35
39
  useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
36
40
  break;
37
41
  }
@@ -12,26 +12,24 @@
12
12
  import { Branch } from "~/simpleapp/generate/types";
13
13
  const doc = useNuxtApp().$BranchDoc();
14
14
 
15
-
16
15
  const after = (actionName: string, data: Branch) => {
17
- console.log("Branch capture after emits ", actionName,'branch');
16
+ // console.log("Branch capture after emits ", actionName, "branch");
18
17
  switch (actionName) {
19
18
  case "create":
20
- goTo('organization');
21
- refreshDocumentList('branch');
22
- useNuxtApp().$event("CloseDialog", 'branch');
19
+ goTo("organization");
20
+ refreshDocumentList("branch");
21
+ useNuxtApp().$event("CloseDialog", "branch");
23
22
  break;
24
23
  case "update":
25
- goTo('organization');
26
- refreshDocumentList('branch');
27
- useNuxtApp().$event("CloseDialog", 'branch');
28
-
24
+ goTo("organization");
25
+ refreshDocumentList("branch");
26
+ useNuxtApp().$event("CloseDialog", "branch");
29
27
 
30
28
  break;
31
29
  case "delete":
32
- goTo('organization');
33
- refreshDocumentList('branch');
34
- useNuxtApp().$event("CloseDialog", 'branch');
30
+ goTo("organization");
31
+ refreshDocumentList("branch");
32
+ useNuxtApp().$event("CloseDialog", "branch");
35
33
  break;
36
34
  }
37
35
  };
@@ -83,8 +83,8 @@
83
83
 
84
84
  <script setup lang="ts">
85
85
  /**
86
- * This file was automatically generated by simpleapp generator. Every
87
- * MODIFICATION OVERRIDE BY GENERATEOR
86
+ * This file was automatically generated by simpleapp generator during initialization. It is changable.
87
+ * --remove-this-line-to-prevent-override--
88
88
  * last change 2023-10-28
89
89
  * Author: Ks Tan
90
90
  */
@@ -123,8 +123,8 @@
123
123
  </template>
124
124
  <script setup lang="ts">
125
125
  /**
126
- * This file was automatically generated by simpleapp generator. Every
127
- * MODIFICATION OVERRIDE BY GENERATEOR
126
+ * This file was automatically generated by simpleapp generator during initialization. It is changable.
127
+ * --remove-this-line-to-prevent-override--
128
128
  * last change 2023-10-28
129
129
  * Author: Ks Tan
130
130
  */
@@ -69,6 +69,12 @@ export default defineNuxtPlugin( async(nuxtApp) => {
69
69
  console.error("unknown error")
70
70
  throw createError({statusCode:500,statusMessage:"Internal server error"})
71
71
  }
72
+ // if (error.response) {
73
+ // console.error("Backend error response:", error.response.data);
74
+ // } else {
75
+ // console.error("Network error:", error);
76
+ // }
77
+ return Promise.reject(error);
72
78
  });
73
79
  return {
74
80
  provide: {
@@ -39,7 +39,12 @@ export default defineNuxtPlugin( async(nuxtApp) => {
39
39
  branches:ref([]),
40
40
  invites : ref([]),
41
41
  time:ref(''),
42
- moreProps:ref()
42
+ moreProps:ref(),
43
+ package: ref(),
44
+ appintegration: ref({
45
+ einvoice: false,
46
+ simbiz6: false
47
+ })
43
48
  }),
44
49
 
45
50
  actions:{
@@ -52,9 +57,9 @@ export default defineNuxtPlugin( async(nuxtApp) => {
52
57
 
53
58
  let apiurl=''
54
59
  if(xorg===undefined){
55
- apiurl = `${useRuntimeConfig().public.APP_URL}/api`
60
+ apiurl = `${useRuntimeConfig().public.appUrl}/api`
56
61
  }else{
57
- apiurl = `${useRuntimeConfig().public.APP_URL}/api/${xorg}`
62
+ apiurl = `${useRuntimeConfig().public.appUrl}/api/${xorg}`
58
63
  }
59
64
 
60
65
  return await new PROFILEApi(undefined,apiurl,$axios).getProfile().then((res:AxiosResponse)=>{
@@ -85,14 +90,15 @@ export default defineNuxtPlugin( async(nuxtApp) => {
85
90
  this.time = res.data.time
86
91
  this.invites = res.data.invites
87
92
  this.moreProps = res.data.moreProps
88
-
93
+ this.package = res.data.moreProps.package;
94
+ this.appintegration.einvoice = res.data.appintegration.einvoice;
95
+ this.appintegration.simbiz6 = res.data.appintegration.simbiz6;
89
96
  let cachegroup = useCookie('currentGroup').value ?? ''
90
97
  if(!this.groups || !this.groups.includes(cachegroup)){
91
98
  cachegroup=''
92
99
  }
93
100
  this.currentGroup = cachegroup
94
101
  useNuxtApp().$event('pickGroup',cachegroup)
95
-
96
102
  return Promise.resolve(true)
97
103
  // return true
98
104
  }).catch((err:any)=>{
@@ -107,12 +113,12 @@ export default defineNuxtPlugin( async(nuxtApp) => {
107
113
  let apiurl=''
108
114
 
109
115
  if(!xorg){
110
- apiurl = `${useRuntimeConfig().public.APP_URL}/api`
116
+ apiurl = `${useRuntimeConfig().public.appUrl}/api`
111
117
  }else{
112
118
  try{
113
119
  const xorgdecode = atob(<string>xorg)
114
120
  if(xorgdecode.includes('-')){
115
- apiurl = `${useRuntimeConfig().public.APP_URL}/api/${xorg}`
121
+ apiurl = `${useRuntimeConfig().public.appUrl}/api/${xorg}`
116
122
  }else{
117
123
  return Promise.reject('wrongxorg')
118
124
  }
@@ -135,7 +141,7 @@ export default defineNuxtPlugin( async(nuxtApp) => {
135
141
 
136
142
  },
137
143
  async decideInvitation(id:string,decision:string){
138
- const apiurl = `${useRuntimeConfig().public.APP_URL}/api`
144
+ const apiurl = `${useRuntimeConfig().public.appUrl}/api`
139
145
  const {$axios} = useNuxtApp()
140
146
  // console.log("decideInvitation",id,decision)
141
147
  const result = await new PROFILEApi(undefined,apiurl,$axios).decideInvitation(id,decision)
@@ -155,11 +161,70 @@ export default defineNuxtPlugin( async(nuxtApp) => {
155
161
  this.roles.includes('superuser')
156
162
  ){
157
163
  return true
158
- }else{
164
+ }else if( resourcename == 'Paymentverify'){
165
+ if (
166
+ this.roles.includes('admin') ||
167
+ this.roles.includes('manager')
168
+ ){
169
+ return true;
170
+ }
171
+ }
172
+ else if( resourcename == 'Reminder'){
173
+ if (
174
+ this.roles.includes('admin') ||
175
+ this.roles.includes('manager')
176
+ ){
177
+ return true;
178
+ }
179
+ }
180
+ else if( resourcename == 'Generateinvoice'){
181
+ if (
182
+ this.roles.includes('admin') ||
183
+ this.roles.includes('manager') ||
184
+ this.roles.includes('executive')
185
+ ){
186
+ return true;
187
+ }
188
+ }
189
+ else if( resourcename == 'Upgradelevel'){
190
+ if (
191
+ this.roles.includes('admin') ||
192
+ this.roles.includes('manager') ||
193
+ this.roles.includes('executive')
194
+ ){
195
+ return true;
196
+ }
197
+ }
198
+ else if( resourcename == 'Appintegration'){
199
+ if (
200
+ this.roles.includes('admin') ||
201
+ this.roles.includes('manager')
202
+ ){
203
+ return true;
204
+ }
205
+ }
206
+ else if( resourcename == 'Postingtosimbiz'){
207
+ if (
208
+ this.roles.includes('admin')
209
+ ){
210
+ return true;
211
+ }
212
+ }
213
+ else if( resourcename == 'Studentdescription'){
214
+ if (
215
+ this.roles.includes('admin') ||
216
+ this.roles.includes('manager') ||
217
+ this.roles.includes('executive')
218
+ ){
219
+ return true;
220
+ }
221
+ }
222
+ else{
159
223
  const checkstr= `${resourcename}:${action}`
160
224
  // console.log("verify",checkstr)
161
225
  return this.roles.includes(checkstr)
162
226
  }
227
+ return false;
163
228
  },
164
229
  haveAccess(resourcename:string){
165
230
  //super admin always full access right
@@ -172,6 +237,14 @@ export default defineNuxtPlugin( async(nuxtApp) => {
172
237
  ){
173
238
  return true
174
239
  }
240
+ else if( resourcename == 'Paymentverify'){
241
+ if (
242
+ this.roles.includes('admin') ||
243
+ this.roles.includes('manager')
244
+ ){
245
+ return true;
246
+ }
247
+ }
175
248
  for(let i=0; i< this.roles.length; i++){
176
249
  const role:string = this.roles[i]
177
250
  if(role.includes(resourcename)){
@@ -216,11 +289,15 @@ export default defineNuxtPlugin( async(nuxtApp) => {
216
289
  groups:this.groups,
217
290
  currentGroup:this.currentGroup,
218
291
  time:this.time,
219
- moreProps: this.moreProps
220
-
292
+ moreProps: this.moreProps,
293
+ package: this.package,
294
+ appintegration: this.appintegration
221
295
  }
222
296
  return userinfo
223
- }
297
+ },
298
+ isExecutive() {
299
+ return this.currentGroup == 'executive';
300
+ },
224
301
  }
225
302
  })
226
303
 
@@ -7,16 +7,13 @@
7
7
  import { defineNuxtPlugin } from "#app";
8
8
  import Pusher from 'pusher-js';
9
9
  export default defineNuxtPlugin( async(nuxtApp) => {
10
- const pusherkey = (useRuntimeConfig().app.PUSHER_KEY ?? '') as string
11
- const pushercluster = (useRuntimeConfig().app.PUSHER_CLUSTER ?? '') as string
12
- let pusher = null;
13
- if (pusherkey && pushercluster){
14
- pusher = new Pusher(pusherkey, {
15
- cluster: pushercluster
16
- });
10
+ const pusherkey = (useRuntimeConfig().app.pusherKey ?? '') as string
11
+ const pushercluster = (useRuntimeConfig().app.pusherCluster ?? '') as string
12
+ let pusher: Pusher | null = null;
13
+ if (pusherkey && pushercluster) {
14
+ pusher = new Pusher(pusherkey, { cluster: pushercluster,});
17
15
  }
18
-
19
- return {
16
+ return {
20
17
  provide: {
21
18
  pusher: pusher
22
19
  }
@@ -11,7 +11,7 @@ export const getImage: ProviderGetImage = (
11
11
 
12
12
  if (!baseURL) {
13
13
  // also support runtime config
14
- baseURL = useRuntimeConfig().public.API_URL
14
+ baseURL = useRuntimeConfig().public.apiUrl
15
15
  }
16
16
 
17
17
  const operations = operationsGenerator(modifiers)
@@ -8,6 +8,7 @@
8
8
  import axios from 'axios';
9
9
  import { getServerSession } from '#auth'
10
10
  import type { Session } from 'next-auth';
11
+ import { pathJoin } from '~/server/utils/path';
11
12
 
12
13
  export default defineEventHandler(async (event:any) => {
13
14
  type additionalprops = {accessToken?:string}
@@ -45,7 +46,7 @@ export default defineEventHandler(async (event:any) => {
45
46
  // }
46
47
 
47
48
  const frontEndRes = event.node.res;
48
-
49
+
49
50
  const url = process.env.SIMPLEAPP_BACKEND_URL + `/profile/${documentLink}`;
50
51
  // console.warn('backend server-----',req.method,url,forwardData)
51
52
 
@@ -61,7 +62,7 @@ export default defineEventHandler(async (event:any) => {
61
62
  }
62
63
 
63
64
  if(documentLink=='avatar' ){
64
- axiosConfig.url = process.env.AVATAR_URL
65
+ axiosConfig.url = pathJoin([useRuntimeConfig().public.avatarUrl, documentLink]);
65
66
  delete axiosConfig.params
66
67
  }
67
68
  // console.log("axiosConfig",axiosConfig)
@@ -124,7 +125,7 @@ export default defineEventHandler(async (event:any) => {
124
125
  resolve(res.data);
125
126
  }
126
127
 
127
- }).catch((error) => {
128
+ }).catch((error) => {
128
129
  if(!error?.response){
129
130
  console.log("backend server no response ",error.code)
130
131
  reject({
@@ -133,7 +133,7 @@ export class SimpleAppClient<
133
133
  documentName:this.getDocName(),
134
134
  summary:'Record create failed',
135
135
  status:NotificationStatus.error,
136
- data:errors.response.data
136
+ data:errors.response.data.statusMessage
137
137
  })
138
138
  console.error('error:create',errors.response.data)
139
139
  setTimeout(()=>{
@@ -183,7 +183,7 @@ export class SimpleAppClient<
183
183
  documentName:this.getDocName(),
184
184
  summary:'Record update failed',
185
185
  status:NotificationStatus.error,
186
- data:errors.response.data
186
+ data:errors.response.data.statusMessage
187
187
  })
188
188
  // console.error('error:update---',errors,",---",errors.message)
189
189
  // if(this.event){
@@ -224,7 +224,7 @@ export class SimpleAppClient<
224
224
  documentName:this.getDocName(),
225
225
  summary:'Record patch failed',
226
226
  status:NotificationStatus.error,
227
- data:errors.response.data
227
+ data:errors.response.data.statusMessage
228
228
  })
229
229
  // console.error('error:update---',errors,",---",errors.message)
230
230
  // if(this.event){
@@ -266,7 +266,7 @@ export class SimpleAppClient<
266
266
  documentName:this.getDocName(),
267
267
  summary:'Record delete failed',
268
268
  status:NotificationStatus.error,
269
- data:errors.response.data
269
+ data:errors.response.data.statusMessage
270
270
  })
271
271
  console.error(errors.response.data)
272
272
  setTimeout(()=>{
@@ -338,6 +338,10 @@ export class SimpleAppClient<
338
338
  }
339
339
 
340
340
  async runFullTextSearh(body:TextSearchBody) {
341
+ if(!this.docapi.runFullTextSearch){
342
+ return [];
343
+ }
344
+
341
345
  const response = await this.docapi.runFullTextSearch(body)
342
346
  return response.data
343
347
  }
@@ -196,5 +196,5 @@ export type SchemaFields = {
196
196
  default?: JSONSchema7Type | undefined;
197
197
  readOnly?: boolean | undefined;
198
198
  writeOnly?: boolean | undefined;
199
- example?: JSONSchema7Type | undefined;
199
+ examples?: JSONSchema7Type[] | undefined;
200
200
  }
@@ -85,5 +85,10 @@ export type UserProfile = {
85
85
  groups: string[]
86
86
  currentGroup:string
87
87
  time: string
88
- moreProps: any
88
+ moreProps: any
89
+ package: 'free' | 'lite' | 'pro' | 'enterprise' | 'enterprisePlus'
90
+ appintegration: {
91
+ einvoice: boolean
92
+ simbiz6: boolean
93
+ }
89
94
  }