@simitgroup/simpleapp-generator 1.6.7-g-alpha → 1.6.7-i-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 (73) hide show
  1. package/ReleaseNote.md +12 -1
  2. package/dist/generate.js +2 -0
  3. package/dist/generate.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/generate.ts +2 -0
  6. package/templates/basic/miniApi/resource.controller.ts.eta +10 -3
  7. package/templates/basic/miniApi/resource.service.ts.eta +9 -2
  8. package/templates/basic/nest/apischema.ts.eta +21 -6
  9. package/templates/basic/nest/controller.ts.eta +37 -16
  10. package/templates/basic/nuxt/resource-bridge.service.ts.eta +3 -2
  11. package/templates/miniApi/src/constants/api-scopes.ts.eta +1 -1
  12. package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +34 -14
  13. package/templates/nest/src/simpleapp/generate/commons/robotuser.service.ts.eta +4 -8
  14. package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +154 -17
  15. package/templates/nuxt/composables/getUserStore.generate.ts.eta +62 -66
  16. package/templates/nuxt/composables/goTo.generate.ts.eta +1 -3
  17. package/templates/nuxt/plugins/19.simpleapp-mini-app-store.ts.eta +240 -203
  18. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +1 -1
  19. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppFeatureCustomField.vue.eta +34 -0
  20. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppFeatureCustomPage.vue.eta +68 -0
  21. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppFeatureScope.vue.eta +53 -0
  22. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppIcon.vue.eta +49 -0
  23. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppMenuButton.vue.eta +6 -4
  24. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppPageIframe.vue.eta +9 -3
  25. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppPermissionWrapper.vue.eta +4 -4
  26. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppRestrictedWarning.vue.eta +3 -3
  27. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppSettingLayout.vue.eta +3 -3
  28. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppSettingPage.vue.eta +2 -2
  29. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppWrapper.vue.eta +2 -32
  30. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/integration/MiniAppIntegrationItem.vue.eta +6 -5
  31. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/integration/MiniAppIntegrationItemBadge.vue.eta +15 -9
  32. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/integration/MiniAppIntegrationItemGroup.vue.eta +4 -4
  33. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/integration/MiniAppIntegrationPage.vue.eta +135 -22
  34. package/templates/nuxt/simpleapp/generate/features/miniApp/app/types/miniApp.ts.eta +7 -7
  35. package/templates/nuxt/simpleapp/generate/features/miniApp/bridge/services/bridge-resource-accessor.service.ts.eta +3 -1
  36. package/templates/nuxt/simpleapp/generate/features/miniApp/bridge/services/bridge.service.ts.eta +3 -0
  37. package/templates/nuxt/types/others.ts.eta +5 -0
  38. package/dist/buildinschemas/message.d.ts +0 -3
  39. package/dist/buildinschemas/message.d.ts.map +0 -1
  40. package/dist/buildinschemas/message.js +0 -34
  41. package/dist/buildinschemas/message.js.map +0 -1
  42. package/dist/buildinschemas/webhookhistory.d.ts +0 -3
  43. package/dist/buildinschemas/webhookhistory.d.ts.map +0 -1
  44. package/dist/buildinschemas/webhookhistory.js +0 -44
  45. package/dist/buildinschemas/webhookhistory.js.map +0 -1
  46. package/dist/createproject.js +0 -138
  47. package/dist/createproject.js.map +0 -1
  48. package/dist/generate-allow-changebackend.js +0 -305
  49. package/dist/generate-allow-changebackend.js.map +0 -1
  50. package/dist/index2.js +0 -118
  51. package/dist/index2.js.map +0 -1
  52. package/dist/installdependency.js +0 -20
  53. package/dist/installdependency.js.map +0 -1
  54. package/dist/installnest.js +0 -2
  55. package/dist/installnest.js.map +0 -1
  56. package/dist/installnuxt.js +0 -2
  57. package/dist/installnuxt.js.map +0 -1
  58. package/dist/processors/groupsbuilder.js +0 -2
  59. package/dist/processors/groupsbuilder.js.map +0 -1
  60. package/dist/schematype/baseschema.js +0 -25
  61. package/dist/schematype/baseschema.js.map +0 -1
  62. package/dist/schematype/default.js +0 -2
  63. package/dist/schematype/default.js.map +0 -1
  64. package/dist/schematype/index.js +0 -12
  65. package/dist/schematype/index.js.map +0 -1
  66. package/dist/schematype/primarymasterdata.js +0 -38
  67. package/dist/schematype/primarymasterdata.js.map +0 -1
  68. package/dist/schematype/simple.js +0 -24
  69. package/dist/schematype/simple.js.map +0 -1
  70. package/dist/schematype/simplemasterdata.js +0 -31
  71. package/dist/schematype/simplemasterdata.js.map +0 -1
  72. package/dist/schematype/transaction.js +0 -74
  73. package/dist/schematype/transaction.js.map +0 -1
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div
3
+ class="drop-shadow-[0_10px_8px_rgba(197,197,197,0.25)]"
4
+ :class="{
5
+ 'size-20': size === 'xl',
6
+ 'size-16': size === 'lg',
7
+ 'size-14': !size || size === 'normal',
8
+ 'size-8': size === 'xs',
9
+ 'size-7': size === 'tiny',
10
+ 'size-6': size === 'tiny-1',
11
+ }"
12
+ >
13
+ <PrimevueAvatar
14
+ :image
15
+ :label="image ? undefined : displayLabel"
16
+ class="squircle !size-full aspect-square"
17
+ :class="{
18
+ 'text-xl': size === 'lg',
19
+ 'text-lg': !size || size === 'normal',
20
+ 'text-xs': size === 'xs',
21
+ 'text-6xl': size === 'xl',
22
+ 'text-tiny': size === 'tiny' || size === 'tiny-1',
23
+ }"
24
+ style="background-color: #dee9fc; color: #1a2551"
25
+ />
26
+ </div>
27
+ </template>
28
+
29
+ <script setup lang="ts">
30
+ import _ from "lodash";
31
+ import PrimevueAvatar from "primevue/avatar";
32
+
33
+ const props = defineProps<{
34
+ image?: string;
35
+ label?: string;
36
+ size?: "lg" | "normal" | "xs" | "xl" | "tiny" | "tiny-1";
37
+ }>();
38
+
39
+ const displayLabel = computed(() => {
40
+ if (!props.label) return undefined;
41
+
42
+ return props.label
43
+ .trim()
44
+ .split(/\s+/)
45
+ .slice(0, 2)
46
+ .map((word) => word.charAt(0).toUpperCase())
47
+ .join("");
48
+ });
49
+ </script>
@@ -30,9 +30,10 @@
30
30
  :title="miniApp.name"
31
31
  >
32
32
  <template #icon>
33
- <img
34
- :src="miniApp.logo"
35
- class="size-6 rounded-md object-contain"
33
+ <MiniAppIcon
34
+ :image="miniApp.logo"
35
+ :label="miniApp.name"
36
+ size="tiny"
36
37
  />
37
38
  </template>
38
39
  <template #title>
@@ -77,7 +78,7 @@
77
78
  </div>
78
79
  </template>
79
80
 
80
- <template v-if="$miniAppStore.isShowMiniAppMoreMenuButton">
81
+ <template v-if="$miniAppStore.showMiniAppMoreMenuButton">
81
82
  <MainmenuButton
82
83
  :id="'mainmenu-app-miniApps-page-more'"
83
84
  :to="getDocumentUrl('miniapp')"
@@ -96,6 +97,7 @@
96
97
  <script setup lang="ts">
97
98
  import IconPuzzle from "~/components/icon/IconPuzzle.vue";
98
99
  import MiniAppPageIcon from "./MiniAppPageIcon.vue";
100
+ import MiniAppIcon from "./MiniAppIcon.vue";
99
101
 
100
102
  const { $miniAppStore } = useNuxtApp();
101
103
  const displayItemCount = 3;
@@ -23,12 +23,17 @@
23
23
  </template>
24
24
 
25
25
  <script setup lang="ts">
26
- import { MiniappIntegrationPages } from "~/simpleapp/generate/openapi";
26
+ import {
27
+ MiniAppDetail,
28
+ MiniappIntegrationCustomPagePages,
29
+ } from "~/simpleapp/generate/openapi";
27
30
 
28
31
  const props = defineProps<{
29
- pageInfo: MiniappIntegrationPages;
32
+ miniApp: MiniAppDetail;
33
+ pageInfo: MiniappIntegrationCustomPagePages;
30
34
  miniAppCode: string;
31
35
  miniAppInstallationId: string;
36
+ developerPortalAppId: string;
32
37
  }>();
33
38
 
34
39
  const _xOrg = getPathPara("xorg", "");
@@ -52,10 +57,11 @@ const { iframeRef, onIframeLoad } = useMiniAppBridge(
52
57
  props.miniAppInstallationId,
53
58
  props.pageInfo,
54
59
  props.miniAppCode,
60
+ props.developerPortalAppId,
55
61
  );
56
62
 
57
63
  const iframeSource = computed(() => {
58
- return isDevMode()
64
+ return props.miniApp.env === "dev"
59
65
  ? props.pageInfo.sources.development
60
66
  : props.pageInfo.sources.production;
61
67
  });
@@ -1,17 +1,17 @@
1
1
  <template>
2
2
  <MiniAppRestrictedWarning
3
- v-if="!permission.status"
4
- :reason="permission.reason ?? ''"
3
+ v-if="!validation.valid"
4
+ :type="validation.type ?? ''"
5
5
  class="flex items-center justify-center mt-10"
6
6
  />
7
7
  <slot v-else />
8
8
  </template>
9
9
 
10
10
  <script setup lang="ts">
11
- import { MiniAppPermissionResult } from "../types/miniApp";
11
+ import { MiniAppValidationResp } from "../types/miniApp";
12
12
  import MiniAppRestrictedWarning from "./MiniAppRestrictedWarning.vue";
13
13
 
14
14
  defineProps<{
15
- permission: MiniAppPermissionResult;
15
+ validation: MiniAppValidationResp;
16
16
  }>();
17
17
  </script>
@@ -3,11 +3,11 @@
3
3
  <span
4
4
  class="px-3 py-1 text-sm font-semibold rounded bg-yellow-100 text-yellow-800"
5
5
  >
6
- {{ t(`miniAppLang.${reason}`) }}
6
+ {{ t(`miniAppLang.permission.${type}`) }}
7
7
  </span>
8
8
 
9
9
  <ButtonPrimary
10
- v-if="reason === 'packageTypeRestricted'"
10
+ v-if="type === 'miniAppFeature'"
11
11
  :label="t('miniAppLang.upgradePlan')"
12
12
  @click="handleUpgradePlan"
13
13
  />
@@ -16,7 +16,7 @@
16
16
 
17
17
  <script setup lang="ts">
18
18
  defineProps<{
19
- reason: string;
19
+ type: string;
20
20
  }>();
21
21
 
22
22
  function handleUpgradePlan() {
@@ -6,14 +6,14 @@
6
6
  {{ miniAppTitle }}
7
7
  </h1>
8
8
 
9
- <div v-if="$miniAppStore.isHasMiniAppFeature">
10
- <slot v-if="$miniAppStore.isCanUpdateSetting" name="action" />
9
+ <div v-if="$miniAppStore.validation('updateSetting').valid">
10
+ <slot name="action" />
11
11
  </div>
12
12
  </div>
13
13
 
14
14
  <MiniAppPermissionWrapper
15
15
  v-if="miniApp"
16
- :permission="$miniAppStore.checkCanUpdateSetting(miniApp)"
16
+ :validation="$miniAppStore.validation('updateSetting')"
17
17
  >
18
18
  <slot />
19
19
  </MiniAppPermissionWrapper>
@@ -20,12 +20,12 @@
20
20
  <template #default>
21
21
  <div class="space-y-4" v-if="!_.isEmpty(schema)">
22
22
  <p
23
- v-if="miniApp?.integration?.settings?.note"
23
+ v-if="miniApp?.integration?.customPage?.setting?.note"
24
24
  class="text-sm text-gray-600 whitespace-pre-line"
25
25
  >
26
26
  {{
27
27
  t("miniAppLang.miniAppSettingNote", {
28
- miniAppNote: miniApp.integration.settings.note ?? "",
28
+ miniAppNote: miniApp.integration.customPage.setting.note ?? "",
29
29
  })
30
30
  }}
31
31
  </p>
@@ -3,7 +3,7 @@
3
3
 
4
4
  <MiniAppPermissionWrapper
5
5
  v-if="!$miniAppStore.isFetchingInstalledMiniApps"
6
- :permission="permission"
6
+ :validation="$miniAppStore.validatePageAccess(miniAppCode, pageCode)"
7
7
  >
8
8
  <slot />
9
9
  </MiniAppPermissionWrapper>
@@ -12,38 +12,8 @@
12
12
  <script setup lang="ts">
13
13
  import MiniAppPermissionWrapper from "./MiniAppPermissionWrapper.vue";
14
14
 
15
- const props = defineProps<{
15
+ defineProps<{
16
16
  miniAppCode: string;
17
17
  pageCode: string;
18
18
  }>();
19
-
20
- const { $miniAppStore } = useNuxtApp();
21
-
22
- const miniApp = computed(() => {
23
- return $miniAppStore.installedMiniApps.find(
24
- (item) => item.code === props.miniAppCode,
25
- );
26
- });
27
-
28
- const permission = computed(() => {
29
- const checkHasFeature = $miniAppStore.checkHasFeature();
30
- if (!checkHasFeature.status) return checkHasFeature;
31
-
32
- const checkIsInstalled = $miniAppStore.checkIsInstalled(props.miniAppCode);
33
- if (!checkIsInstalled.status) return checkIsInstalled;
34
-
35
- if (!miniApp.value) {
36
- return {
37
- status: false,
38
- reason: "unknownMiniApp",
39
- };
40
- }
41
-
42
- const checkHasRequiredPlan = $miniAppStore.checkHasRequiredPlan(
43
- miniApp.value,
44
- );
45
- if (!checkHasRequiredPlan.status) return checkHasRequiredPlan;
46
-
47
- return $miniAppStore.checkCanAccess(props.miniAppCode, props.pageCode);
48
- });
49
19
  </script>
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
 
18
18
  <div class="p-4">
19
- <img :src="item.logo" class="size-16 object-contain" />
19
+ <MiniAppIcon :image="item.logo" :label="item.name" size="lg" />
20
20
  </div>
21
21
 
22
22
  <div class="text-sm text-gray-600 text-center line-clamp-2">
@@ -27,18 +27,19 @@
27
27
 
28
28
  <script setup lang="ts">
29
29
  import { MiniappStatusEnum } from "~/enums/enums.generate";
30
- import { Miniapp } from "~/simpleapp/generate/openapi";
30
+ import { MiniAppDetail } from "~/simpleapp/generate/openapi";
31
31
  import MiniAppIntegrationItemBadge from "./MiniAppIntegrationItemBadge.vue";
32
+ import MiniAppIcon from "../MiniAppIcon.vue";
32
33
 
33
34
  defineProps<{
34
- item: Miniapp;
35
+ item: MiniAppDetail;
35
36
  }>();
36
37
 
37
38
  const emits = defineEmits<{
38
- (event: "miniAppClick", item: Miniapp): void;
39
+ (event: "miniAppClick", item: MiniAppDetail): void;
39
40
  }>();
40
41
 
41
- function handleMiniAppClick(item: Miniapp) {
42
+ function handleMiniAppClick(item: MiniAppDetail) {
42
43
  if (item.status === MiniappStatusEnum.UPCOMING) return;
43
44
 
44
45
  if (item._id) {
@@ -5,11 +5,12 @@
5
5
  :class="{
6
6
  'bg-emerald-500': badgeType === 'available',
7
7
  'bg-yellow-400': badgeType === 'comingSoon',
8
+ 'bg-slate-400': badgeType === 'dev',
8
9
  }"
9
10
  >
10
11
  {{ t(`miniAppLang.${badgeType}`) }}
11
12
  </span>
12
- <span
13
+ <!-- <span
13
14
  v-else
14
15
  class="bg-slate-200/50 text-surface-500 text-[0.65rem] px-2 font-bold py-0.5 rounded-md uppercase"
15
16
  >
@@ -27,28 +28,33 @@
27
28
  })
28
29
  }}
29
30
  </template>
30
- </span>
31
+ </span> -->
31
32
  </template>
32
33
 
33
34
  <script setup lang="ts">
34
- import { Miniapp } from "~/simpleapp/generate/openapi";
35
+ import { MiniappEnvEnum } from "~/enums/enums.generate";
36
+ import { Miniapp, MiniAppDetail } from "~/simpleapp/generate/openapi";
35
37
 
36
38
  const props = defineProps<{
37
- item: Miniapp;
39
+ item: MiniAppDetail;
38
40
  }>();
39
41
 
40
42
  const { $miniAppStore } = useNuxtApp();
41
43
 
42
44
  const badgeType = computed(() => {
45
+ if (props.item.env === MiniappEnvEnum.DEV) {
46
+ return "dev";
47
+ }
48
+
49
+ if (!$miniAppStore.hasMiniAppFeature) {
50
+ return "noFeature";
51
+ }
52
+
43
53
  if (props.item.status === "upcoming") {
44
54
  return "comingSoon";
45
55
  }
46
56
 
47
- if ($miniAppStore.hasRequiredPlan(props.item)) {
48
- if (!$miniAppStore.isHasMiniAppFeature) {
49
- return "noFeature";
50
- }
51
-
57
+ if (props.item.hasRequiredPlan) {
52
58
  return "available";
53
59
  }
54
60
 
@@ -19,16 +19,16 @@
19
19
  </template>
20
20
  <script setup lang="ts">
21
21
  import UndrawNodata from "~/components/icon/UndrawNodata.vue";
22
- import { Miniapp } from "~/simpleapp/generate/openapi";
22
+ import { MiniAppDetail } from "~/simpleapp/generate/openapi";
23
23
  import MiniAppIntegrationItem from "./MiniAppIntegrationItem.vue";
24
24
 
25
- defineProps<{ items: Miniapp[] | undefined }>();
25
+ defineProps<{ items: MiniAppDetail[] | undefined }>();
26
26
 
27
27
  const emits = defineEmits<{
28
- (event: "miniAppClick", item: Miniapp): void;
28
+ (event: "miniAppClick", item: MiniAppDetail): void;
29
29
  }>();
30
30
 
31
- function handleMiniAppClick(item: Miniapp) {
31
+ function handleMiniAppClick(item: MiniAppDetail) {
32
32
  emits("miniAppClick", item);
33
33
  }
34
34
  </script>
@@ -7,25 +7,32 @@
7
7
  class="p-8 max-w-4xl mx-auto mb-10 space-y-4"
8
8
  >
9
9
  <div class="flex items-start">
10
- <img :src="miniApp.logo" class="size-16 mr-8 object-contain" />
10
+ <!-- <img :src="miniApp.logo" class="size-16 mr-8 object-contain" /> -->
11
+
12
+ <MiniAppIcon
13
+ :image="miniApp.logo"
14
+ :label="miniApp.name"
15
+ size="lg"
16
+ class="mr-8"
17
+ />
11
18
 
12
19
  <div class="space-y-1">
13
20
  <h1 class="text-3xl font-bold mb-1">{{ miniApp.name }}</h1>
14
21
  <div class="text-gray-400 text-sm flex items-center gap-2">
15
22
  <div class="flex items-center gap-2">
16
23
  <i class="pi pi-user" />
17
- <span>{{ miniApp.author }}</span>
24
+ <span>{{ miniApp.author.team ?? miniApp.author.name }}</span>
18
25
  </div>
19
26
  <span>|</span>
20
27
  <div>v {{ miniApp.version }}</div>
21
28
 
22
29
  <div
23
- v-if="!_.isEmpty(miniApp.requiredPlans)"
30
+ v-if="!_.isEmpty(miniApp.access.requiredPlans)"
24
31
  class="flex items-center gap-2"
25
32
  >
26
33
  <span>|</span>
27
34
  <span
28
- v-for="permission in miniApp.requiredPlans ?? []"
35
+ v-for="permission in miniApp.access.requiredPlans ?? []"
29
36
  class="px-3 py-0.5 bg-slate-100 text-surface-500 font-semibold text-xs rounded uppercase"
30
37
  >
31
38
  {{ permission }}
@@ -42,6 +49,22 @@
42
49
  </div>
43
50
  </div>
44
51
  <p class="text-gray-600">{{ miniApp.intro.description }}</p>
52
+
53
+ <div class="flex items-center gap-1">
54
+ <template
55
+ v-for="[feature, enabled] in Object.entries(
56
+ miniApp.integration.enabled,
57
+ )"
58
+ >
59
+ <span
60
+ v-if="enabled"
61
+ class="px-3 py-0.5 bg-primary-50 text-primary-500 font-semibold text-xs rounded uppercase cursor-pointer"
62
+ @click="() => handleOpenFeatureDialog(feature, enabled)"
63
+ >
64
+ {{ t(`miniAppLang.integrationFeature.${feature}`) }}
65
+ </span>
66
+ </template>
67
+ </div>
45
68
  </div>
46
69
  </div>
47
70
 
@@ -53,13 +76,13 @@
53
76
  </template>
54
77
  <MiniAppPermissionWrapper
55
78
  v-else
56
- :permission="$miniAppStore.checkHasFeature()"
79
+ :validation="$miniAppStore.validation('miniAppFeature')"
57
80
  >
58
81
  <div class="flex items-center space-x-2">
59
82
  <template v-if="$miniAppStore.isMiniAppInstalled(miniApp.code)">
60
83
  <!-- Installed -->
61
84
  <MiniAppPermissionWrapper
62
- :permission="$miniAppStore.checkCanUninstall(miniApp)"
85
+ :validation="$miniAppStore.validation('uninstall')"
63
86
  class="!mt-0"
64
87
  >
65
88
  <ButtonDefault
@@ -71,11 +94,8 @@
71
94
  </MiniAppPermissionWrapper>
72
95
 
73
96
  <MiniAppPermissionWrapper
74
- v-if="
75
- miniApp.integration.settings &&
76
- !_.isEmpty(miniApp.integration.settings)
77
- "
78
- :permission="$miniAppStore.checkCanUpdateSetting(miniApp)"
97
+ v-if="$miniAppStore.hasSettingPage(miniApp)"
98
+ :validation="$miniAppStore.validation('updateSetting')"
79
99
  class="!mt-0"
80
100
  >
81
101
  <ButtonSecondary
@@ -89,7 +109,7 @@
89
109
  <template v-else>
90
110
  <!-- Not yet install -->
91
111
  <MiniAppPermissionWrapper
92
- :permission="$miniAppStore.checkCanInstall(miniApp)"
112
+ :validation="$miniAppStore.validation('install')"
93
113
  class="!mt-0"
94
114
  >
95
115
  <ButtonPrimary
@@ -105,19 +125,49 @@
105
125
 
106
126
  <div v-if="miniApp.intro.previewImages.length > 0">
107
127
  <h2 class="text-xl font-semibold mb-2">Overview:</h2>
108
- <div class="card flex justify-center py-4">
128
+ <div class="card flex justify-center py-4 h-96 bg-slate-100 rounded-xl">
109
129
  <Galleria
110
130
  :value="miniApp.intro.previewImages"
111
131
  :numVisible="5"
112
- containerStyle="max-width: 640px"
113
132
  :showThumbnails="false"
114
133
  :showIndicators="true"
134
+ :showItemNavigators="true"
135
+ :pt="{
136
+ root: {
137
+ class: '!grow !h-full',
138
+ },
139
+ content: {
140
+ class: '!h-full',
141
+ },
142
+ itemsContainer: {
143
+ class: '!h-full',
144
+ },
145
+ items: {
146
+ class: '!grow',
147
+ },
148
+ item: {
149
+ class: '!grow',
150
+ },
151
+ prevButton: {
152
+ class: '!bg-slate-200 cursor-pointer',
153
+ },
154
+ prevIcon: {
155
+ class: 'text-black',
156
+ },
157
+ nextButton: {
158
+ class: '!bg-slate-200 cursor-pointer',
159
+ },
160
+ nextIcon: {
161
+ class: 'text-black',
162
+ },
163
+ }"
115
164
  >
116
165
  <template #item="slotProps">
117
166
  <img
118
167
  :src="slotProps.item"
119
168
  :alt="miniApp.name"
120
- style="width: 100%; display: block"
169
+ style="display: block"
170
+ class="h-80 rounded-xl shadow-md"
121
171
  />
122
172
  </template>
123
173
  </Galleria>
@@ -132,10 +182,12 @@
132
182
  :key="feature.title"
133
183
  class="flex space-x-2"
134
184
  >
135
- <div>✅</div>
136
- <div>
137
- <div>
138
- <span class="font-semibold">{{ feature.title }}</span> -
185
+ <div class="flex flex-col">
186
+ <div class="flex items-center gap-2">
187
+ <i class="pi pi-check-circle text-primary" />
188
+ <span class="font-semibold">{{ feature.title }}</span>
189
+ </div>
190
+ <div class="pl-6 text-slate-400 text-sm">
139
191
  {{ feature.description }}
140
192
  </div>
141
193
  </div>
@@ -143,18 +195,59 @@
143
195
  </div>
144
196
  </div>
145
197
  </div>
198
+
199
+ <Dialog
200
+ v-model:visible="isShowApiAccessFeature"
201
+ :modal="true"
202
+ maximizable
203
+ :header="t('scopes')"
204
+ class="!w-1/2 !h-2/3"
205
+ >
206
+ <MiniAppFeatureScope :miniApp="miniApp" />
207
+ </Dialog>
208
+
209
+ <Dialog
210
+ v-model:visible="isShowCustomPageFeature"
211
+ :modal="true"
212
+ maximizable
213
+ :header="t('customPage')"
214
+ class="!w-1/2 !h-2/3"
215
+ >
216
+ <MiniAppFeatureCustomPage :miniApp="miniApp" />
217
+ </Dialog>
218
+
219
+ <Dialog
220
+ v-model:visible="isShowCustomFieldFeature"
221
+ :modal="true"
222
+ maximizable
223
+ :header="t('customField')"
224
+ class="!w-1/2 !h-2/3"
225
+ >
226
+ <MiniAppFeatureCustomField :miniApp="miniApp" />
227
+ </Dialog>
146
228
  </div>
147
229
  <div v-else>
148
- <template v-if="!isFetching"> Not found... </template>
230
+ <template v-if="!isFetching">
231
+ <NodataLarge
232
+ :label="t('noDataFound')"
233
+ :icon="UndrawNodata"
234
+ class="my-24"
235
+ />
236
+ </template>
149
237
  </div>
150
238
  </template>
151
239
 
152
240
  <script setup lang="ts">
153
- import _ from "lodash";
241
+ import _, { min } from "lodash";
154
242
  import { MiniAppDetail } from "~/simpleapp/generate/openapi";
155
243
  import MiniAppPermissionWrapper from "../MiniAppPermissionWrapper.vue";
244
+ import UndrawNodata from "~/components/icon/UndrawNodata.vue";
245
+ import MiniAppIcon from "../MiniAppIcon.vue";
246
+ import MiniAppFeatureCustomPage from "../MiniAppFeatureCustomPage.vue";
247
+ import MiniAppFeatureCustomField from "../MiniAppFeatureCustomField.vue";
248
+ import MiniAppFeatureScope from "../MiniAppFeatureScope.vue";
156
249
 
157
- defineProps<{
250
+ const props = defineProps<{
158
251
  miniApp?: MiniAppDetail;
159
252
  isFetching: boolean;
160
253
  isAppInstallationInProgress: boolean;
@@ -167,6 +260,10 @@ const emits = defineEmits<{
167
260
  (e: "upgradePlan"): void;
168
261
  }>();
169
262
 
263
+ const isShowApiAccessFeature = ref(false);
264
+ const isShowCustomPageFeature = ref(false);
265
+ const isShowCustomFieldFeature = ref(false);
266
+
170
267
  function handleInstallApp() {
171
268
  emits("installApp");
172
269
  }
@@ -178,4 +275,20 @@ function handleUninstallApp() {
178
275
  function handleOpenSetting() {
179
276
  emits("openSetting");
180
277
  }
278
+
279
+ function handleOpenFeatureDialog(feature: string, enabled: boolean) {
280
+ if (enabled) {
281
+ switch (feature) {
282
+ case "miniApi":
283
+ isShowApiAccessFeature.value = true;
284
+ break;
285
+ case "customField":
286
+ isShowCustomFieldFeature.value = true;
287
+ break;
288
+ case "customPage":
289
+ isShowCustomPageFeature.value = true;
290
+ break;
291
+ }
292
+ }
293
+ }
181
294
  </script>
@@ -1,7 +1,6 @@
1
1
  import type {
2
2
  MiniAppDetail,
3
- MiniappIntegrationForms,
4
- MiniappIntegrationPages,
3
+ MiniappIntegrationCustomFieldFields,
5
4
  } from "~/simpleapp/generate/openapi";
6
5
 
7
6
  export enum MiniAppFrameworkCompatibility {
@@ -10,11 +9,7 @@ export enum MiniAppFrameworkCompatibility {
10
9
  "DEPRECATED" = "DEPRECATED",
11
10
  }
12
11
 
13
- export type MiniAppPageWithMiniAppCode = MiniappIntegrationPages & {
14
- miniAppCode: string;
15
- };
16
-
17
- export type MiniAppFormWithMiniAppCode = MiniappIntegrationForms & {
12
+ export type MiniAppFormWithMiniAppCode = MiniappIntegrationCustomFieldFields & {
18
13
  miniAppCode: string;
19
14
  };
20
15
 
@@ -28,3 +23,8 @@ export type MiniAppPermissionResult = {
28
23
  status: boolean;
29
24
  reason?: string;
30
25
  };
26
+
27
+ export type MiniAppValidationResp = {
28
+ valid: boolean;
29
+ type: string;
30
+ };
@@ -41,6 +41,8 @@ export class MiniAppBridgeResourceAccessor {
41
41
 
42
42
  protected miniAppCode: string = "";
43
43
 
44
+ protected developerPortalAppId: string = "";
45
+
44
46
  <% for (let i = 0; i < it.modules.length; i++) { %>
45
47
  <%
46
48
  const { resourceName, pascalName, kebabName, hasMiniAppWhitelistedApi } = getMiniAppInfo(it.modules[i]);
@@ -48,7 +50,7 @@ export class MiniAppBridgeResourceAccessor {
48
50
  <% if(hasMiniAppWhitelistedApi) { %>
49
51
  get <%= resourceName %>() {
50
52
  if (!this.instances.<%= resourceName %>) {
51
- this.instances.<%= resourceName %> = new MiniApp<%= pascalName %>BridgeEditableService(this.miniAppCode);
53
+ this.instances.<%= resourceName %> = new MiniApp<%= pascalName %>BridgeEditableService(this.miniAppCode, this.developerPortalAppId);
52
54
  }
53
55
  return this.instances.<%= resourceName %>;
54
56
  }