cabloy 5.1.136 → 5.1.138
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/.cabloy-version +1 -1
- package/.claude/skills/cabloy-backend-scaffold/SKILL.md +13 -0
- package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +11 -0
- package/.claude/skills/cabloy-contract-loop/SKILL.md +17 -0
- package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +35 -0
- package/.claude/skills/cabloy-frontend-scaffold/evals/evals.json +1 -1
- package/.claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +4 -0
- package/.claude/skills/cabloy-zova-source-reading/SKILL.md +21 -0
- package/.claude/skills/cabloy-zova-source-reading/references/core-reading-paths.md +26 -0
- package/CHANGELOG.md +31 -0
- package/CLAUDE.md +5 -1
- package/cabloy-docs/.vitepress/config.mjs +1 -0
- package/cabloy-docs/.vitepress/theme/custom.css +124 -0
- package/cabloy-docs/backend/auth-guide.md +8 -0
- package/cabloy-docs/backend/config-guide.md +2 -0
- package/cabloy-docs/backend/controller-aop-guide.md +8 -0
- package/cabloy-docs/backend/controller-guide.md +33 -0
- package/cabloy-docs/backend/event-guide.md +3 -3
- package/cabloy-docs/backend/mail-guide.md +1 -1
- package/cabloy-docs/backend/markdown-guide.md +1 -1
- package/cabloy-docs/backend/runtime-and-flavors.md +29 -0
- package/cabloy-docs/backend/user-access-guide.md +2 -2
- package/cabloy-docs/blogs/ai-react-nextjs-enterprise-architecture-cabloy/cover-en-v1.png +0 -0
- package/cabloy-docs/blogs/ai-react-nextjs-enterprise-architecture-cabloy/index.md +177 -0
- package/cabloy-docs/blogs/cabloy-fullstack-resource-addressing/cover-en-v1.png +0 -0
- package/cabloy-docs/blogs/cabloy-fullstack-resource-addressing/index.md +430 -0
- package/cabloy-docs/blogs/index.md +69 -0
- package/cabloy-docs/blogs/nextjs-integrated-fullstack-cabloy-contract-loop/cover-en-v1.png +0 -0
- package/cabloy-docs/blogs/nextjs-integrated-fullstack-cabloy-contract-loop/index.md +195 -0
- package/cabloy-docs/blogs/vue-object-oriented-zova-beginner-mental-model/cover-en-v1.png +0 -0
- package/cabloy-docs/blogs/vue-object-oriented-zova-beginner-mental-model/index.md +483 -0
- package/cabloy-docs/frontend/a-openapi-under-the-hood.md +13 -0
- package/cabloy-docs/frontend/api-schema-guide.md +79 -0
- package/cabloy-docs/frontend/environment-config-guide.md +2 -0
- package/cabloy-docs/frontend/form-guide.md +37 -0
- package/cabloy-docs/frontend/markdown-guide.md +3 -0
- package/cabloy-docs/frontend/model-resource-owner-pattern.md +26 -1
- package/cabloy-docs/frontend/module-scope.md +24 -0
- package/cabloy-docs/frontend/modules-and-suites.md +23 -1
- package/cabloy-docs/frontend/navigation-guards-guide.md +2 -0
- package/cabloy-docs/frontend/page-params-guide.md +2 -0
- package/cabloy-docs/frontend/page-route-guide.md +10 -3
- package/cabloy-docs/frontend/route-alias-guide.md +12 -6
- package/cabloy-docs/frontend/ssr-env.md +15 -6
- package/cabloy-docs/frontend/ssr-overview.md +10 -0
- package/cabloy-docs/frontend/ssr-review-checklist.md +1 -0
- package/cabloy-docs/frontend/zova-form-under-the-hood.md +6 -0
- package/cabloy-docs/frontend/zova-router-under-the-hood.md +4 -5
- package/cabloy-docs/fullstack/a-pay-payment-suite.md +1 -1
- package/cabloy-docs/fullstack/deploy-cloudflare-docker.md +14 -8
- package/e2e/specs/a-commerce/commerce.spec.ts +17 -2
- package/e2e/specs/cabloy-basic/account.spec.ts +519 -0
- package/e2e/specs/cabloy-basic/basic.spec.ts +15 -3
- package/package.json +1 -1
- package/vona/env/.env +2 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/cli/templates/tools/crudStart/boilerplate/src/controller/{{resourceName}}.ts_ +14 -11
- package/vona/packages-cli/cli-set-api/cli/templates/tools/crudStart/snippets/3-en-us.ts +11 -1
- package/vona/packages-cli/cli-set-api/cli/templates/tools/crudStart/snippets/4-zh-cn.ts +11 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.metadata.ts +1 -0
- package/vona/packages-cli/cli-set-api/src/lib/bean/toolsMetadata/generateOnions.ts +4 -3
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/pnpm-lock.yaml +237 -66
- package/vona/pnpm-workspace.yaml +1 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/.metadata/index.ts +33 -37
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/skuSelectResItem.tsx +3 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/skuView.tsx +3 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/entity/sku.tsx +17 -2
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/service/sku.ts +12 -2
- package/vona/src/suite/a-commerce/modules/commerce-catalog/test/skuPresentation.test.ts +52 -4
- package/vona/src/suite/a-commerce/modules/commerce-member/src/.metadata/index.ts +34 -36
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/.metadata/index.ts +29 -33
- package/vona/src/suite/a-commerce/modules/commerce-promotion/src/.metadata/index.ts +34 -37
- package/vona/src/suite/a-commerce/modules/commerce-seed/src/.metadata/index.ts +8 -9
- package/vona/src/suite/a-commerce/modules/commerce-siteadmin/src/.metadata/index.ts +33 -35
- package/vona/src/suite/a-commerce/modules/commerce-siteweb/src/.metadata/index.ts +11 -11
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/.metadata/index.ts +45 -42
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/stockAuditSelectResItem.tsx +4 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/stockAuditView.tsx +6 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/stockBalanceSelectResItem.tsx +4 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/stockBalanceView.tsx +6 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/stockSkuRef.tsx +16 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/entity/stockAudit.tsx +17 -2
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/entity/stockBalance.tsx +17 -2
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/service/stockAudit.ts +31 -2
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/service/stockBalance.ts +31 -2
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/stockPresentation.test.ts +116 -4
- package/vona/src/suite/a-demo/modules/demo-basic/src/.metadata/index.ts +11 -11
- package/vona/src/suite/a-home/modules/home-base/src/.metadata/index.ts +0 -3
- package/vona/src/suite/a-home/modules/home-index/src/.metadata/index.ts +12 -13
- package/vona/src/suite/a-home/modules/home-user/package.json +9 -1
- package/vona/src/suite/a-home/modules/home-user/src/.metadata/index.ts +333 -78
- package/vona/src/suite/a-home/modules/home-user/src/bean/cacheRedis.activation.ts +21 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/cacheRedis.activationCurrent.ts +15 -0
- package/vona/src/{suite-vendor/a-vona/modules/a-mailconfirm → suite/a-home/modules/home-user}/src/bean/cacheRedis.passwordReset.ts +6 -2
- package/vona/src/suite/a-home/modules/home-user/src/bean/cacheRedis.passwordResetCurrent.ts +15 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/cacheRedis.passwordResetRecipient.ts +13 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/cacheRedis.passwordSet.ts +22 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/cacheRedis.passwordSetCurrent.ts +15 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/imageScene.homeUserAvatar.ts +18 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/meta.redlock.ts +18 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/meta.version.ts +0 -1
- package/vona/src/suite/a-home/modules/home-user/src/bean/zodRefine.passwordConfirm.ts +8 -4
- package/vona/src/suite/a-home/modules/home-user/src/config/config.ts +10 -1
- package/vona/src/suite/a-home/modules/home-user/src/config/locale/en-us.ts +35 -3
- package/vona/src/suite/a-home/modules/home-user/src/config/locale/zh-cn.ts +35 -3
- package/vona/src/suite/a-home/modules/home-user/src/controller/account.ts +147 -0
- package/vona/src/suite/a-home/modules/home-user/src/controller/passport.ts +27 -7
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountActivation.ts +12 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountCurrent.ts +31 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountPasswordChange.ts +41 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountPasswordReset.ts +35 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountPasswordResetRequest.ts +20 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountPasswordResetRequestResult.ts +13 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountPasswordSet.ts +35 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountPasswordSetIssue.ts +15 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountProfileUpdate.ts +53 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountRelogin.ts +12 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/passport.ts +2 -2
- package/vona/src/suite/a-home/modules/home-user/src/dto/passportUser.ts +43 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/register.ts +40 -5
- package/vona/src/suite/a-home/modules/home-user/src/service/account.ts +693 -0
- package/vona/src/suite/a-home/modules/home-user/test/account.test.ts +249 -0
- package/vona/src/suite/a-home/modules/home-user/test/accountActivation.test.ts +344 -0
- package/vona/src/suite/a-home/modules/home-user/test/accountOpenapi.test.ts +158 -0
- package/vona/src/suite/a-home/modules/home-user/test/accountPasswordReset.test.ts +724 -0
- package/vona/src/suite/a-home/modules/home-user/test/accountPasswordSet.test.ts +799 -0
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/index.ts +73 -65
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/index.ts +26 -17
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/index.ts +47 -39
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/.metadata/index.ts +22 -23
- package/vona/src/suite/cabloy-basic/modules/basic-siteadmin/src/.metadata/index.ts +15 -15
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/.metadata/index.ts +11 -11
- package/vona/src/suite-vendor/a-auth/modules/a-auth/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/a-auth/src/.metadata/index.ts +55 -41
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/src/.metadata/index.ts +8 -8
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/package.json +4 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/src/.metadata/index.ts +51 -27
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/src/bean/meta.redlock.ts +11 -0
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/src/service/authSimple.ts +53 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/test/authSimple.test.ts +56 -0
- package/vona/src/suite-vendor/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-cabloy/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-cabloy/src/.metadata/index.ts +4 -4
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/src/.metadata/index.ts +23 -24
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasource/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasource/src/.metadata/index.ts +31 -22
- package/vona/src/suite-vendor/{a-vona/modules/a-mailconfirm → a-cabloy/modules/a-rbac}/package.json +13 -5
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/.metadata/index.ts +147 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/.metadata/this.ts +2 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/bean/bean.rbacCatalog.ts +95 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/bean/bean.rbacScope.ts +218 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/bean/event.policyInvalidated.ts +17 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/bean/event.resolvePolicy.ts +13 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/bean/guard.rbac.ts +102 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/bean/index.ts +5 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/config/config.ts +10 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/index.ts +3 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/lib/index.ts +1 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/lib/rbac.ts +46 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/types/index.ts +2 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/types/rbac.ts +46 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/src/types/scope.ts +27 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/test/rbacCatalogGuard.test.ts +445 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/test/rbacScopeCurrent.test.ts +172 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-socket/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-socket/src/.metadata/index.ts +27 -31
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/.metadata/index.ts +37 -45
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssrhmr/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssrhmr/src/.metadata/index.ts +12 -12
- package/vona/src/suite-vendor/a-cabloy/modules/a-status/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-status/src/.metadata/index.ts +27 -19
- package/vona/src/suite-vendor/a-cabloy/package.json +2 -1
- package/vona/src/suite-vendor/a-cabloy/tsconfig.json +3 -0
- package/vona/src/suite-vendor/a-captcha/modules/a-captcha/package.json +1 -1
- package/vona/src/suite-vendor/a-captcha/modules/a-captcha/src/.metadata/index.ts +27 -29
- package/vona/src/suite-vendor/a-captcha/modules/captcha-simple/package.json +1 -1
- package/vona/src/suite-vendor/a-captcha/modules/captcha-simple/src/.metadata/index.ts +16 -17
- package/vona/src/suite-vendor/a-captcha/package.json +1 -1
- package/vona/src/suite-vendor/a-file/modules/a-file/package.json +1 -1
- package/vona/src/suite-vendor/a-file/modules/a-file/src/.metadata/index.ts +56 -38
- package/vona/src/suite-vendor/a-file/modules/file-cloudflare/package.json +1 -1
- package/vona/src/suite-vendor/a-file/modules/file-cloudflare/src/.metadata/index.ts +12 -13
- package/vona/src/suite-vendor/a-file/modules/file-native/package.json +1 -1
- package/vona/src/suite-vendor/a-file/modules/file-native/src/.metadata/index.ts +11 -12
- package/vona/src/suite-vendor/a-file/package.json +4 -4
- package/vona/src/suite-vendor/a-image/modules/a-image/package.json +1 -1
- package/vona/src/suite-vendor/a-image/modules/a-image/src/.metadata/index.ts +56 -38
- package/vona/src/suite-vendor/a-image/modules/image-cloudflare/package.json +1 -1
- package/vona/src/suite-vendor/a-image/modules/image-cloudflare/src/.metadata/index.ts +12 -13
- package/vona/src/suite-vendor/a-image/modules/image-native/package.json +1 -1
- package/vona/src/suite-vendor/a-image/modules/image-native/src/.metadata/index.ts +11 -12
- package/vona/src/suite-vendor/a-image/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/.metadata/index.ts +0 -8
- package/vona/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-mock/src/.metadata/index.ts +21 -22
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/src/.metadata/index.ts +8 -8
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/src/.metadata/index.ts +8 -8
- package/vona/src/suite-vendor/a-pay/package.json +5 -5
- package/vona/src/suite-vendor/a-paypal/modules/a-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-paypal/modules/a-paypal/src/.metadata/index.ts +46 -40
- package/vona/src/suite-vendor/a-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/cli/guard/boilerplate/{{sceneName}}.{{beanName}}.ts_ +6 -8
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/src/.metadata/index.ts +8 -16
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/src/lib/utils/guardBase.ts +22 -0
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/src/lib/utils/index.ts +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/src/types/guard.ts +4 -1
- package/vona/src/suite-vendor/a-vona/modules/a-aspectutils/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-aspectutils/src/.metadata/index.ts +8 -10
- package/vona/src/suite-vendor/a-vona/modules/a-bean/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-bean/src/.metadata/index.ts +4 -4
- package/vona/src/suite-vendor/a-vona/modules/a-beanmutate/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-beanmutate/src/.metadata/index.ts +17 -19
- package/vona/src/suite-vendor/a-vona/modules/a-body/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-body/src/.metadata/index.ts +12 -12
- package/vona/src/suite-vendor/a-vona/modules/a-body/src/bean/interceptor.bodyReq.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-body/src/types/bodyParser.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-broadcast/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-broadcast/src/.metadata/index.ts +8 -9
- package/vona/src/suite-vendor/a-vona/modules/a-cache/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-cache/src/.metadata/index.ts +14 -14
- package/vona/src/suite-vendor/a-vona/modules/a-caching/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-caching/src/.metadata/index.ts +8 -8
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-core/src/.metadata/index.ts +20 -22
- package/vona/src/suite-vendor/a-vona/modules/a-election/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-election/src/.metadata/index.ts +15 -16
- package/vona/src/suite-vendor/a-vona/modules/a-error/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-error/src/.metadata/index.ts +19 -21
- package/vona/src/suite-vendor/a-vona/modules/a-event/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-event/src/.metadata/index.ts +16 -18
- package/vona/src/suite-vendor/a-vona/modules/a-executor/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-executor/src/.metadata/index.ts +12 -13
- package/vona/src/suite-vendor/a-vona/modules/a-hmr/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-hmr/src/.metadata/index.ts +24 -28
- package/vona/src/suite-vendor/a-vona/modules/a-hmrbase/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-hmrbase/src/.metadata/index.ts +4 -4
- package/vona/src/suite-vendor/a-vona/modules/a-index/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-index/src/.metadata/index.ts +11 -13
- package/vona/src/suite-vendor/a-vona/modules/a-instance/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-instance/src/.metadata/index.ts +42 -35
- package/vona/src/suite-vendor/a-vona/modules/a-jwt/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-jwt/src/.metadata/index.ts +15 -17
- package/vona/src/suite-vendor/a-vona/modules/a-locale/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-locale/src/.metadata/index.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-locale/src/main.ts +4 -1
- package/vona/src/suite-vendor/a-vona/modules/a-logger/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-logger/src/.metadata/index.ts +20 -20
- package/vona/src/suite-vendor/a-vona/modules/a-mail/package.json +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-mail/src/.metadata/index.ts +38 -30
- package/vona/src/suite-vendor/a-vona/modules/a-mail/src/types/config.ts +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-menu/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-menu/src/.metadata/index.ts +8 -8
- package/vona/src/suite-vendor/a-vona/modules/a-meta/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-meta/src/.metadata/index.ts +4 -4
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/.metadata/index.ts +15 -18
- package/vona/src/suite-vendor/a-vona/modules/a-onion/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-onion/src/.metadata/index.ts +11 -11
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/src/.metadata/index.ts +15 -16
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/src/types/decorator.ts +2 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/src/types/permissions.ts +24 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapischema/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapischema/src/.metadata/index.ts +17 -17
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/.metadata/index.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/.metadata/index.ts +34 -39
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/bean.model/bean.model_view.ts +10 -6
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/columns_.ts +1 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/databaseDialectBase_.ts +37 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/transactionFiber_.ts +8 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/transaction_.ts +5 -8
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/columns.ts +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/.metadata/index.ts +8 -8
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/bean/databaseDialect.mysql.ts +28 -0
- package/vona/src/suite-vendor/a-vona/modules/a-ormutils/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-ormutils/src/.metadata/index.ts +4 -4
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +4 -1
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/.metadata/index.ts +35 -22
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/bean.permission.ts +61 -8
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/event.retrievePermissionAction.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/summerCache.permissionActionByUser.ts +24 -0
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/dto/permissions.tsx +18 -1
- package/vona/src/suite-vendor/a-vona/modules/a-permission/test/permission.test.ts +340 -0
- package/vona/src/suite-vendor/a-vona/modules/a-play/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-play/src/.metadata/index.ts +13 -13
- package/vona/src/suite-vendor/a-vona/modules/a-printtip/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-printtip/src/.metadata/index.ts +11 -12
- package/vona/src/suite-vendor/a-vona/modules/a-queue/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-queue/src/.metadata/index.ts +15 -17
- package/vona/src/suite-vendor/a-vona/modules/a-ratelimit/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-ratelimit/src/.metadata/index.ts +0 -1
- package/vona/src/suite-vendor/a-vona/modules/a-redis/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-redis/src/.metadata/index.ts +12 -13
- package/vona/src/suite-vendor/a-vona/modules/a-redlock/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-redlock/src/.metadata/index.ts +7 -8
- package/vona/src/suite-vendor/a-vona/modules/a-retryable/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-retryable/src/.metadata/index.ts +8 -8
- package/vona/src/suite-vendor/a-vona/modules/a-runtime/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-runtime/src/.metadata/index.ts +12 -13
- package/vona/src/suite-vendor/a-vona/modules/a-schedule/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-schedule/src/.metadata/index.ts +23 -26
- package/vona/src/suite-vendor/a-vona/modules/a-security/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-security/src/.metadata/index.ts +12 -12
- package/vona/src/suite-vendor/a-vona/modules/a-security/src/bean/bean.security.ts +78 -0
- package/vona/src/suite-vendor/a-vona/modules/a-security/src/bean/middlewareSystem.cors.ts +4 -2
- package/vona/src/suite-vendor/a-vona/modules/a-security/src/index.ts +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-security/src/types/index.ts +7 -0
- package/vona/src/suite-vendor/a-vona/modules/a-security/test/origin.test.ts +178 -0
- package/vona/src/suite-vendor/a-vona/modules/a-serialization/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-serialization/src/.metadata/index.ts +16 -16
- package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-startup/src/.metadata/index.ts +19 -22
- package/vona/src/suite-vendor/a-vona/modules/a-static/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-static/src/.metadata/index.ts +13 -14
- package/vona/src/suite-vendor/a-vona/modules/a-summer/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-summer/src/.metadata/index.ts +10 -10
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/src/.metadata/index.ts +16 -17
- package/vona/src/suite-vendor/a-vona/modules/a-telemetry/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-telemetry/src/.metadata/index.ts +15 -16
- package/vona/src/suite-vendor/a-vona/modules/a-upload/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-upload/src/.metadata/index.ts +8 -8
- package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/.metadata/index.ts +26 -35
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/bean/guard.passport.ts +4 -2
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/bean/guard.roleName.ts +5 -23
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/lib/passport.ts +17 -2
- package/vona/src/suite-vendor/a-vona/modules/a-validation/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-validation/src/.metadata/index.ts +7 -7
- package/vona/src/suite-vendor/a-vona/modules/a-version/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-version/src/.metadata/index.ts +62 -37
- package/vona/src/suite-vendor/a-vona/modules/a-vona/package.json +1 -2
- package/vona/src/suite-vendor/a-vona/modules/a-vona/src/.metadata/index.ts +4 -4
- package/vona/src/suite-vendor/a-vona/modules/a-web/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/.metadata/index.ts +27 -30
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/lib/decorator/arguments.ts +5 -0
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/lib/decorator/pipesArgument.ts +3 -1
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/lib/middleware/extractValue.ts +5 -0
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/types/controller.ts +3 -0
- package/vona/src/suite-vendor/a-vona/modules/a-worker/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-worker/src/.metadata/index.ts +15 -15
- package/vona/src/suite-vendor/a-vona/modules/a-zod/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-zod/src/.metadata/index.ts +4 -4
- package/vona/src/suite-vendor/a-vona/package.json +2 -3
- package/vona/src/suite-vendor/a-vona/tsconfig.json +0 -3
- package/zova/env/.env.admin +1 -0
- package/zova/env/.env.ssr.web +0 -1
- package/zova/env/.env.web +1 -0
- package/zova/package.original.json +1 -1
- package/zova/packages-cli/cli/package.json +2 -2
- package/zova/packages-cli/cli-set-front/package.json +1 -1
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +15 -4
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.tools.metadata.ts +1 -0
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +1 -1
- package/zova/packages-zova/zova-core/src/core/component/locale.ts +10 -3
- package/zova/packages-zova/zova-core/src/core/sys/util.ts +6 -0
- package/zova/pnpm-lock.yaml +94 -25
- package/zova/src/suite/a-commerce/modules/commerce-catalog/src/.metadata/index.ts +21 -21
- package/zova/src/suite/a-commerce/modules/commerce-catalog/src/api/openapi/schemas.ts +92 -46
- package/zova/src/suite/a-commerce/modules/commerce-catalog/src/api/openapi/types.ts +834 -499
- package/zova/src/suite/a-commerce/modules/commerce-member/src/.metadata/index.ts +22 -22
- package/zova/src/suite/a-commerce/modules/commerce-member/src/api/openapi/schemas.ts +104 -50
- package/zova/src/suite/a-commerce/modules/commerce-member/src/api/openapi/types.ts +1202 -667
- package/zova/src/suite/a-commerce/modules/commerce-payment/src/.metadata/index.ts +5 -5
- package/zova/src/suite/a-commerce/modules/commerce-promotion/src/.metadata/index.ts +18 -18
- package/zova/src/suite/a-commerce/modules/commerce-promotion/src/api/openapi/schemas.ts +136 -62
- package/zova/src/suite/a-commerce/modules/commerce-promotion/src/api/openapi/types.ts +1564 -874
- package/zova/src/suite/a-commerce/modules/commerce-siteadmin/src/.metadata/index.ts +24 -24
- package/zova/src/suite/a-commerce/modules/commerce-siteadmin/src/api/openapi/schemas.ts +413 -59
- package/zova/src/suite/a-commerce/modules/commerce-siteadmin/src/api/openapi/types.ts +6290 -1946
- package/zova/src/suite/a-commerce/modules/commerce-siteweb/src/.metadata/index.ts +5 -5
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/.metadata/index.ts +29 -29
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/schemas.ts +112 -58
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/types.ts +980 -721
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/bean/tableCell.actionRefund.tsx +1 -1
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/bean/tableCell.actionShip.tsx +1 -1
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/payment/controller.tsx +1 -3
- package/zova/src/suite/a-demo/modules/demo-basic/src/.metadata/index.ts +23 -23
- package/zova/src/suite/a-demo/modules/demo-todo/src/.metadata/index.ts +17 -17
- package/zova/src/suite/a-devui/modules/devui-adapter/src/.metadata/index.ts +10 -10
- package/zova/src/suite/a-home/modules/home-api/cli/openapi.config.ts +1 -0
- package/zova/src/suite/a-home/modules/home-api/mock/passport.fake.ts +1 -1
- package/zova/src/suite/a-home/modules/home-api/src/.metadata/index.ts +61 -31
- package/zova/src/suite/a-home/modules/home-api/src/api/homeUserAccount.ts +171 -0
- package/zova/src/suite/a-home/modules/home-api/src/api/openapi/schemas.ts +96 -50
- package/zova/src/suite/a-home/modules/home-api/src/api/openapi/types.ts +857 -504
- package/zova/src/suite/a-home/modules/home-api/src/apiSchema/homeUserAccount.ts +62 -0
- package/zova/src/suite/a-home/modules/home-base/assets/img/avatar_user.png +0 -0
- package/zova/src/suite/a-home/modules/home-base/src/.metadata/index.ts +16 -16
- package/zova/src/suite/a-home/modules/home-base/src/config/config.ts +5 -0
- package/zova/src/suite/a-home/modules/home-base/src/service/routerGuards.ts +1 -8
- package/zova/src/suite/a-home/modules/home-icon/src/.metadata/index.ts +5 -5
- package/zova/src/suite/a-home/modules/home-indexadmin/src/.metadata/index.ts +11 -11
- package/zova/src/suite/a-home/modules/home-indexweb/src/.metadata/index.ts +9 -9
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/.metadata/index.ts +19 -19
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/render.user.tsx +19 -2
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/config/locale/en-us.ts +1 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/config/locale/zh-cn.ts +1 -0
- package/zova/src/suite/a-home/modules/home-layoutempty/src/.metadata/index.ts +7 -7
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/component/layoutWeb.ts +1 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/index.ts +23 -15
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.header.tsx +1 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.tsx +4 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.user.tsx +68 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/config/locale/en-us.ts +11 -8
- package/zova/src/suite/a-home/modules/home-layoutweb/src/config/locale/zh-cn.ts +11 -8
- package/zova/src/suite/a-home/modules/home-login/src/.metadata/index.ts +38 -18
- package/zova/src/suite/a-home/modules/home-login/src/.metadata/page/passwordResetRequest.ts +9 -0
- package/zova/src/suite/a-home/modules/home-login/src/.metadata/page/register.ts +5 -0
- package/zova/src/suite/a-home/modules/home-login/src/config/locale/en-us.ts +14 -0
- package/zova/src/suite/a-home/modules/home-login/src/config/locale/zh-cn.ts +12 -0
- package/zova/src/suite/a-home/modules/home-login/src/page/login/controller.tsx +10 -0
- package/zova/src/suite/a-home/modules/home-login/src/page/login/render.tsx +14 -0
- package/zova/src/suite/a-home/modules/home-login/src/page/passwordResetRequest/controller.tsx +130 -0
- package/zova/src/suite/a-home/modules/home-login/src/page/register/controller.tsx +124 -0
- package/zova/src/suite/a-home/modules/home-login/src/routes.ts +20 -0
- package/zova/src/suite/a-home/modules/home-passport/src/.metadata/index.ts +8 -8
- package/zova/src/suite/a-home/modules/home-passport/src/lib/permissionActionMatcher.ts +37 -0
- package/zova/src/suite/a-home/modules/home-passport/src/model/passport.ts +32 -12
- package/zova/src/suite/a-home/modules/home-passport/test/lib/permissionActionMatcher.test.ts +80 -0
- package/zova/src/suite/a-home/modules/home-theme/src/.metadata/index.ts +13 -13
- package/zova/src/suite/a-home/modules/home-user/package.json +60 -0
- package/zova/src/suite/a-home/modules/home-user/src/.metadata/index.ts +168 -0
- package/zova/src/suite/a-home/modules/home-user/src/.metadata/locales.ts +7 -0
- package/zova/src/suite/a-home/modules/home-user/src/.metadata/page/account.ts +5 -0
- package/zova/src/suite/a-home/modules/home-user/src/.metadata/page/activation.ts +16 -0
- package/zova/src/suite/a-home/modules/home-user/src/.metadata/page/passwordReset.ts +16 -0
- package/zova/src/suite/a-home/modules/home-user/src/.metadata/page/passwordSet.ts +16 -0
- package/zova/src/suite/a-home/modules/home-user/src/.metadata/this.ts +2 -0
- package/zova/src/suite/a-home/modules/home-user/src/config/locale/en-us.ts +52 -0
- package/zova/src/suite/a-home/modules/home-user/src/config/locale/zh-cn.ts +49 -0
- package/zova/src/suite/a-home/modules/home-user/src/index.ts +2 -0
- package/zova/src/suite/a-home/modules/home-user/src/model/account.ts +126 -0
- package/zova/src/suite/a-home/modules/home-user/src/page/account/controller.tsx +357 -0
- package/zova/src/suite/a-home/modules/home-user/src/page/activation/controller.tsx +83 -0
- package/zova/src/suite/a-home/modules/home-user/src/page/passwordReset/controller.tsx +138 -0
- package/zova/src/suite/a-home/modules/home-user/src/page/passwordSet/controller.tsx +138 -0
- package/zova/src/suite/a-home/modules/home-user/src/routes.ts +44 -0
- package/zova/src/suite/a-home/modules/home-user/tsconfig.build.json +13 -0
- package/zova/src/suite/a-home/modules/home-user/tsconfig.json +5 -0
- package/zova/src/suite/a-home/package.json +2 -1
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/index.ts +25 -25
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/schemas.ts +136 -62
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/types.ts +1601 -884
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionDeleteForce.tsx +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-adapter/src/.metadata/index.ts +4 -4
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/.metadata/index.ts +12 -12
- package/zova/src/suite/cabloy-basic/modules/basic-captcha/src/.metadata/index.ts +8 -8
- package/zova/src/suite/cabloy-basic/modules/basic-commands/src/.metadata/index.ts +9 -9
- package/zova/src/suite/cabloy-basic/modules/basic-commandssync/src/.metadata/index.ts +9 -9
- package/zova/src/suite/cabloy-basic/modules/basic-currency/src/.metadata/index.ts +13 -13
- package/zova/src/suite/cabloy-basic/modules/basic-date/src/.metadata/index.ts +13 -13
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/index.ts +21 -21
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/.metadata/index.ts +26 -26
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/api/openapi/schemas.ts +417 -59
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/api/openapi/types.ts +6316 -1926
- package/zova/src/suite/cabloy-basic/modules/basic-form/src/.metadata/index.ts +12 -12
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/.metadata/component/imageUploader.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/.metadata/index.ts +39 -26
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/api/openapi/schemas.ts +417 -59
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/api/openapi/types.ts +6316 -1926
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/component/formFieldImage/controller.tsx +194 -514
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/component/imageUploader/controller.tsx +386 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/config/locale/en-us.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/config/locale/zh-cn.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/lib/imageTransform.tsx +296 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/lib/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-input/src/.metadata/index.ts +9 -9
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/.metadata/index.ts +19 -19
- package/zova/src/suite/cabloy-basic/modules/basic-page/src/.metadata/index.ts +8 -8
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/.metadata/index.ts +8 -8
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/component/blockToolbarRow/controller.tsx +9 -2
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/index.ts +13 -13
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/.metadata/index.ts +13 -13
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/bean/tableCell.select.tsx +2 -3
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/formFieldSelect/controller.tsx +2 -3
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/select/controller.tsx +7 -7
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/lib/utils.ts +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-select/test/lib/utils.test.ts +28 -0
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/.metadata/index.ts +16 -16
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/bean/tableCell.actionOperationsRow.tsx +3 -1
- package/zova/src/suite/cabloy-basic/modules/basic-text/src/.metadata/index.ts +13 -13
- package/zova/src/suite-vendor/a-cabloy/modules/a-rbac/package.json +52 -0
- package/zova/src/suite-vendor/a-cabloy/modules/a-rbac/src/.metadata/index.ts +26 -0
- package/zova/src/suite-vendor/a-cabloy/modules/a-rbac/src/.metadata/this.ts +2 -0
- package/zova/src/suite-vendor/a-cabloy/modules/a-rbac/src/index.ts +1 -0
- package/zova/src/suite-vendor/a-cabloy/modules/a-rbac/tsconfig.build.json +13 -0
- package/zova/src/suite-vendor/a-cabloy/modules/a-rbac/tsconfig.json +5 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +1 -1
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/.metadata/index.ts +15 -15
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/lib/deleteRequest.ts +12 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/model/resource.ts +12 -6
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/test/lib/deleteRequest.test.ts +37 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/test/model/resource.types.ts +24 -0
- package/zova/src/suite-vendor/a-cabloy/package.json +3 -2
- package/zova/src/suite-vendor/a-pay/modules/a-pay/cli/openapi.config.ts +1 -1
- package/zova/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/.metadata/index.ts +43 -43
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/api/openapi/schemas.ts +120 -58
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/api/openapi/types.ts +1408 -938
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/api/payPaymentSession.ts +74 -0
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/apiSchema/payPaymentSession.ts +25 -0
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/model/paymentSession.ts +3 -3
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/cli/openapi.config.ts +1 -1
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/.metadata/index.ts +34 -34
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/api/openapi/schemas.ts +140 -66
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/api/openapi/types.ts +1621 -891
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/api/payMockMockPayment.ts +34 -0
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/apiSchema/payMockMockPayment.ts +13 -0
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/model/payMockPayment.ts +3 -3
- package/zova/src/suite-vendor/a-pay/modules/pay-paypal/package.json +1 -1
- package/zova/src/suite-vendor/a-pay/modules/pay-paypal/src/.metadata/index.ts +4 -4
- package/zova/src/suite-vendor/a-pay/modules/pay-stripe/package.json +1 -1
- package/zova/src/suite-vendor/a-pay/modules/pay-stripe/src/.metadata/index.ts +4 -4
- package/zova/src/suite-vendor/a-pay/package.json +5 -5
- package/zova/src/suite-vendor/a-zova/modules/a-api/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-api/src/.metadata/index.ts +7 -7
- package/zova/src/suite-vendor/a-zova/modules/a-app/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-app/src/.metadata/index.ts +8 -8
- package/zova/src/suite-vendor/a-zova/modules/a-bean/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-bean/src/.metadata/index.ts +15 -15
- package/zova/src/suite-vendor/a-zova/modules/a-behavior/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-behavior/src/.metadata/index.ts +25 -25
- package/zova/src/suite-vendor/a-zova/modules/a-behaviors/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-behaviors/src/.metadata/index.ts +9 -9
- package/zova/src/suite-vendor/a-zova/modules/a-boundary/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-boundary/src/.metadata/index.ts +5 -5
- package/zova/src/suite-vendor/a-zova/modules/a-command/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/src/.metadata/index.ts +5 -5
- package/zova/src/suite-vendor/a-zova/modules/a-fetch/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-fetch/src/.metadata/index.ts +14 -14
- package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/.metadata/index.ts +12 -12
- package/zova/src/suite-vendor/a-zova/modules/a-icon/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-icon/src/.metadata/index.ts +18 -18
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/src/.metadata/index.ts +8 -8
- package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-logger/src/.metadata/index.ts +9 -9
- package/zova/src/suite-vendor/a-zova/modules/a-meta/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-meta/src/.metadata/index.ts +5 -5
- package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-model/src/.metadata/index.ts +12 -12
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +3 -2
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/.metadata/index.ts +13 -13
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/monkey.ts +16 -27
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/permissions.ts +18 -1
- package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/.metadata/index.ts +27 -27
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/monkey.ts +9 -6
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/monkeySys.ts +15 -5
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/types/router.ts +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routerstack/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-routerstack/src/.metadata/index.ts +13 -13
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/src/.metadata/index.ts +13 -13
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/.metadata/index.ts +9 -9
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssr.ts +15 -4
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssrNavigation.ts +40 -0
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssrProfile.ts +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/monkey.ts +20 -6
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/test/lib/ssrNavigation.test.ts +69 -0
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/test/lib/ssrProfile.test.ts +25 -6
- package/zova/src/suite-vendor/a-zova/modules/a-ssrhmr/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssrhmr/src/.metadata/index.ts +4 -4
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/src/.metadata/index.ts +10 -10
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/src/service/ssrHandler.ts +1 -2
- package/zova/src/suite-vendor/a-zova/modules/a-style/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-style/src/.metadata/index.ts +9 -9
- package/zova/src/suite-vendor/a-zova/modules/a-style/src/bean/bean.theme.ts +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/.metadata/index.ts +12 -12
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-zod/src/.metadata/index.ts +9 -9
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zova/src/.metadata/index.ts +5 -5
- package/zova/src/suite-vendor/a-zova/package.json +26 -26
- package/vona/src/suite/a-home/modules/home-user/src/bean/eventListener.emailConfirmCallback.ts +0 -32
- package/vona/src/suite/a-home/modules/home-user/src/bean/eventListener.passwordResetCallback.ts +0 -30
- package/vona/src/suite/a-home/modules/home-user/src/bean/eventListener.register.ts +0 -27
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/.metadata/index.ts +0 -207
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/.metadata/locales.ts +0 -18
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/.metadata/this.ts +0 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/bean/bean.mailConfirm.ts +0 -63
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/bean/cacheRedis.emailConfirm.ts +0 -17
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/bean/event.emailConfirmCallback.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/bean/event.passwordResetCallback.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/config/locale/en-us.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/config/locale/mail/en-us.ts +0 -29
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/config/locale/mail/zh-cn.ts +0 -29
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/config/locale/zh-cn.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/controller/mail.ts +0 -34
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/index.ts +0 -2
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/api/paymentSession.ts +0 -74
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/apiSchema/paymentSession.ts +0 -25
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/api/payMockPayment.ts +0 -34
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/apiSchema/payMockPayment.ts +0 -13
- /package/vona/patches/{zova-core@5.1.84.patch → zova-core@5.1.85.patch} +0 -0
- /package/vona/src/suite-vendor/{a-vona/modules/a-mailconfirm → a-cabloy/modules/a-rbac}/tsconfig.build.json +0 -0
- /package/vona/src/suite-vendor/{a-vona/modules/a-mailconfirm → a-cabloy/modules/a-rbac}/tsconfig.json +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ContextRoute } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { beanFullNameFromOnionName, BeanBase } from 'vona';
|
|
4
|
+
import { Bean } from 'vona-module-a-bean';
|
|
5
|
+
import { getCacheControllerRoutes } from 'vona-module-a-web';
|
|
6
|
+
|
|
7
|
+
import type { IRbacActionDescriptor } from '../types/rbac.ts';
|
|
8
|
+
import type { IGuardOptionsRbac } from './guard.rbac.ts';
|
|
9
|
+
|
|
10
|
+
import { rbacActionKey } from '../lib/rbac.ts';
|
|
11
|
+
|
|
12
|
+
const BeanFullNameGuardRbac = beanFullNameFromOnionName('a-rbac:rbac', 'guard');
|
|
13
|
+
|
|
14
|
+
@Bean()
|
|
15
|
+
export class BeanRbacCatalog extends BeanBase {
|
|
16
|
+
private _catalog: Map<string, IRbacActionDescriptor> | undefined;
|
|
17
|
+
|
|
18
|
+
getAction(route: ContextRoute): IRbacActionDescriptor | undefined {
|
|
19
|
+
return this.getCatalog().get(rbacActionKey(route.controllerBeanFullName, route.action));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
getCatalog(): ReadonlyMap<string, IRbacActionDescriptor> {
|
|
23
|
+
if (!this._catalog) this._catalog = this.createCatalog();
|
|
24
|
+
return this._catalog;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
clear(): void {
|
|
28
|
+
this._catalog = undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private createCatalog(): Map<string, IRbacActionDescriptor> {
|
|
32
|
+
const catalog = new Map<string, IRbacActionDescriptor>();
|
|
33
|
+
const routesByController = getCacheControllerRoutes(this.app);
|
|
34
|
+
for (const routes of Object.values(routesByController)) {
|
|
35
|
+
for (const route of routes) {
|
|
36
|
+
const options = route.route.meta?.[BeanFullNameGuardRbac] as IGuardOptionsRbac | undefined;
|
|
37
|
+
if (!options) continue;
|
|
38
|
+
const actionKey = rbacActionKey(route.controllerBeanFullName, route.action);
|
|
39
|
+
catalog.set(actionKey, {
|
|
40
|
+
actionKey,
|
|
41
|
+
controllerBeanFullName: route.controllerBeanFullName,
|
|
42
|
+
action: route.action,
|
|
43
|
+
route,
|
|
44
|
+
options: Object.freeze({ ...options }),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
this.resolveActionInherit(catalog, routesByController);
|
|
49
|
+
return catalog;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private resolveActionInherit(
|
|
53
|
+
catalog: ReadonlyMap<string, IRbacActionDescriptor>,
|
|
54
|
+
routesByController: Record<string, ContextRoute[]>,
|
|
55
|
+
): void {
|
|
56
|
+
for (const descriptor of catalog.values()) {
|
|
57
|
+
if (!descriptor.options.actionInherit) continue;
|
|
58
|
+
const routes = routesByController[descriptor.controllerBeanFullName] ?? [];
|
|
59
|
+
const routesByAction = new Map(routes.map(route => [route.action, route]));
|
|
60
|
+
descriptor.actionInheritKey = this.resolveActionInheritKey(
|
|
61
|
+
descriptor,
|
|
62
|
+
catalog,
|
|
63
|
+
routesByAction,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private resolveActionInheritKey(
|
|
69
|
+
descriptor: IRbacActionDescriptor,
|
|
70
|
+
catalog: ReadonlyMap<string, IRbacActionDescriptor>,
|
|
71
|
+
routesByAction: ReadonlyMap<string, ContextRoute>,
|
|
72
|
+
): string {
|
|
73
|
+
const seen = new Set<string>([descriptor.actionKey]);
|
|
74
|
+
let current = descriptor;
|
|
75
|
+
while (current.options.actionInherit) {
|
|
76
|
+
const action = current.options.actionInherit;
|
|
77
|
+
if (action === current.action) {
|
|
78
|
+
throw new Error(`RBAC actionInherit cannot reference itself: ${current.actionKey}`);
|
|
79
|
+
}
|
|
80
|
+
const route = routesByAction.get(action);
|
|
81
|
+
if (!route) {
|
|
82
|
+
throw new Error(`RBAC actionInherit target not found: ${current.actionKey} -> ${action}`);
|
|
83
|
+
}
|
|
84
|
+
const targetKey = rbacActionKey(current.controllerBeanFullName, action);
|
|
85
|
+
if (seen.has(targetKey)) {
|
|
86
|
+
throw new Error(`RBAC actionInherit cycle: ${descriptor.actionKey}`);
|
|
87
|
+
}
|
|
88
|
+
seen.add(targetKey);
|
|
89
|
+
const target = catalog.get(targetKey);
|
|
90
|
+
if (!target) return targetKey;
|
|
91
|
+
current = target;
|
|
92
|
+
}
|
|
93
|
+
return current.actionKey;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import type { TableIdentity } from 'table-identity';
|
|
2
|
+
import type { TypeModelWhere } from 'vona-module-a-orm';
|
|
3
|
+
|
|
4
|
+
import { BeanBase, beanFullNameFromOnionName } from 'vona';
|
|
5
|
+
import { Bean } from 'vona-module-a-bean';
|
|
6
|
+
|
|
7
|
+
import type { IRbacActionDescriptor, IRbacPolicyDecision, IRbacScopeTerm } from '../types/rbac.ts';
|
|
8
|
+
import type { IRbacScopeAccess, IRbacScopeAdapter } from '../types/scope.ts';
|
|
9
|
+
|
|
10
|
+
import { getRbacDecision, hasRbacAllScope, rbacActionKey } from '../lib/rbac.ts';
|
|
11
|
+
|
|
12
|
+
@Bean()
|
|
13
|
+
export class BeanRbacScope extends BeanBase {
|
|
14
|
+
private _scopeAdapter: IRbacScopeAdapter | undefined;
|
|
15
|
+
|
|
16
|
+
async isUnrestricted(): Promise<boolean> {
|
|
17
|
+
return await this.scopeAdapter.isUnrestricted();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async current(actionKey?: string): Promise<IRbacScopeAccess> {
|
|
21
|
+
const action = this.resolveAction(actionKey);
|
|
22
|
+
if (!action) this.app.throw(403);
|
|
23
|
+
|
|
24
|
+
const decision = getRbacDecision(this.ctx);
|
|
25
|
+
if (!this.isDecisionForAction(decision, action)) this.app.throw(403);
|
|
26
|
+
|
|
27
|
+
const unrestricted = hasRbacAllScope(decision);
|
|
28
|
+
const ownerValues =
|
|
29
|
+
action.action === 'create'
|
|
30
|
+
? await this.prepareOwnerValues(action, decision, unrestricted)
|
|
31
|
+
: undefined;
|
|
32
|
+
return this.createAccess(action, decision, unrestricted, ownerValues);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private get scopeAdapter(): IRbacScopeAdapter {
|
|
36
|
+
if (!this._scopeAdapter) {
|
|
37
|
+
const beanFullName = beanFullNameFromOnionName(
|
|
38
|
+
this.scope.config.adapter.rbacScope,
|
|
39
|
+
'service',
|
|
40
|
+
);
|
|
41
|
+
this._scopeAdapter = this.bean._getBean(beanFullName) as unknown as IRbacScopeAdapter;
|
|
42
|
+
}
|
|
43
|
+
return this._scopeAdapter;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private async prepareOwnerValues(
|
|
47
|
+
action: IRbacActionDescriptor,
|
|
48
|
+
decision: IRbacPolicyDecision,
|
|
49
|
+
unrestricted: boolean,
|
|
50
|
+
): Promise<Record<string, TableIdentity | null | undefined>> {
|
|
51
|
+
const values = await this.scopeAdapter.ownerValues(action, decision);
|
|
52
|
+
const departmentField = action.options.dataScopeField ?? 'departmentId';
|
|
53
|
+
const ownerField = action.options.dataScopeMineField ?? 'userIdOwner';
|
|
54
|
+
const ownerValues = {
|
|
55
|
+
[departmentField]: values.departmentId,
|
|
56
|
+
[ownerField]: values.userIdOwner,
|
|
57
|
+
};
|
|
58
|
+
if (!this.matches(action, decision, unrestricted, ownerValues)) this.app.throw(403);
|
|
59
|
+
return ownerValues;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private createAccess(
|
|
63
|
+
action: IRbacActionDescriptor,
|
|
64
|
+
decision: IRbacPolicyDecision,
|
|
65
|
+
unrestricted: boolean,
|
|
66
|
+
ownerValues: Record<string, TableIdentity | null | undefined> | undefined,
|
|
67
|
+
): IRbacScopeAccess {
|
|
68
|
+
return {
|
|
69
|
+
action,
|
|
70
|
+
decision,
|
|
71
|
+
unrestricted,
|
|
72
|
+
ownerValues: () => {
|
|
73
|
+
if (!ownerValues) this.app.throw(500, 'RBAC scope owner values are not initialized');
|
|
74
|
+
return { ...ownerValues };
|
|
75
|
+
},
|
|
76
|
+
where: (callerWhere?: TypeModelWhere<any>) =>
|
|
77
|
+
this.where(action, decision, unrestricted, callerWhere),
|
|
78
|
+
checkEntry: (entry: object | undefined) => {
|
|
79
|
+
if (entry !== undefined && !this.matches(action, decision, unrestricted, entry)) {
|
|
80
|
+
this.app.throw(403);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
checkEntries: (entries: readonly object[]) => {
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
if (!this.matches(action, decision, unrestricted, entry)) this.app.throw(403);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
permissionProjection: () => this.permissionProjection(action, decision, unrestricted),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
private permissionProjection(
|
|
93
|
+
action: IRbacActionDescriptor,
|
|
94
|
+
decision: IRbacPolicyDecision,
|
|
95
|
+
unrestricted: boolean,
|
|
96
|
+
) {
|
|
97
|
+
const matcher =
|
|
98
|
+
unrestricted || !action.options.dataScope
|
|
99
|
+
? { mode: 'all' as const }
|
|
100
|
+
: {
|
|
101
|
+
mode: 'any' as const,
|
|
102
|
+
rules: (decision.terms ?? []).flatMap(term => {
|
|
103
|
+
if (term.dataScope === 'all') return [];
|
|
104
|
+
if (term.dataScope === 'mine') {
|
|
105
|
+
return [
|
|
106
|
+
{
|
|
107
|
+
field: action.options.dataScopeMineField ?? 'userIdOwner',
|
|
108
|
+
values: [term.ownerId],
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
return [
|
|
113
|
+
{
|
|
114
|
+
field: action.options.dataScopeField ?? 'departmentId',
|
|
115
|
+
values: [...term.departmentIds],
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
}),
|
|
119
|
+
};
|
|
120
|
+
if (matcher.mode === 'any' && matcher.rules.length === 0) this.app.throw(403);
|
|
121
|
+
return { key: action.actionKey, allowed: decision.allowed, matcher };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private where(
|
|
125
|
+
action: IRbacActionDescriptor,
|
|
126
|
+
decision: IRbacPolicyDecision,
|
|
127
|
+
unrestricted: boolean,
|
|
128
|
+
callerWhere?: TypeModelWhere<any>,
|
|
129
|
+
): TypeModelWhere<any> | undefined {
|
|
130
|
+
if (unrestricted) return callerWhere;
|
|
131
|
+
const scopeWhere = this.scopeWhere(action, decision);
|
|
132
|
+
if (!scopeWhere) this.app.throw(403);
|
|
133
|
+
if (!callerWhere) return scopeWhere;
|
|
134
|
+
return { _and_: { _and_: callerWhere, _and_0: scopeWhere } } as TypeModelWhere<any>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private scopeWhere(
|
|
138
|
+
action: IRbacActionDescriptor,
|
|
139
|
+
decision: IRbacPolicyDecision,
|
|
140
|
+
): TypeModelWhere<any> | undefined {
|
|
141
|
+
const predicates = (decision.terms ?? []).flatMap(term => this.termPredicates(action, term));
|
|
142
|
+
if (!predicates.length) return undefined;
|
|
143
|
+
return (predicates.length === 1 ? predicates[0] : { _or_: predicates }) as TypeModelWhere<any>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private matches(
|
|
147
|
+
action: IRbacActionDescriptor,
|
|
148
|
+
decision: IRbacPolicyDecision,
|
|
149
|
+
unrestricted: boolean,
|
|
150
|
+
row: object,
|
|
151
|
+
): boolean {
|
|
152
|
+
const values = row as Record<string, unknown>;
|
|
153
|
+
if (unrestricted) return true;
|
|
154
|
+
return (decision.terms ?? []).some(term => {
|
|
155
|
+
if (term.dataScope === 'all') return true;
|
|
156
|
+
if (term.dataScope === 'mine') {
|
|
157
|
+
const field = action.options.dataScopeMineField ?? 'userIdOwner';
|
|
158
|
+
return String(values[field] ?? '') === term.ownerId;
|
|
159
|
+
}
|
|
160
|
+
const field = action.options.dataScopeField ?? 'departmentId';
|
|
161
|
+
return term.departmentIds.includes(String(values[field] ?? ''));
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private resolveAction(actionKey?: string): IRbacActionDescriptor | undefined {
|
|
166
|
+
const catalog = this.bean.rbacCatalog.getCatalog();
|
|
167
|
+
if (actionKey) return catalog.get(actionKey);
|
|
168
|
+
const route = this.ctx.route;
|
|
169
|
+
return route
|
|
170
|
+
? catalog.get(rbacActionKey(route.controllerBeanFullName, route.action))
|
|
171
|
+
: undefined;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
private isDecisionForAction(
|
|
175
|
+
decision: IRbacPolicyDecision | undefined,
|
|
176
|
+
action: IRbacActionDescriptor,
|
|
177
|
+
): decision is IRbacPolicyDecision {
|
|
178
|
+
return Boolean(
|
|
179
|
+
decision?.allowed &&
|
|
180
|
+
decision.actionKey === action.actionKey &&
|
|
181
|
+
decision.action.actionKey === action.actionKey &&
|
|
182
|
+
decision.action.actionInheritKey === action.actionInheritKey &&
|
|
183
|
+
decision.action.controllerBeanFullName === action.controllerBeanFullName &&
|
|
184
|
+
decision.action.action === action.action &&
|
|
185
|
+
this.isValidTerms(decision.terms),
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private isValidTerms(terms: IRbacScopeTerm[] | undefined): boolean {
|
|
190
|
+
if (!terms?.length) return false;
|
|
191
|
+
return terms.every(term => {
|
|
192
|
+
if (term.dataScope === 'all') return true;
|
|
193
|
+
if (term.dataScope === 'mine')
|
|
194
|
+
return typeof term.ownerId === 'string' && term.ownerId.length > 0;
|
|
195
|
+
return (
|
|
196
|
+
['customDepartments', 'ownDepartment', 'ownDepartmentAndDescendants'].includes(
|
|
197
|
+
term.dataScope,
|
|
198
|
+
) &&
|
|
199
|
+
Array.isArray(term.departmentIds) &&
|
|
200
|
+
term.departmentIds.length > 0 &&
|
|
201
|
+
term.departmentIds.every(id => typeof id === 'string' && id.length > 0)
|
|
202
|
+
);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private termPredicates(
|
|
207
|
+
action: IRbacActionDescriptor,
|
|
208
|
+
term: IRbacScopeTerm,
|
|
209
|
+
): Record<string, unknown>[] {
|
|
210
|
+
if (term.dataScope === 'all') return [{}];
|
|
211
|
+
if (term.dataScope === 'mine') {
|
|
212
|
+
const field = action.options.dataScopeMineField ?? 'userIdOwner';
|
|
213
|
+
return [{ [field]: term.ownerId }];
|
|
214
|
+
}
|
|
215
|
+
const field = action.options.dataScopeField ?? 'departmentId';
|
|
216
|
+
return [{ [field]: { _in_: term.departmentIds } }];
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BeanEventBase, Event } from 'vona-module-a-event';
|
|
2
|
+
|
|
3
|
+
export type TypeRbacPolicyInvalidationKind = 'policy' | 'role' | 'scopeTopology';
|
|
4
|
+
|
|
5
|
+
export interface TypeEventPolicyInvalidatedData {
|
|
6
|
+
kind: TypeRbacPolicyInvalidationKind;
|
|
7
|
+
removedRoleIds?: string[];
|
|
8
|
+
removedScopeIds?: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type TypeEventPolicyInvalidatedResult = void;
|
|
12
|
+
|
|
13
|
+
@Event()
|
|
14
|
+
export class EventPolicyInvalidated extends BeanEventBase<
|
|
15
|
+
TypeEventPolicyInvalidatedData,
|
|
16
|
+
TypeEventPolicyInvalidatedResult
|
|
17
|
+
> {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BeanEventBase, Event } from 'vona-module-a-event';
|
|
2
|
+
|
|
3
|
+
import type { IRbacPolicyDecision, IRbacPolicyRequest } from '../types/rbac.ts';
|
|
4
|
+
|
|
5
|
+
export type TypeEventResolvePolicyData = IRbacPolicyRequest;
|
|
6
|
+
|
|
7
|
+
export type TypeEventResolvePolicyResult = IRbacPolicyDecision | undefined;
|
|
8
|
+
|
|
9
|
+
@Event()
|
|
10
|
+
export class EventResolvePolicy extends BeanEventBase<
|
|
11
|
+
TypeEventResolvePolicyData,
|
|
12
|
+
TypeEventResolvePolicyResult
|
|
13
|
+
> {}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { IDecoratorGuardOptions } from 'vona-module-a-aspect';
|
|
2
|
+
|
|
3
|
+
import { Guard, GuardBase } from 'vona-module-a-aspect';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
IRbacActionDescriptor,
|
|
7
|
+
IRbacPolicyDecision,
|
|
8
|
+
IRbacScopeTerm,
|
|
9
|
+
TypeRbacDataScope,
|
|
10
|
+
} from '../types/rbac.ts';
|
|
11
|
+
|
|
12
|
+
import { clearRbacDecision, createRbacAllScopeDecision, setRbacDecision } from '../lib/rbac.ts';
|
|
13
|
+
|
|
14
|
+
export interface IGuardOptionsRbac extends IDecoratorGuardOptions {
|
|
15
|
+
dataScope?: boolean;
|
|
16
|
+
dataScopeField?: string;
|
|
17
|
+
dataScopeMineField?: string;
|
|
18
|
+
actionInherit?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Guard<IGuardOptionsRbac>({
|
|
22
|
+
dataScopeField: 'departmentId',
|
|
23
|
+
dataScopeMineField: 'userIdOwner',
|
|
24
|
+
})
|
|
25
|
+
export class GuardRbac extends GuardBase {
|
|
26
|
+
async check(options: IGuardOptionsRbac): Promise<boolean> {
|
|
27
|
+
clearRbacDecision(this.ctx);
|
|
28
|
+
const action = this.bean.rbacCatalog.getAction(this.ctx.route);
|
|
29
|
+
if (!action) return false;
|
|
30
|
+
const effectiveAction = { ...action, options: { ...action.options, ...options } };
|
|
31
|
+
if (await this.bean.rbacScope.isUnrestricted()) {
|
|
32
|
+
setRbacDecision(this.ctx, createRbacAllScopeDecision(effectiveAction));
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const decision = await this.scope.event.resolvePolicy.emit(
|
|
37
|
+
{
|
|
38
|
+
action: effectiveAction,
|
|
39
|
+
policyActionKey: action.actionInheritKey ?? action.actionKey,
|
|
40
|
+
},
|
|
41
|
+
async () => undefined,
|
|
42
|
+
);
|
|
43
|
+
if (!this.isValidDecision(decision, effectiveAction) || !decision.allowed) return false;
|
|
44
|
+
setRbacDecision(this.ctx, { ...decision, action: effectiveAction });
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private isValidDecision(
|
|
49
|
+
decision: unknown,
|
|
50
|
+
action: IRbacActionDescriptor,
|
|
51
|
+
): decision is IRbacPolicyDecision {
|
|
52
|
+
if (!decision || typeof decision !== 'object') return false;
|
|
53
|
+
const value = decision as Partial<IRbacPolicyDecision>;
|
|
54
|
+
if (typeof value.allowed !== 'boolean' || value.actionKey !== action.actionKey) return false;
|
|
55
|
+
if (!this.isValidAction(value.action, action)) return false;
|
|
56
|
+
if (value.revision !== undefined && typeof value.revision !== 'string') return false;
|
|
57
|
+
if (value.terms !== undefined && !this.isValidTerms(value.terms)) return false;
|
|
58
|
+
return !value.allowed || !action.options.dataScope || this.isValidTerms(value.terms);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private isValidAction(value: unknown, action: IRbacActionDescriptor): boolean {
|
|
62
|
+
if (!value || typeof value !== 'object') return false;
|
|
63
|
+
const descriptor = value as Partial<IRbacActionDescriptor>;
|
|
64
|
+
return (
|
|
65
|
+
descriptor.actionKey === action.actionKey &&
|
|
66
|
+
descriptor.actionInheritKey === action.actionInheritKey &&
|
|
67
|
+
descriptor.controllerBeanFullName === action.controllerBeanFullName &&
|
|
68
|
+
descriptor.action === action.action
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private isValidTerms(value: unknown): value is IRbacScopeTerm[] {
|
|
73
|
+
return Array.isArray(value) && value.length > 0 && value.every(term => this.isValidTerm(term));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private isValidTerm(value: unknown): value is IRbacScopeTerm {
|
|
77
|
+
if (!value || typeof value !== 'object') return false;
|
|
78
|
+
const term = value as {
|
|
79
|
+
dataScope?: unknown;
|
|
80
|
+
departmentIds?: unknown;
|
|
81
|
+
ownerId?: unknown;
|
|
82
|
+
};
|
|
83
|
+
if (term.dataScope === 'all') return true;
|
|
84
|
+
if (term.dataScope === 'mine') {
|
|
85
|
+
return typeof term.ownerId === 'string' && term.ownerId.length > 0;
|
|
86
|
+
}
|
|
87
|
+
if (!this.isDepartmentDataScope(term.dataScope)) return false;
|
|
88
|
+
return (
|
|
89
|
+
Array.isArray(term.departmentIds) &&
|
|
90
|
+
term.departmentIds.length > 0 &&
|
|
91
|
+
term.departmentIds.every(id => typeof id === 'string' && id.length > 0)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private isDepartmentDataScope(
|
|
96
|
+
value: unknown,
|
|
97
|
+
): value is Exclude<TypeRbacDataScope, 'all' | 'mine'> {
|
|
98
|
+
return ['customDepartments', 'ownDepartment', 'ownDepartmentAndDescendants'].includes(
|
|
99
|
+
value as Exclude<TypeRbacDataScope, 'all' | 'mine'>,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VonaApplication } from 'vona';
|
|
2
|
+
import type { IServiceRecord } from 'vona-module-a-bean';
|
|
3
|
+
|
|
4
|
+
export function config(_app: VonaApplication) {
|
|
5
|
+
return {
|
|
6
|
+
adapter: {
|
|
7
|
+
rbacScope: 'admin-rbac:rbacScopeAdapter' as keyof IServiceRecord,
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './rbac.ts';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { VonaContext } from 'vona';
|
|
2
|
+
|
|
3
|
+
import type { IRbacCapability, IRbacPolicyDecision } from '../types/rbac.ts';
|
|
4
|
+
|
|
5
|
+
export const SymbolRbacDecision = Symbol('SymbolRbacDecision');
|
|
6
|
+
|
|
7
|
+
export function createRbacAllScopeDecision(
|
|
8
|
+
action: IRbacPolicyDecision['action'],
|
|
9
|
+
): IRbacPolicyDecision {
|
|
10
|
+
return { allowed: true, actionKey: action.actionKey, action, terms: [{ dataScope: 'all' }] };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createRbacCapability(key: string, allowed: boolean): IRbacCapability {
|
|
14
|
+
return { key, allowed };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function isRbacCapability(value: unknown): value is IRbacCapability {
|
|
18
|
+
if (!value || typeof value !== 'object') return false;
|
|
19
|
+
const capability = value as Partial<IRbacCapability>;
|
|
20
|
+
return (
|
|
21
|
+
Object.keys(capability).every(key => key === 'key' || key === 'allowed') &&
|
|
22
|
+
typeof capability.key === 'string' &&
|
|
23
|
+
capability.key.length > 0 &&
|
|
24
|
+
typeof capability.allowed === 'boolean'
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function hasRbacAllScope(decision: IRbacPolicyDecision): boolean {
|
|
29
|
+
return decision.terms?.some(term => term.dataScope === 'all') === true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function rbacActionKey(controllerBeanFullName: string, action: string): string {
|
|
33
|
+
return `${controllerBeanFullName}#${action}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function getRbacDecision(ctx: VonaContext): IRbacPolicyDecision | undefined {
|
|
37
|
+
return ctx[SymbolRbacDecision];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function setRbacDecision(ctx: VonaContext, decision: IRbacPolicyDecision): void {
|
|
41
|
+
ctx[SymbolRbacDecision] = decision;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function clearRbacDecision(ctx: VonaContext): void {
|
|
45
|
+
delete ctx[SymbolRbacDecision];
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ContextRoute } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import type { IGuardOptionsRbac } from '../bean/guard.rbac.ts';
|
|
4
|
+
|
|
5
|
+
export type TypeRbacDataScope =
|
|
6
|
+
| 'all'
|
|
7
|
+
| 'customDepartments'
|
|
8
|
+
| 'ownDepartment'
|
|
9
|
+
| 'ownDepartmentAndDescendants'
|
|
10
|
+
| 'mine';
|
|
11
|
+
|
|
12
|
+
export interface IRbacActionDescriptor {
|
|
13
|
+
actionKey: string;
|
|
14
|
+
controllerBeanFullName: string;
|
|
15
|
+
action: string;
|
|
16
|
+
actionInheritKey?: string;
|
|
17
|
+
route: ContextRoute;
|
|
18
|
+
options: IGuardOptionsRbac;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IRbacPolicyRequest {
|
|
22
|
+
action: IRbacActionDescriptor;
|
|
23
|
+
policyActionKey: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type IRbacScopeTerm =
|
|
27
|
+
| { dataScope: 'all' }
|
|
28
|
+
| {
|
|
29
|
+
dataScope: 'customDepartments' | 'ownDepartment' | 'ownDepartmentAndDescendants';
|
|
30
|
+
departmentIds: string[];
|
|
31
|
+
}
|
|
32
|
+
| { dataScope: 'mine'; ownerId: string };
|
|
33
|
+
|
|
34
|
+
export interface IRbacPolicyDecision {
|
|
35
|
+
allowed: boolean;
|
|
36
|
+
actionKey: string;
|
|
37
|
+
action: IRbacActionDescriptor;
|
|
38
|
+
terms?: IRbacScopeTerm[];
|
|
39
|
+
revision?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** A server-derived UX hint; it never grants backend authority. */
|
|
43
|
+
export interface IRbacCapability {
|
|
44
|
+
key: string;
|
|
45
|
+
allowed: boolean;
|
|
46
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TableIdentity } from 'table-identity';
|
|
2
|
+
import type { IOpenapiPermissionActionRbac } from 'vona-module-a-openapi';
|
|
3
|
+
import type { TypeModelWhere } from 'vona-module-a-orm';
|
|
4
|
+
|
|
5
|
+
import type { IRbacActionDescriptor, IRbacPolicyDecision } from './rbac.ts';
|
|
6
|
+
|
|
7
|
+
export type IRbacScopeOwnerValues = Record<string, TableIdentity | null | undefined>;
|
|
8
|
+
|
|
9
|
+
export interface IRbacScopeAdapter {
|
|
10
|
+
isUnrestricted(): Promise<boolean>;
|
|
11
|
+
ownerValues(
|
|
12
|
+
action: IRbacActionDescriptor,
|
|
13
|
+
decision: IRbacPolicyDecision,
|
|
14
|
+
): Promise<IRbacScopeOwnerValues>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IRbacScopeAccess {
|
|
18
|
+
action: IRbacActionDescriptor;
|
|
19
|
+
decision: IRbacPolicyDecision;
|
|
20
|
+
unrestricted: boolean;
|
|
21
|
+
ownerValues(): Record<string, TableIdentity | null | undefined>;
|
|
22
|
+
where(callerWhere?: TypeModelWhere<any>): TypeModelWhere<any> | undefined;
|
|
23
|
+
checkEntry(entry: object | undefined): void;
|
|
24
|
+
checkEntries(entries: readonly object[]): void;
|
|
25
|
+
/** A safe permission projection for Resource permission consumers. */
|
|
26
|
+
permissionProjection(): IOpenapiPermissionActionRbac;
|
|
27
|
+
}
|