cabloy 5.1.65 → 5.1.67
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/.claude/skills/cabloy-resource-field-update/SKILL.md +6 -0
- package/CHANGELOG.md +55 -0
- package/cabloy-docs/.vitepress/config.mjs +1 -1
- package/cabloy-docs/backend/crud-workflow.md +33 -0
- package/cabloy-docs/backend/master-detail-workflow.md +149 -0
- package/cabloy-docs/frontend/bean-scene-authoring.md +1 -1
- package/cabloy-docs/frontend/cli.md +12 -1
- package/cabloy-docs/frontend/command-scene-authoring.md +12 -1
- package/cabloy-docs/frontend/component-guide.md +10 -0
- package/cabloy-docs/frontend/permission-formscene-action-visibility-guide.md +69 -7
- package/cabloy-docs/frontend/table-cell-cookbook.md +10 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions.md +83 -2
- package/cabloy-docs/reference/bean-scene-boilerplates.md +9 -4
- package/package.json +1 -1
- package/vona/packages-cli/cabloy-cli/package.json +1 -1
- package/vona/packages-cli/cabloy-cli/src/lib/local.helper.ts +38 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/cli/templates/create/module/boilerplate/_package.json +1 -1
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoBaseName%>.tsx_ +18 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoMutateName%>.tsx_ +17 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoResItemName%>.tsx_ +60 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoViewName%>.tsx_ +17 -0
- package/vona/packages-cli/cli-set-api/package.json +2 -2
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.bean.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.module.ts +3 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.suite.ts +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.test.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.asset.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.config.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.constant.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.error.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.lib.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.locale.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.main.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.monkey.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.static.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.types.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crud.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crudBasic.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crudStart.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.masterDetail.ts +699 -0
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.metadata.ts +1 -2
- package/vona/packages-cli/cli-set-api/src/lib/beans.ts +2 -0
- package/vona/packages-cli/cli-set-api/src/lib/command/tools.masterDetail.ts +78 -0
- package/vona/packages-cli/cli-set-api/src/lib/commands.ts +2 -0
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-core/src/lib/mappedClass/type.ts +1 -0
- package/vona/packages-vona/vona-core/src/lib/mappedClass/utils.ts +36 -14
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +35 -11
- package/vona/src/suite/a-demo/modules/demo-basic/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-base/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-index/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-user/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-record/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/index.ts +232 -3
- package/vona/src/suite/a-training/modules/training-record/src/bean/ssrMenu.record.ts +29 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/en-us.ts +9 -1
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/zh-cn.ts +9 -1
- package/vona/src/suite/a-training/modules/training-record/src/controller/record.ts +59 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectBase.tsx +18 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectMutate.tsx +17 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectResItem.tsx +60 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectView.tsx +17 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordCreate.tsx +45 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectReq.tsx +38 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectRes.tsx +11 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectResItem.tsx +39 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordUpdate.tsx +45 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordView.tsx +42 -0
- package/vona/src/suite/a-training/modules/training-record/src/entity/record.tsx +23 -6
- package/vona/src/suite/a-training/modules/training-record/src/model/record.ts +15 -2
- package/vona/src/suite/a-training/modules/training-record/src/service/record.ts +50 -0
- package/vona/src/suite/a-training/modules/training-record/test/record.test.ts +138 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/package.json +53 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/index.ts +198 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/this.ts +2 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/bean/meta.index.ts +12 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/bean/meta.version.ts +21 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/config/locale/en-us.ts +9 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/config/locale/zh-cn.ts +9 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/entity/subject.tsx +42 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/index.ts +2 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/model/subject.ts +10 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/tsconfig.build.json +11 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/tsconfig.json +7 -0
- package/vona/src/suite/a-training/modules/training-student/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +8 -1
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +8 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordBase.tsx +17 -2
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordMutate.tsx +12 -17
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordResItem.tsx +26 -5
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordView.tsx +12 -14
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +6 -4
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectReq.tsx +3 -6
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSummary.tsx +1 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +14 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +14 -1
- package/vona/src/suite/a-training/modules/training-student/src/entity/student.tsx +2 -4
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +22 -5
- package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +69 -15
- package/vona/src/suite/a-training/package.json +1 -0
- package/vona/src/suite/a-training/tsconfig.json +3 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteadmin/package.json +1 -1
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-cabloy/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasource/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-socket/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssrhmr/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-status/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/package.json +1 -1
- package/vona/src/suite-vendor/a-captcha/modules/a-captcha/package.json +2 -2
- package/vona/src/suite-vendor/a-captcha/modules/captcha-simple/package.json +2 -2
- package/vona/src/suite-vendor/a-captcha/package.json +1 -1
- package/vona/src/suite-vendor/a-paypal/modules/a-paypal/package.json +2 -2
- package/vona/src/suite-vendor/a-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-aspectutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-bean/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-beanmutate/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-body/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-broadcast/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-cache/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-caching/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-election/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-error/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-event/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-executor/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmr/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmrbase/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-index/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-instance/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-jwt/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-locale/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-logger/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mail/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-menu/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-meta/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-onion/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapischema/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/const/decorator.ts +3 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/schema/makeSchemaLikes.ts +21 -17
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/utils.ts +44 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +6 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +13 -4
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/utils.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/relations_.ts +37 -16
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-ormutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-play/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-printtip/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-queue/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-redis/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-redlock/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-runtime/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-schedule/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-security/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-serialization/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-static/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-summer/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-upload/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-validation/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-version/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-vona/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-web/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/lib/decorator/bean.ts +26 -5
- package/vona/src/suite-vendor/a-vona/modules/a-worker/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-zod/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-cli/cli/package.json +3 -3
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateDetailsActionBulk/controller.tsx_ +31 -0
- package/zova/packages-cli/cli-set-front/cli/templates/create/module/boilerplate/_package.json +1 -1
- package/zova/packages-cli/cli-set-front/cli/templates/rest/component.ts +21 -0
- package/zova/packages-cli/cli-set-front/cli/templates/rest/render.ts +4 -0
- package/zova/packages-cli/cli-set-front/package.json +3 -3
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.bean.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.mock.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.module.ts +3 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.suite.ts +1 -1
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.asset.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.config.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.constant.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.error.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.icon.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.lib.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.locale.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.main.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.mainSys.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.monkey.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.monkeySys.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.types.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.config.ts +1 -4
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +2 -2
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.anotherRender.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.anotherStyle.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentEmits.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentGeneric.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentModel.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentProps.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentSlots.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.firstRender.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.firstStyle.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.pageParams.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.pageQuery.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.renameComponent.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.tools.metadata.ts +1 -2
- package/zova/packages-cli/cli-set-front/src/lib/common/cliCreateComponent.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/common/cliCreatePage.ts +2 -6
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +695 -791
- package/zova/src/suite/a-demo/modules/demo-basic/package.json +1 -1
- package/zova/src/suite/a-demo/modules/demo-todo/package.json +1 -1
- package/zova/src/suite/a-devui/modules/devui-adapter/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-api/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-base/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-icon/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexadmin/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexweb/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutadmin/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutempty/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-login/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-passport/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-theme/package.json +1 -1
- package/zova/src/suite/a-training/modules/training-student/package.json +3 -2
- package/zova/src/suite/cabloy-basic/modules/basic-adapter/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-app/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/bean/behavior.appModal.tsx +131 -13
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/config/config.ts +15 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/service/appModal.ts +23 -5
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/types/appModal.ts +30 -4
- package/zova/src/suite/cabloy-basic/modules/basic-captcha/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commands/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commandssync/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-currency/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-date/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/package.json +7 -2
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockForm.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/index.ts +149 -2
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/command.delete.tsx +47 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionDelete.tsx +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionOperationsRow.tsx +44 -6
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionUpdate.tsx +73 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionView.tsx +64 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.lineNumber.tsx +30 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/actionCreate/controller.tsx +29 -5
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx +28 -12
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockForm/controller.tsx +53 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockTable/controller.tsx +7 -2
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockToolbarBulk/controller.tsx +3 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/formFieldDetails/controller.tsx +24 -12
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/en-us.ts +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/zh-cn.ts +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/utils.ts +12 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/service/detail.tsx +172 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/detail.ts +18 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/details.ts +11 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/dialogForm.ts +22 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/index.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-form/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-input/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-page/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-resource/package.json +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/component/formFieldResourcePicker.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/index.ts +103 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/this.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/bean/tableCell.resourcePicker.tsx +46 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/component/formFieldResourcePicker/controller.tsx +157 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-select/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-table/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-text/package.json +1 -1
- package/zova/src/suite/cabloy-basic/package.json +1 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +2 -2
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/page/entry/controller.tsx +1 -2
- package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-api/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-app/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-bean/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-behavior/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-behaviors/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-boundary/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/command/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandBulk/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandDetailsRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +20 -0
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/package.json +4 -3
- package/zova/src/suite-vendor/a-zova/modules/a-command/src/types/command.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-fetch/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-icon/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-meta/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-model/src/bean/bean.model/bean.model.useQuery.ts +2 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/lib/schema.ts +20 -4
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/model/sdk.ts +4 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/action.ts +2 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/detail.ts +10 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/details.ts +4 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/index.ts +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/rest.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routerstack/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssrhmr/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-style/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-table/cli/detailsActionRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +24 -0
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +4 -3
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/component/table/controller.tsx +5 -3
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/package.json +26 -26
|
@@ -2,5 +2,7 @@ export const SymbolRouteHandlersArgumentsMeta = Symbol('SymbolRouteHandlersArgum
|
|
|
2
2
|
export const SymbolRouteHandlersArgumentsValue = Symbol('SymbolRouteHandlersArgumentsValue');
|
|
3
3
|
|
|
4
4
|
export const SymbolOpenApiOptions = Symbol('SymbolOpenApiOptions');
|
|
5
|
-
export const SymbolDecoratorRule = Symbol('SymbolDecoratorRule');
|
|
6
5
|
export const SymbolControllerResource = Symbol('SymbolControllerResource');
|
|
6
|
+
export const SymbolDecoratorRule = Symbol('SymbolDecoratorRule');
|
|
7
|
+
export const SymbolDecoratorDtoOpenapi = Symbol('SymbolDecoratorDtoOpenapi');
|
|
8
|
+
export const SymbolDecoratorDtoPipes = Symbol('SymbolDecoratorDtoPipes');
|
package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/schema/makeSchemaLikes.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Constructable } from 'vona';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISchemaObjectOptions } from 'vona-module-a-openapi';
|
|
3
3
|
|
|
4
4
|
import { isClass } from '@cabloy/utils';
|
|
5
5
|
import { appMetadata, appResource, cast } from 'vona';
|
|
@@ -8,7 +8,11 @@ import { z } from 'zod';
|
|
|
8
8
|
import type { SchemaLike, SchemaLikeCreate } from '../../types/decorator.ts';
|
|
9
9
|
|
|
10
10
|
import { SymbolDecoratorRule } from '../const/decorator.ts';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
getTargetDecoratorDtoOpenapi,
|
|
13
|
+
getTargetDecoratorDtoPipes,
|
|
14
|
+
prepareClassType,
|
|
15
|
+
} from '../utils.ts';
|
|
12
16
|
import { SymbolSchemaDynamicRefId } from './schemaDynamic.ts';
|
|
13
17
|
|
|
14
18
|
export function $makeSchema<T>(...schemaLikes: SchemaLike<T>[]): z.ZodType<T> {
|
|
@@ -82,22 +86,22 @@ export function $schema(classType: any, options?: ISchemaObjectOptions): any {
|
|
|
82
86
|
}
|
|
83
87
|
// object
|
|
84
88
|
let schema = _createSchemaObject(rules, options);
|
|
85
|
-
//
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
// dto: pipes
|
|
90
|
+
const dtoPipes = getTargetDecoratorDtoPipes(classType.prototype, true);
|
|
91
|
+
if (dtoPipes) {
|
|
92
|
+
schema = makeSchemaLikes(dtoPipes, schema) as any;
|
|
93
|
+
}
|
|
94
|
+
// dto: openapi
|
|
95
|
+
let schemaRefId = classType[SymbolSchemaDynamicRefId];
|
|
96
|
+
if (!schemaRefId) {
|
|
92
97
|
const beanOptions = appResource.getBean(classType);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
98
|
+
schemaRefId = beanOptions?.beanFullName;
|
|
99
|
+
}
|
|
100
|
+
const dtoOpenapi = getTargetDecoratorDtoOpenapi(classType.prototype, true);
|
|
101
|
+
if (schemaRefId) {
|
|
102
|
+
schema = schema.openapi(schemaRefId, dtoOpenapi);
|
|
103
|
+
} else if (dtoOpenapi) {
|
|
104
|
+
schema = schema.openapi(dtoOpenapi);
|
|
101
105
|
}
|
|
102
106
|
return schema as any;
|
|
103
107
|
}
|
|
@@ -6,10 +6,14 @@ import { ZodMetadata } from '@cabloy/zod-openapi';
|
|
|
6
6
|
import { appMetadata, appResource, cast, deepExtend, registerMappedClassMetadataKey } from 'vona';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
|
|
9
|
-
import type { TypeDecoratorRules } from '../types/decorator.ts';
|
|
9
|
+
import type { SchemaLike, TypeDecoratorRules } from '../types/decorator.ts';
|
|
10
10
|
|
|
11
11
|
import { OrderLevelBaseMap } from './const/database.ts';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
SymbolDecoratorDtoOpenapi,
|
|
14
|
+
SymbolDecoratorDtoPipes,
|
|
15
|
+
SymbolDecoratorRule,
|
|
16
|
+
} from './const/decorator.ts';
|
|
13
17
|
|
|
14
18
|
export function getTargetDecoratorRules(
|
|
15
19
|
target: object,
|
|
@@ -25,6 +29,44 @@ export function getTargetDecoratorRules(
|
|
|
25
29
|
return appMetadata.getOwnMetadataMap(true, SymbolDecoratorRule, target);
|
|
26
30
|
}
|
|
27
31
|
|
|
32
|
+
export function getTargetDecoratorDtoOpenapi(
|
|
33
|
+
target: object,
|
|
34
|
+
disableRegisterMetadata?: boolean,
|
|
35
|
+
): ISchemaObjectExtensionField | undefined {
|
|
36
|
+
if (!disableRegisterMetadata) {
|
|
37
|
+
registerMappedClassMetadataKey(target, SymbolDecoratorDtoOpenapi, {
|
|
38
|
+
replace: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return appMetadata.getOwnMetadata(SymbolDecoratorDtoOpenapi, target);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function setTargetDecoratorDtoOpenapi(
|
|
45
|
+
openapi: ISchemaObjectExtensionField | undefined,
|
|
46
|
+
target: object,
|
|
47
|
+
) {
|
|
48
|
+
appMetadata.defineMetadata(SymbolDecoratorDtoOpenapi, openapi, target);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getTargetDecoratorDtoPipes(
|
|
52
|
+
target: object,
|
|
53
|
+
disableRegisterMetadata?: boolean,
|
|
54
|
+
): SchemaLike | SchemaLike[] | undefined {
|
|
55
|
+
if (!disableRegisterMetadata) {
|
|
56
|
+
registerMappedClassMetadataKey(target, SymbolDecoratorDtoPipes, {
|
|
57
|
+
replace: true,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return appMetadata.getOwnMetadata(SymbolDecoratorDtoPipes, target);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function setTargetDecoratorDtoPipes(
|
|
64
|
+
pipes: SchemaLike | SchemaLike[] | undefined,
|
|
65
|
+
target: object,
|
|
66
|
+
) {
|
|
67
|
+
appMetadata.defineMetadata(SymbolDecoratorDtoPipes, pipes, target);
|
|
68
|
+
}
|
|
69
|
+
|
|
28
70
|
export function getTargetDecoratorRuleColumns(target: object): string[] {
|
|
29
71
|
const rules = getTargetDecoratorRules(target, true);
|
|
30
72
|
return Object.keys(rules);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-orm",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.17",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "db",
|
|
6
6
|
"keywords": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json && tsc -p tsconfig.cli.json",
|
|
32
32
|
"prepublishOnly": "npm run tsc:publish",
|
|
33
33
|
"prepack": "clean-package",
|
|
34
|
-
"postpack": "clean-package restore
|
|
34
|
+
"postpack": "clean-package restore"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"knex": "^3.2.9",
|
|
@@ -55,8 +55,8 @@ function _DtoGet_raw<
|
|
|
55
55
|
// entity
|
|
56
56
|
let entityClass = params?.dtoClass ?? getClassEntityFromClassModel(modelClass);
|
|
57
57
|
// columns
|
|
58
|
-
const columns = prepareColumns(params?.columns);
|
|
59
|
-
// always create a new class, no matter if columns empty
|
|
58
|
+
const columns = params?.dtoClass ? undefined : prepareColumns(params?.columns);
|
|
59
|
+
// always create a new class, no matter if columns empty: dtoClass keeps own fields
|
|
60
60
|
entityClass = $Class.pick(entityClass, columns as any);
|
|
61
61
|
// relations
|
|
62
62
|
_DtoGet_relations(modelClass, entityClass, params as any);
|
|
@@ -83,6 +83,10 @@ function _DtoGet_relation_handle<TRecord extends {}>(
|
|
|
83
83
|
mutateTypeTopLevel?: TypeDtoMutateType,
|
|
84
84
|
) {
|
|
85
85
|
const [relationName, relationReal, includeReal, withReal, autoload] = relation;
|
|
86
|
+
if (relationReal === false) {
|
|
87
|
+
Api.field(schemaRenderVisible(false), v.optional())(entityClass.prototype, relationName);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
86
90
|
const { type, model, options } = relationReal;
|
|
87
91
|
const modelTarget = prepareClassModel(model);
|
|
88
92
|
const optionsReal = Object.assign({}, options, { include: includeReal, with: withReal });
|
|
@@ -2,6 +2,7 @@ import type { Constructable } from 'vona';
|
|
|
2
2
|
|
|
3
3
|
import { mutate } from 'mutate-on-copy';
|
|
4
4
|
import { $Class } from 'vona';
|
|
5
|
+
import { getTargetDecoratorRuleColumns } from 'vona-module-a-openapiutils';
|
|
5
6
|
|
|
6
7
|
import type {
|
|
7
8
|
IDtoMutateParams,
|
|
@@ -54,7 +55,13 @@ export function _DtoMutate_raw<
|
|
|
54
55
|
// entity
|
|
55
56
|
let entityClass = params?.dtoClass ?? getClassEntityFromClassModel(modelClass);
|
|
56
57
|
// columns
|
|
57
|
-
let columns
|
|
58
|
+
let columns;
|
|
59
|
+
// if dtoClass, use dtoClass fields
|
|
60
|
+
if (params?.dtoClass) {
|
|
61
|
+
columns = getTargetDecoratorRuleColumns(params.dtoClass.prototype) as any;
|
|
62
|
+
} else {
|
|
63
|
+
columns = prepareColumns(params?.columns);
|
|
64
|
+
}
|
|
58
65
|
if (columns) {
|
|
59
66
|
if (!topLevel) {
|
|
60
67
|
if (mutateTypeTopLevel === 'create') {
|
|
@@ -90,9 +97,11 @@ export function _DtoMutate_raw<
|
|
|
90
97
|
}
|
|
91
98
|
if (!topLevel && relation) {
|
|
92
99
|
const [_relationName, relationReal] = relation;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
if (relationReal !== false) {
|
|
101
|
+
const { type, key } = relationReal;
|
|
102
|
+
if (type === 'hasOne' || type === 'hasMany') {
|
|
103
|
+
entityClass = $Class.omit(entityClass, key);
|
|
104
|
+
}
|
|
96
105
|
}
|
|
97
106
|
}
|
|
98
107
|
// relations
|
|
@@ -19,7 +19,7 @@ export function handleRelationsCollection(
|
|
|
19
19
|
let withReal;
|
|
20
20
|
let autoload;
|
|
21
21
|
if (relationCur === false) {
|
|
22
|
-
|
|
22
|
+
relationReal = false;
|
|
23
23
|
} else if (relationCur === true) {
|
|
24
24
|
relationReal = relationDef;
|
|
25
25
|
autoload = relationDef.options?.autoload;
|
|
@@ -99,6 +99,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
99
99
|
methodOptions?: IModelMethodOptions,
|
|
100
100
|
) {
|
|
101
101
|
const [relationName, relationReal, includeReal, withReal] = relation;
|
|
102
|
+
if (relationReal === false) return;
|
|
102
103
|
const { type, modelMiddle, model, keyFrom, keyTo, key, options } = relationReal;
|
|
103
104
|
const modelTarget = this.__getModelTarget(model, options?.meta) as BeanModelCache;
|
|
104
105
|
const optionsReal = Object.assign({}, options, { include: includeReal, with: withReal });
|
|
@@ -171,6 +172,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
171
172
|
methodOptions?: IModelMethodOptions,
|
|
172
173
|
) {
|
|
173
174
|
const [relationName, relationReal, includeReal, withReal] = relation;
|
|
175
|
+
if (relationReal === false) return;
|
|
174
176
|
const { type, modelMiddle, model, keyFrom, keyTo, key, options } = relationReal;
|
|
175
177
|
const modelTarget = this.__getModelTarget(model, options?.meta) as BeanModelCache;
|
|
176
178
|
const optionsReal = Object.assign({}, options, { include: includeReal, with: withReal });
|
|
@@ -187,7 +189,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
187
189
|
}
|
|
188
190
|
for (const entity of entities) {
|
|
189
191
|
entity[relationName] = items.find(item => {
|
|
190
|
-
if (item[key]
|
|
192
|
+
if (this.__sameTableIdentity(item[key], cast(entity).id)) {
|
|
191
193
|
if (!withKey) delete item[key];
|
|
192
194
|
return true;
|
|
193
195
|
}
|
|
@@ -199,7 +201,9 @@ export class ServiceRelations extends BeanBase {
|
|
|
199
201
|
const options2 = deepExtend({}, methodOptionsReal, optionsReal);
|
|
200
202
|
const items = await modelTarget.mget(idsTo, options2);
|
|
201
203
|
for (const entity of entities) {
|
|
202
|
-
entity[relationName] = items.find(item =>
|
|
204
|
+
entity[relationName] = items.find(item =>
|
|
205
|
+
this.__sameTableIdentity(cast(item).id, cast(entity)[key]),
|
|
206
|
+
);
|
|
203
207
|
}
|
|
204
208
|
} else if (type === 'hasMany') {
|
|
205
209
|
const idsFrom = entities.map(item => cast(item).id).filter(id => !isNil(id));
|
|
@@ -210,7 +214,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
210
214
|
for (const entity of entities) {
|
|
211
215
|
entity[relationName] = [];
|
|
212
216
|
for (const item of items) {
|
|
213
|
-
if (item[key]
|
|
217
|
+
if (this.__sameTableIdentity(item[key], cast(entity).id)) {
|
|
214
218
|
delete item[key];
|
|
215
219
|
entity[relationName].push(item);
|
|
216
220
|
}
|
|
@@ -220,7 +224,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
220
224
|
const options2 = deepExtend({}, optionsReal, { groups: key, where: { [key]: idsFrom } });
|
|
221
225
|
const items = await modelTarget.group(options2, methodOptionsReal);
|
|
222
226
|
for (const entity of entities) {
|
|
223
|
-
const item = items.find(item => item[key]
|
|
227
|
+
const item = items.find(item => this.__sameTableIdentity(item[key], cast(entity).id));
|
|
224
228
|
if (item) {
|
|
225
229
|
delete item[key];
|
|
226
230
|
}
|
|
@@ -233,7 +237,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
233
237
|
for (const entity of entities) {
|
|
234
238
|
entity[relationName] = [];
|
|
235
239
|
for (const item of items) {
|
|
236
|
-
if (item[key]
|
|
240
|
+
if (this.__sameTableIdentity(item[key], cast(entity).id)) {
|
|
237
241
|
if (!withKey) delete item[key];
|
|
238
242
|
entity[relationName].push(item);
|
|
239
243
|
}
|
|
@@ -258,7 +262,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
258
262
|
if (optionsReal.groups) {
|
|
259
263
|
for (const entity of entities) {
|
|
260
264
|
const idsTo = itemsMiddle
|
|
261
|
-
.filter(item => item[keyFrom]
|
|
265
|
+
.filter(item => this.__sameTableIdentity(item[keyFrom], cast(entity).id))
|
|
262
266
|
.map(item => item[keyTo]);
|
|
263
267
|
const options2 = deepExtend({}, optionsReal, {
|
|
264
268
|
groups: optionsReal.groups,
|
|
@@ -269,7 +273,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
269
273
|
} else if (optionsReal.aggrs) {
|
|
270
274
|
for (const entity of entities) {
|
|
271
275
|
const idsTo = itemsMiddle
|
|
272
|
-
.filter(item => item[keyFrom]
|
|
276
|
+
.filter(item => this.__sameTableIdentity(item[keyFrom], cast(entity).id))
|
|
273
277
|
.map(item => item[keyTo]);
|
|
274
278
|
const options2 = deepExtend({}, optionsReal, { where: { id: idsTo } });
|
|
275
279
|
entity[relationName] = await modelTarget.aggregate(options2, methodOptionsReal);
|
|
@@ -281,9 +285,11 @@ export class ServiceRelations extends BeanBase {
|
|
|
281
285
|
for (const entity of entities) {
|
|
282
286
|
entity[relationName] = [];
|
|
283
287
|
for (const itemMiddle of itemsMiddle) {
|
|
284
|
-
if (itemMiddle[keyFrom]
|
|
288
|
+
if (this.__sameTableIdentity(itemMiddle[keyFrom], cast(entity).id)) {
|
|
285
289
|
entity[relationName].push(
|
|
286
|
-
items.find(item =>
|
|
290
|
+
items.find(item =>
|
|
291
|
+
this.__sameTableIdentity(cast(item).id, cast(itemMiddle)[keyTo]),
|
|
292
|
+
),
|
|
287
293
|
);
|
|
288
294
|
}
|
|
289
295
|
}
|
|
@@ -299,6 +305,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
299
305
|
methodOptions?: IModelMethodOptions,
|
|
300
306
|
) {
|
|
301
307
|
const [relationName, relationReal, includeReal, withReal] = relation;
|
|
308
|
+
if (relationReal === false) return entitiesResult;
|
|
302
309
|
const { type, modelMiddle, model, keyFrom, keyTo, key, options } = relationReal;
|
|
303
310
|
const modelTarget = this.__getModelTarget(model, options?.meta) as BeanModelCache;
|
|
304
311
|
const methodOptionsReal = Object.assign({}, methodOptions, {
|
|
@@ -348,19 +355,21 @@ export class ServiceRelations extends BeanBase {
|
|
|
348
355
|
if (entity[relationName] && entity[relationName].length > 0) {
|
|
349
356
|
const entityId = cast(entity).id;
|
|
350
357
|
const idsTo = entity[relationName].map(item => item.id).filter(id => !isNil(id));
|
|
351
|
-
let
|
|
358
|
+
let idsTargetSet: Set<string>;
|
|
352
359
|
if (idsTo.length === 0) {
|
|
353
|
-
|
|
360
|
+
idsTargetSet = new Set();
|
|
354
361
|
} else {
|
|
355
362
|
const itemsTarget = await cast(modelTarget).__select_raw(
|
|
356
363
|
undefined,
|
|
357
364
|
{ where: { [key]: entityId, id: idsTo } },
|
|
358
365
|
methodOptionsReal,
|
|
359
366
|
);
|
|
360
|
-
|
|
367
|
+
idsTargetSet = new Set(
|
|
368
|
+
itemsTarget.map((item: { id: TableIdentity }) => String(item.id)),
|
|
369
|
+
);
|
|
361
370
|
}
|
|
362
371
|
for (const child of entity[relationName]) {
|
|
363
|
-
if (!isNil(child.id) && !
|
|
372
|
+
if (!isNil(child.id) && !idsTargetSet.has(String(child.id))) {
|
|
364
373
|
throw new Error(`invalid id: ${child.id}`);
|
|
365
374
|
}
|
|
366
375
|
children.push(Object.assign({}, child, { [key]: entityId }));
|
|
@@ -375,7 +384,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
375
384
|
if (entity[relationName]) {
|
|
376
385
|
entityResult[relationName] = [];
|
|
377
386
|
for (const child of children) {
|
|
378
|
-
if (child[key]
|
|
387
|
+
if (this.__sameTableIdentity(child[key], cast(entity).id)) {
|
|
379
388
|
entityResult[relationName].push(child);
|
|
380
389
|
}
|
|
381
390
|
}
|
|
@@ -403,7 +412,9 @@ export class ServiceRelations extends BeanBase {
|
|
|
403
412
|
);
|
|
404
413
|
}
|
|
405
414
|
for (const child of entity[relationName]) {
|
|
406
|
-
const itemMiddle = itemsMiddle.find(item =>
|
|
415
|
+
const itemMiddle = itemsMiddle.find(item =>
|
|
416
|
+
this.__sameTableIdentity(item[keyTo], child.id),
|
|
417
|
+
);
|
|
407
418
|
if (!itemMiddle) {
|
|
408
419
|
if (!child.deleted) {
|
|
409
420
|
// add
|
|
@@ -426,7 +437,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
426
437
|
if (entity[relationName]) {
|
|
427
438
|
entityResult[relationName] = [];
|
|
428
439
|
for (const child of children) {
|
|
429
|
-
if (child[keyFrom]
|
|
440
|
+
if (this.__sameTableIdentity(child[keyFrom], cast(entity).id)) {
|
|
430
441
|
entityResult[relationName].push({ id: child[keyTo] });
|
|
431
442
|
}
|
|
432
443
|
}
|
|
@@ -444,6 +455,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
444
455
|
methodOptions?: IModelMethodOptions,
|
|
445
456
|
) {
|
|
446
457
|
const [_relationName, relationReal, includeReal, withReal] = relation;
|
|
458
|
+
if (relationReal === false) return;
|
|
447
459
|
const { type, modelMiddle, model, keyFrom, key, options } = relationReal;
|
|
448
460
|
const modelTarget = this.__getModelTarget(model, options?.meta) as BeanModelCache;
|
|
449
461
|
const methodOptionsReal = Object.assign({}, methodOptions, {
|
|
@@ -475,6 +487,14 @@ export class ServiceRelations extends BeanBase {
|
|
|
475
487
|
}
|
|
476
488
|
}
|
|
477
489
|
|
|
490
|
+
private __sameTableIdentity(
|
|
491
|
+
id1: TableIdentity | null | undefined,
|
|
492
|
+
id2: TableIdentity | null | undefined,
|
|
493
|
+
) {
|
|
494
|
+
if (isNil(id1) || isNil(id2)) return false;
|
|
495
|
+
return String(id1) === String(id2);
|
|
496
|
+
}
|
|
497
|
+
|
|
478
498
|
private __prepareColumnsAndKey(columns: string | string[] | undefined, key: string) {
|
|
479
499
|
if (!columns) return [columns, true];
|
|
480
500
|
columns = Array.isArray(columns) ? columns : [columns];
|
|
@@ -494,6 +514,7 @@ export class ServiceRelations extends BeanBase {
|
|
|
494
514
|
const refKeys: string[] = [];
|
|
495
515
|
for (const relation of relations) {
|
|
496
516
|
const [_relationName, relationReal] = relation;
|
|
517
|
+
if (relationReal === false) continue;
|
|
497
518
|
const { type, key } = relationReal;
|
|
498
519
|
if (type === 'belongsTo') {
|
|
499
520
|
if (!columns.includes(key)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-ormdialect",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.15",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
30
30
|
"prepublishOnly": "npm run tsc:publish",
|
|
31
31
|
"prepack": "clean-package",
|
|
32
|
-
"postpack": "clean-package restore
|
|
32
|
+
"postpack": "clean-package restore"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"better-sqlite3": "^12.9.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-ormutils",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
30
30
|
"prepublishOnly": "npm run tsc:publish",
|
|
31
31
|
"prepack": "clean-package",
|
|
32
|
-
"postpack": "clean-package restore
|
|
32
|
+
"postpack": "clean-package restore"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-permission",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.13",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
30
30
|
"prepublishOnly": "npm run tsc:publish",
|
|
31
31
|
"prepack": "clean-package",
|
|
32
|
-
"postpack": "clean-package restore
|
|
32
|
+
"postpack": "clean-package restore"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-play",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
30
30
|
"prepublishOnly": "npm run tsc:publish",
|
|
31
31
|
"prepack": "clean-package",
|
|
32
|
-
"postpack": "clean-package restore
|
|
32
|
+
"postpack": "clean-package restore"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"yargs-parser": "^22.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-printtip",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.12",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
31
|
"prepublishOnly": "npm run tsc:publish",
|
|
32
32
|
"prepack": "clean-package",
|
|
33
|
-
"postpack": "clean-package restore
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-queue",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.13",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
31
|
"prepublishOnly": "npm run tsc:publish",
|
|
32
32
|
"prepack": "clean-package",
|
|
33
|
-
"postpack": "clean-package restore
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"bullmq": "^5.74.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-redis",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.12",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
30
30
|
"prepublishOnly": "npm run tsc:publish",
|
|
31
31
|
"prepack": "clean-package",
|
|
32
|
-
"postpack": "clean-package restore
|
|
32
|
+
"postpack": "clean-package restore"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"ioredis": "^5.10.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-redlock",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
31
|
"prepublishOnly": "npm run tsc:publish",
|
|
32
32
|
"prepack": "clean-package",
|
|
33
|
-
"postpack": "clean-package restore
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@sesamecare-oss/redlock": "^1.4.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-runtime",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.12",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
31
|
"prepublishOnly": "npm run tsc:publish",
|
|
32
32
|
"prepack": "clean-package",
|
|
33
|
-
"postpack": "clean-package restore
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-schedule",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.12",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
31
|
"prepublishOnly": "npm run tsc:publish",
|
|
32
32
|
"prepack": "clean-package",
|
|
33
|
-
"postpack": "clean-package restore
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-security",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
30
30
|
"prepublishOnly": "npm run tsc:publish",
|
|
31
31
|
"prepack": "clean-package",
|
|
32
|
-
"postpack": "clean-package restore
|
|
32
|
+
"postpack": "clean-package restore"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@eggjs/ip": "^2.1.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-serialization",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
31
|
"prepublishOnly": "npm run tsc:publish",
|
|
32
32
|
"prepack": "clean-package",
|
|
33
|
-
"postpack": "clean-package restore
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-startup",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.13",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
31
|
"prepublishOnly": "npm run tsc:publish",
|
|
32
32
|
"prepack": "clean-package",
|
|
33
|
-
"postpack": "clean-package restore
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-static",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
31
|
"prepublishOnly": "npm run tsc:publish",
|
|
32
32
|
"prepack": "clean-package",
|
|
33
|
-
"postpack": "clean-package restore
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@cabloy/koa-static-cache": "^6.0.1",
|