cabloy 5.1.103 → 5.1.105

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 (78) hide show
  1. package/.cabloy-version +1 -1
  2. package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +1 -1
  3. package/CHANGELOG.md +27 -0
  4. package/CLAUDE.md +1 -0
  5. package/cabloy-docs/backend/controller-aop-guide.md +2 -2
  6. package/cabloy-docs/backend/field-indexes.md +10 -1
  7. package/cabloy-docs/backend/menu-guide.md +30 -0
  8. package/cabloy-docs/frontend/a-model-under-the-hood.md +26 -4
  9. package/cabloy-docs/frontend/model-architecture.md +1 -1
  10. package/cabloy-docs/frontend/model-state-guide.md +122 -16
  11. package/cabloy-docs/frontend/ssr-init-data.md +12 -1
  12. package/cabloy-docs/frontend/use-state-data-best-practices.md +23 -0
  13. package/package.json +1 -1
  14. package/vona/packages-vona/vona/package.json +1 -1
  15. package/vona/pnpm-lock.yaml +31 -31
  16. package/vona/src/suite/a-home/modules/home-user/src/bean/eventListener.activate.ts +5 -4
  17. package/vona/src/suite/a-home/modules/home-user/src/bean/meta.version.ts +10 -6
  18. package/vona/src/suite/a-home/modules/home-user/src/config/config.ts +1 -1
  19. package/vona/src/suite/a-home/modules/home-user/src/controller/passport.ts +7 -7
  20. package/vona/src/suite/a-home/modules/home-user/src/entity/role.ts +4 -0
  21. package/vona/src/suite/a-home/modules/home-user/src/service/passportAdapter.ts +2 -2
  22. package/vona/src/suite/a-home/modules/home-user/src/service/roleAdapter.ts +5 -5
  23. package/vona/src/suite/a-training/modules/training-record/src/bean/ssrMenu.record.ts +1 -0
  24. package/vona/src/suite/a-training/modules/training-student/src/bean/ssrMenu.student.ts +1 -0
  25. package/vona/src/suite/cabloy-basic/modules/basic-siteadmin/src/bean/ssrMenu.home.ts +1 -0
  26. package/vona/src/suite/cabloy-basic/modules/basic-siteadmin/src/bean/ssrSite.admin.ts +5 -1
  27. package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/bean/ssrSite.web.ts +5 -1
  28. package/vona/src/suite-vendor/a-auth/modules/a-auth/package.json +1 -1
  29. package/vona/src/suite-vendor/a-auth/modules/a-auth/src/service/auth.ts +5 -1
  30. package/vona/src/suite-vendor/a-auth/package.json +1 -1
  31. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/cli/ssrSite/boilerplate/{{sceneName}}.{{beanName}}.ts_ +5 -3
  32. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +1 -1
  33. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/bean/event.retrieveMenusSite.ts +2 -2
  34. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/lib/beanSsrSiteBase.ts +33 -8
  35. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/service/ssr.ts +46 -16
  36. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/service/ssrHandler.ts +2 -4
  37. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/types/env.ts +1 -0
  38. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/types/ssrMenu.ts +10 -1
  39. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/types/ssrSite.ts +3 -1
  40. package/vona/src/suite-vendor/a-cabloy/package.json +1 -1
  41. package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
  42. package/vona/src/suite-vendor/a-vona/modules/a-permission/src/.metadata/index.ts +18 -2
  43. package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/bean.permission.ts +6 -1
  44. package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/event.retrievePermissionAction.ts +16 -0
  45. package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +1 -1
  46. package/vona/src/suite-vendor/a-vona/modules/a-user/src/bean/bean.passport.ts +2 -2
  47. package/vona/src/suite-vendor/a-vona/modules/a-user/src/lib/passport.ts +7 -4
  48. package/vona/src/suite-vendor/a-vona/modules/a-user/src/types/passport.ts +1 -1
  49. package/vona/src/suite-vendor/a-vona/modules/a-user/src/types/role.ts +3 -1
  50. package/vona/src/suite-vendor/a-vona/package.json +1 -1
  51. package/zova/env/.env.cabloyBasicAdmin +2 -0
  52. package/zova/env/.env.cabloyBasicWeb +2 -0
  53. package/zova/packages-utils/zova-jsx/package.json +2 -2
  54. package/zova/packages-zova/zova/package.json +3 -3
  55. package/zova/packages-zova/zova-core/package.json +1 -1
  56. package/zova/packages-zova/zova-core/src/core/sys/sys.ts +3 -0
  57. package/zova/packages-zova/zova-core/src/types/utils/env.ts +1 -0
  58. package/zova/src/suite/a-home/modules/home-api/src/api/homeUserPassport.ts +19 -19
  59. package/zova/src/suite/a-home/modules/home-api/src/api/openapi/types.ts +11 -10
  60. package/zova/src/suite/a-home/modules/home-api/src/apiSchema/homeUserPassport.ts +5 -5
  61. package/zova/src/suite/a-home/modules/home-base/src/.metadata/page/errorAccessDenied.ts +9 -0
  62. package/zova/src/suite/a-home/modules/home-base/src/page/errorAccessDenied/controller.tsx +40 -0
  63. package/zova/src/suite/a-home/modules/home-base/src/routes.ts +9 -0
  64. package/zova/src/suite/a-home/modules/home-base/src/service/routerGuards.ts +21 -12
  65. package/zova/src/suite/a-home/modules/home-passport/src/model/passport.ts +7 -1
  66. package/zova/src/suite/a-home/modules/home-passport/src/monkey.ts +17 -3
  67. package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +1 -1
  68. package/zova/src/suite-vendor/a-zova/modules/a-model/src/bean/bean.model/bean.model.useState.ts +6 -6
  69. package/zova/src/suite-vendor/a-zova/modules/a-model/src/bean/bean.model/bean.model.useStateGeneral.ts +5 -5
  70. package/zova/src/suite-vendor/a-zova/modules/a-model/src/monkey.ts +11 -2
  71. package/zova/src/suite-vendor/a-zova/modules/a-model/src/types/query.ts +1 -1
  72. package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +1 -1
  73. package/zova/src/suite-vendor/a-zova/modules/a-router/src/monkeySys.ts +10 -1
  74. package/zova/src/suite-vendor/a-zova/modules/a-router/src/types/router.ts +1 -0
  75. package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +1 -1
  76. package/zova/src/suite-vendor/a-zova/modules/a-routertabs/src/model/tabs.ts +4 -4
  77. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
  78. package/zova/src/suite-vendor/a-zova/package.json +5 -5
@@ -63,7 +63,7 @@ export type QueryMetaPersisterCookieType =
63
63
  | 'string'
64
64
  | undefined;
65
65
 
66
- export type StateType = 'db' | 'local' | 'cookie' | 'mem' | 'data';
66
+ export type StateType = 'localAsync' | 'local' | 'cookie' | 'mem' | 'data';
67
67
 
68
68
  export type StaleTime = number;
69
69
  export type StaleTimeFunction<
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-router",
3
- "version": "5.1.29",
3
+ "version": "5.1.30",
4
4
  "gitHead": "09d901d17140a80ee0764211b441cda72fd94663",
5
5
  "description": "router",
6
6
  "keywords": [
@@ -85,8 +85,12 @@ export class MonkeySys
85
85
  return app.$gotoPage(pagePath, { ...options, params: undefined });
86
86
  };
87
87
  app.$gotoLogin = (returnTo?: string, cause?: string) => {
88
- if (!returnTo && cast(app.meta.$router.currentRoute)?.path === app.sys.env.ROUTER_PAGE_LOGIN)
88
+ if (
89
+ !returnTo &&
90
+ cast(app.meta.$router.currentRoute)?.path === app.sys.env.ROUTER_PAGE_LOGIN
91
+ ) {
89
92
  return;
93
+ }
90
94
  const query: any = {};
91
95
  if (cause) {
92
96
  query.cause = cause;
@@ -94,6 +98,11 @@ export class MonkeySys
94
98
  const returnTo2 = returnTo === app.sys.env.ROUTER_PAGE_LOGIN ? undefined : (returnTo ?? true);
95
99
  return app.$gotoPage(app.sys.env.ROUTER_PAGE_LOGIN, { query, returnTo: returnTo2 });
96
100
  };
101
+ app.$gotoAccessDenied = () => {
102
+ const pagePath = '/home/base/errorAccessDenied';
103
+ if (cast(app.meta.$router.currentRoute)?.path === pagePath) return;
104
+ return app.$gotoPage(pagePath, { replace: true });
105
+ };
97
106
  app.$gotoReturnTo = (returnTo?: string) => {
98
107
  const pagePath = app.$getReturnTo(returnTo);
99
108
  return app.$gotoPage(pagePath, { replace: true });
@@ -52,6 +52,7 @@ declare module 'zova' {
52
52
  $gotoPage(pagePath: string, options?: IGotoPageOptions): TypeGotoPageResult;
53
53
  $gotoHome(options?: IGotoPageOptions): TypeGotoPageResult;
54
54
  $gotoLogin(returnTo?: string, cause?: string): TypeGotoPageResult;
55
+ $gotoAccessDenied(): TypeGotoPageResult;
55
56
  $gotoReturnTo(returnTo?: string): TypeGotoPageResult;
56
57
  $getReturnTo(returnTo?: string): string;
57
58
  $getCurrentPagePath(): string | undefined;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-routertabs",
3
- "version": "5.1.32",
3
+ "version": "5.1.33",
4
4
  "gitHead": "09d901d17140a80ee0764211b441cda72fd94663",
5
5
  "description": "routertabs",
6
6
  "keywords": [
@@ -63,7 +63,7 @@ export class ModelTabs extends BeanModelBase {
63
63
  };
64
64
  this.tabKeyCurrent = this.$useStateMem(queryOptionsTabKeyCurrent);
65
65
  // if (this.tabsOptions.cache) {
66
- // this.tabKeyCurrent = this.$useStateDb(queryOptionsTabKeyCurrent);
66
+ // this.tabKeyCurrent = this.$useStateLocalAsync(queryOptionsTabKeyCurrent);
67
67
  // } else {
68
68
  // this.tabKeyCurrent = this.$useStateMem(queryOptionsTabKeyCurrent);
69
69
  // }
@@ -75,14 +75,14 @@ export class ModelTabs extends BeanModelBase {
75
75
  },
76
76
  };
77
77
  if (this.tabsOptions.cache) {
78
- this.tabs = this.$useStateDb(queryOptionsTabs);
78
+ this.tabs = this.$useStateLocalAsync(queryOptionsTabs);
79
79
  } else {
80
80
  this.tabs = this.$useStateMem(queryOptionsTabs);
81
81
  }
82
82
  // load cache
83
83
  if (this.tabsOptions.cache) {
84
- // await this.$loadStateDb(this.tabKeyCurrent);
85
- await this.$loadStateDb(this.tabs);
84
+ // await this.$ensureStateLocalAsync(this.tabKeyCurrent);
85
+ await this.$ensureStateLocalAsync(this.tabs);
86
86
  }
87
87
  // reset pageDirty
88
88
  this._resetAllPageDirty();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-zova",
3
- "version": "5.1.92",
3
+ "version": "5.1.93",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "zova",
6
6
  "keywords": [
@@ -43,7 +43,7 @@
43
43
  "@cabloy/word-utils": "^2.1.14",
44
44
  "defu": "^6.1.7",
45
45
  "luxon": "^3.7.2",
46
- "zova-jsx": "^1.1.77"
46
+ "zova-jsx": "^1.1.78"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@cabloy/cli": "^3.1.28",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-suite-a-zova",
3
- "version": "5.1.132",
3
+ "version": "5.1.134",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "zova",
6
6
  "license": "MIT",
@@ -21,18 +21,18 @@
21
21
  "zova-module-a-interceptor": "^5.1.29",
22
22
  "zova-module-a-logger": "^5.1.26",
23
23
  "zova-module-a-meta": "^5.1.21",
24
- "zova-module-a-model": "^5.1.32",
24
+ "zova-module-a-model": "^5.1.33",
25
25
  "zova-module-a-openapi": "^5.1.43",
26
- "zova-module-a-router": "^5.1.29",
26
+ "zova-module-a-router": "^5.1.30",
27
27
  "zova-module-a-routerstack": "^5.1.26",
28
- "zova-module-a-routertabs": "^5.1.32",
28
+ "zova-module-a-routertabs": "^5.1.33",
29
29
  "zova-module-a-ssr": "^5.1.29",
30
30
  "zova-module-a-ssrhmr": "^5.1.22",
31
31
  "zova-module-a-ssrserver": "^5.1.22",
32
32
  "zova-module-a-style": "^5.1.32",
33
33
  "zova-module-a-table": "^5.1.37",
34
34
  "zova-module-a-zod": "^5.1.36",
35
- "zova-module-a-zova": "^5.1.92"
35
+ "zova-module-a-zova": "^5.1.93"
36
36
  },
37
37
  "title": "a-zova"
38
38
  }