cabloy 5.1.20 → 5.1.22
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/package.json +1 -1
- package/scripts/upgrade.ts +13 -5
- package/vona/pnpm-lock.yaml +72 -70
- package/vona/src/suite-vendor/a-auth/tsconfig.json +0 -3
- package/vona/src/suite-vendor/a-cabloy/tsconfig.json +0 -9
- package/vona/src/suite-vendor/a-captcha/tsconfig.json +0 -3
- package/vona/src/suite-vendor/a-vona/tsconfig.json +0 -3
- package/vona/src/suite/.gitkeep +0 -0
- package/vona/src/suite-vendor/.gitkeep +0 -0
- package/vona/src/suite-vendor/a-auth/modules/test-auth/package.json +0 -52
- package/vona/src/suite-vendor/a-auth/modules/test-auth/src/.metadata/index.ts +0 -74
- package/vona/src/suite-vendor/a-auth/modules/test-auth/src/.metadata/this.ts +0 -2
- package/vona/src/suite-vendor/a-auth/modules/test-auth/src/controller/passport.ts +0 -19
- package/vona/src/suite-vendor/a-auth/modules/test-auth/src/index.ts +0 -1
- package/vona/src/suite-vendor/a-auth/modules/test-auth/test/authOauth.test.ts +0 -55
- package/vona/src/suite-vendor/a-auth/modules/test-auth/test/authSimple.test.ts +0 -52
- package/vona/src/suite-vendor/a-auth/modules/test-auth/tsconfig.build.json +0 -11
- package/vona/src/suite-vendor/a-auth/modules/test-auth/tsconfig.json +0 -7
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/package.json +0 -60
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/src/.metadata/index.ts +0 -103
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/src/.metadata/this.ts +0 -2
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/src/bean/meta.status.ts +0 -15
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/src/controller/status.ts +0 -44
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/src/index.ts +0 -1
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/test/datasource.test.ts +0 -51
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/test/socket.test.ts +0 -48
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/test/status.test.ts +0 -10
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/tsconfig.build.json +0 -11
- package/vona/src/suite-vendor/a-cabloy/modules/test-cabloy/tsconfig.json +0 -7
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/package.json +0 -63
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/.metadata/index.ts +0 -377
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/.metadata/locales.ts +0 -18
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/.metadata/this.ts +0 -2
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/bean/meta.version.ts +0 -49
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/bean/ssrMenu.product.ts +0 -26
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/config/locale/en-us.ts +0 -15
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/config/locale/zh-cn.ts +0 -15
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/controller/product.tsx +0 -64
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/dto/productCreate.tsx +0 -40
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/dto/productSelectReq.tsx +0 -25
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/dto/productSelectRes.tsx +0 -11
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/dto/productSelectResItem.tsx +0 -39
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/dto/productUpdate.tsx +0 -30
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/dto/productView.tsx +0 -25
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/entity/product.tsx +0 -65
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/index.ts +0 -2
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/model/product.ts +0 -10
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/src/service/product.ts +0 -37
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/test/permission.test.ts +0 -19
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/test/product.test.ts +0 -65
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/tsconfig.build.json +0 -11
- package/vona/src/suite-vendor/a-cabloy/modules/test-rest/tsconfig.json +0 -7
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/package.json +0 -60
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/.metadata/index.ts +0 -161
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/.metadata/locales.ts +0 -18
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/.metadata/this.ts +0 -2
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/config/locale/en-us.ts +0 -13
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/config/locale/zh-cn.ts +0 -11
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/controller/toolOne.ts +0 -43
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/controller/toolTwo.ts +0 -37
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/dto/testBody.ts +0 -10
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/dto/testDetail.ts +0 -21
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/dto/testParams.ts +0 -13
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/dto/testQuery.ts +0 -12
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/dto/testResult.tsx +0 -159
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/index.ts +0 -2
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/tsconfig.build.json +0 -11
- package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/tsconfig.json +0 -7
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/package.json +0 -52
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/src/.metadata/index.ts +0 -99
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/src/.metadata/this.ts +0 -2
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/src/controller/captcha.ts +0 -18
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/src/dto/signin.ts +0 -20
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/src/index.ts +0 -1
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/test/captcha.test.ts +0 -148
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/tsconfig.build.json +0 -11
- package/vona/src/suite-vendor/a-captcha/modules/test-captcha/tsconfig.json +0 -7
- package/vona/src/suite-vendor/a-vona/modules/test-vona/assets/img/vona.png +0 -0
- package/vona/src/suite-vendor/a-vona/modules/test-vona/assets/static/img/vona.png +0 -0
- package/vona/src/suite-vendor/a-vona/modules/test-vona/assets/static/img/vona.svg +0 -3
- package/vona/src/suite-vendor/a-vona/modules/test-vona/package.json +0 -61
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/.metadata/index.ts +0 -2181
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/.metadata/locales.ts +0 -18
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/.metadata/this.ts +0 -2
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/aop.regExp.ts +0 -34
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/aop.simple.ts +0 -80
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/aopMethod.test.ts +0 -63
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/bean.testCtx.ts +0 -59
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/broadcast.test.ts +0 -24
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/cacheMem.test.ts +0 -7
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/cacheRedis.post.ts +0 -11
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/cacheRedis.test.ts +0 -7
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/event.helloEcho.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/eventListener.helloEcho.ts +0 -24
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/meta.asset.ts +0 -10
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/meta.static.ts +0 -7
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/meta.version.ts +0 -108
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/queue.test.ts +0 -25
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/schedule.test.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/schedule.test3.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/serializerTransform.email.ts +0 -35
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/summerCache.caching.ts +0 -36
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/bean/summerCache.test.ts +0 -36
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/config/config.ts +0 -5
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/config/locale/en-us.ts +0 -21
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/config/locale/zh-cn.ts +0 -19
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/bean.ts +0 -103
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/cacheMem.ts +0 -64
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/cacheRedis.ts +0 -56
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/dtoTest.ts +0 -61
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/guardPassport.ts +0 -26
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/onion.ts +0 -103
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/order.ts +0 -56
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/passport.ts +0 -49
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/performAction.ts +0 -19
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/post.ts +0 -59
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/queue.ts +0 -27
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/serializer.ts +0 -40
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/summer.ts +0 -130
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/tail.ts +0 -33
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/transaction.ts +0 -30
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/controller/upload.ts +0 -61
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/categoryTree.ts +0 -9
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/orderCreate.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/orderQuery.ts +0 -25
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/orderQueryPage.ts +0 -24
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/orderSelectRes.ts +0 -11
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/orderSelectResItem.ts +0 -11
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/orderUpdate.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/postAggregate.ts +0 -17
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/postCreate.ts +0 -11
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/postGroup.ts +0 -14
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/postSelectReq.ts +0 -36
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/postSelectRes.ts +0 -11
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/postSelectResItem.tsx +0 -28
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/profile.ts +0 -15
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/roleLazy.ts +0 -17
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/serializerArray.ts +0 -39
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/serializerLazy.ts +0 -31
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/serializerSimple.ts +0 -112
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/user.ts +0 -21
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/userCreate.ts +0 -11
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/userLazy.ts +0 -20
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/dto/userUpdate.ts +0 -9
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/category.ts +0 -16
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/order.ts +0 -21
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/post.ts +0 -21
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/postContent.ts +0 -16
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/product.ts +0 -27
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/role.ts +0 -12
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/roleUser.ts +0 -16
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/test.ts +0 -24
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/entity/user.ts +0 -18
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/index.ts +0 -4
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/lib/index.ts +0 -1
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/lib/serializer.ts +0 -9
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/category.ts +0 -22
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/categoryChain.ts +0 -23
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/order.ts +0 -33
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/orderStats.ts +0 -29
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/post.ts +0 -23
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/postContent.ts +0 -23
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/product.ts +0 -10
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/role.ts +0 -23
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/roleUser.ts +0 -10
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/test.ts +0 -10
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/testDynamicTable.ts +0 -23
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/user.ts +0 -30
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/userStats.ts +0 -22
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/model/userStatsGroup.ts +0 -36
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/aopMethod.ts +0 -38
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/caching.ts +0 -89
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/category.ts +0 -153
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/order.ts +0 -67
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/post.ts +0 -280
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/product.ts +0 -5
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/test.ts +0 -9
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/testApp.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/testClass.ts +0 -15
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/testData.ts +0 -71
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/transaction.ts +0 -20
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/service/user.ts +0 -124
- package/vona/src/suite-vendor/a-vona/modules/test-vona/src/types/index.ts +0 -6
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/aopMethod.test.ts +0 -21
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/bean.test.ts +0 -16
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/broadcast.test.ts +0 -17
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/cache/cacheMem.test.ts +0 -10
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/cache/cacheRedis.test.ts +0 -10
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/cache/caching.test.ts +0 -61
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/cache/summer.test.ts +0 -10
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/database.test.ts +0 -132
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/dtoAggregate.test.ts +0 -44
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/dtoGet.test.ts +0 -82
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/dtoGroup.test.ts +0 -44
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/dtoLazy.test.ts +0 -53
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/dtoMutate.test.ts +0 -56
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/dtoQuery.test.ts +0 -70
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelAggregate.test.ts +0 -222
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelCache.test.ts +0 -37
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelGeneral.test.ts +0 -18
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelGroup.test.ts +0 -248
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelMagic.test.ts +0 -37
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelRelations.test.ts +0 -215
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelRelationsJoins.test.ts +0 -58
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelRelationsMutate.test.ts +0 -436
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/modelWhere.test.ts +0 -173
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/orm.test.ts +0 -22
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/database/transaction.test.ts +0 -142
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/event.test.ts +0 -14
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/guardPassport.test.ts +0 -48
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/instance.test.ts +0 -35
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/jwt.test.ts +0 -28
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/locale.test.ts +0 -64
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/mail.test.ts +0 -14
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/passport.test.ts +0 -69
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/queue.test.ts +0 -11
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/runtime.test.ts +0 -24
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/serializer.test.ts +0 -82
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/static.test.ts +0 -22
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/tail.test.ts +0 -21
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/upload.test.ts +0 -75
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/utils/cabloyUtils.test.ts +0 -19
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/utils/celjs.test.ts +0 -64
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/utils/mappedTypes.test.ts +0 -73
- package/vona/src/suite-vendor/a-vona/modules/test-vona/test/utils/performAction.test.ts +0 -28
- package/vona/src/suite-vendor/a-vona/modules/test-vona/tsconfig.build.json +0 -11
- package/vona/src/suite-vendor/a-vona/modules/test-vona/tsconfig.json +0 -7
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { IDecoratorModelOptions } from 'vona-module-a-orm';
|
|
2
|
-
|
|
3
|
-
import { $relation, BeanModelBase, Model } from 'vona-module-a-orm';
|
|
4
|
-
|
|
5
|
-
import { EntityUser } from '../entity/user.ts';
|
|
6
|
-
import { ModelPost } from './post.ts';
|
|
7
|
-
|
|
8
|
-
export interface IModelOptionsUserStats extends IDecoratorModelOptions<EntityUser> {}
|
|
9
|
-
|
|
10
|
-
@Model<IModelOptionsUserStats>({
|
|
11
|
-
entity: EntityUser,
|
|
12
|
-
relations: {
|
|
13
|
-
posts: $relation.hasMany(() => ModelPost, 'userId', {
|
|
14
|
-
autoload: true,
|
|
15
|
-
aggrs: { count: ['*', 'title'], sum: 'stars' },
|
|
16
|
-
}),
|
|
17
|
-
roles: $relation.belongsToMany('test-vona:roleUser', 'test-vona:role', 'userId', 'roleId', {
|
|
18
|
-
aggrs: { count: '*' },
|
|
19
|
-
}),
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
export class ModelUserStats extends BeanModelBase<EntityUser> {}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { IDecoratorModelOptions } from 'vona-module-a-orm';
|
|
2
|
-
|
|
3
|
-
import { $relation, BeanModelBase, Model } from 'vona-module-a-orm';
|
|
4
|
-
|
|
5
|
-
import { EntityUser } from '../entity/user.ts';
|
|
6
|
-
import { ModelPost } from './post.ts';
|
|
7
|
-
|
|
8
|
-
export interface IModelOptionsUserStatsGroup extends IDecoratorModelOptions<EntityUser> {}
|
|
9
|
-
|
|
10
|
-
@Model<IModelOptionsUserStatsGroup>({
|
|
11
|
-
entity: EntityUser,
|
|
12
|
-
relations: {
|
|
13
|
-
posts: $relation.hasMany(
|
|
14
|
-
() => ModelPost,
|
|
15
|
-
'userId',
|
|
16
|
-
{
|
|
17
|
-
autoload: true,
|
|
18
|
-
groups: ['title'],
|
|
19
|
-
aggrs: { count: ['*', 'title'], sum: 'stars' },
|
|
20
|
-
orders: [['title', 'desc']],
|
|
21
|
-
},
|
|
22
|
-
undefined,
|
|
23
|
-
true,
|
|
24
|
-
),
|
|
25
|
-
roles: $relation.belongsToMany(
|
|
26
|
-
'test-vona:roleUser',
|
|
27
|
-
'test-vona:role',
|
|
28
|
-
'userId',
|
|
29
|
-
'roleId',
|
|
30
|
-
{ groups: ['name'], aggrs: { count: '*' }, orders: [['name', 'asc']] },
|
|
31
|
-
undefined,
|
|
32
|
-
true,
|
|
33
|
-
),
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
export class ModelUserStatsGroup extends BeanModelBase<EntityUser> {}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { BeanBase } from 'vona';
|
|
2
|
-
import { Aspect } from 'vona-module-a-aspect';
|
|
3
|
-
import { Service } from 'vona-module-a-bean';
|
|
4
|
-
|
|
5
|
-
class ServiceAopMethodBase extends BeanBase {
|
|
6
|
-
@Aspect.aopMethod('test-vona:test', { wrapper: '+' })
|
|
7
|
-
@Aspect.aopMethod('test-vona:test', { wrapper: '-' })
|
|
8
|
-
testSyncBase() {
|
|
9
|
-
return 'hello';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@Service()
|
|
14
|
-
export class ServiceAopMethod extends ServiceAopMethodBase {
|
|
15
|
-
private _name: string = '';
|
|
16
|
-
|
|
17
|
-
@Aspect.aopMethod('test-vona:test', { wrapper: '+' })
|
|
18
|
-
@Aspect.aopMethod('test-vona:test', { wrapper: '-' })
|
|
19
|
-
testSync() {
|
|
20
|
-
return 'hello';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@Aspect.aopMethod('test-vona:test', { wrapper: '+' })
|
|
24
|
-
@Aspect.aopMethod('test-vona:test', { wrapper: '-' })
|
|
25
|
-
async testAsync() {
|
|
26
|
-
return 'hello';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@Aspect.aopMethod('test-vona:test', { wrapper: '+' })
|
|
30
|
-
@Aspect.aopMethod('test-vona:test', { wrapper: '-' })
|
|
31
|
-
get name() {
|
|
32
|
-
return this._name;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
set name(value) {
|
|
36
|
-
this._name = value;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ICachingActionKeyInfo,
|
|
3
|
-
ICachingActionValueInfo,
|
|
4
|
-
TypeCachingActionOptions,
|
|
5
|
-
} from 'vona-module-a-caching';
|
|
6
|
-
|
|
7
|
-
import { cel } from '@cabloy/utils';
|
|
8
|
-
import { BeanBase } from 'vona';
|
|
9
|
-
import { Service } from 'vona-module-a-bean';
|
|
10
|
-
import { Caching } from 'vona-module-a-caching';
|
|
11
|
-
|
|
12
|
-
import type { TSummerCacheTestData } from '../bean/summerCache.test.ts';
|
|
13
|
-
|
|
14
|
-
function cacheKeyFn(
|
|
15
|
-
this: ServiceCaching,
|
|
16
|
-
info: ICachingActionKeyInfo,
|
|
17
|
-
_options: TypeCachingActionOptions,
|
|
18
|
-
): any {
|
|
19
|
-
return info.args[0];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@Service()
|
|
23
|
-
export class ServiceCaching extends BeanBase {
|
|
24
|
-
cacheKey(info: ICachingActionKeyInfo, _options: TypeCachingActionOptions) {
|
|
25
|
-
return info.args[0];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
cacheValue(info: ICachingActionValueInfo, _options: TypeCachingActionOptions) {
|
|
29
|
-
return info.args[1];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Caching.get({ cacheName: 'test-vona:caching', cacheKeyFn: 'cacheKey' })
|
|
33
|
-
async get(id: number): Promise<TSummerCacheTestData> {
|
|
34
|
-
return {
|
|
35
|
-
id,
|
|
36
|
-
name: `name_${id}`,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@Caching.get({ cacheName: 'test-vona:caching', cacheKeyFn })
|
|
41
|
-
async get2(_id: number): Promise<TSummerCacheTestData> {
|
|
42
|
-
return undefined as any;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@Caching.get({ cacheName: 'test-vona:caching', cacheKey: cel('args[0]') })
|
|
46
|
-
async get3(_id: number): Promise<TSummerCacheTestData> {
|
|
47
|
-
return undefined as any;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// default cacheKey
|
|
51
|
-
@Caching.get({ cacheName: 'test-vona:caching' })
|
|
52
|
-
async get4(_id: number): Promise<TSummerCacheTestData> {
|
|
53
|
-
return undefined as any;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@Caching.set({
|
|
57
|
-
cacheName: 'test-vona:caching',
|
|
58
|
-
cacheKeyFn: 'cacheKey',
|
|
59
|
-
cacheValueFn: 'cacheValue',
|
|
60
|
-
})
|
|
61
|
-
async set(_id: number, _value: TSummerCacheTestData): Promise<void> {
|
|
62
|
-
// do nothing
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
//
|
|
66
|
-
@Caching.set({
|
|
67
|
-
cacheName: 'test-vona:caching',
|
|
68
|
-
cacheKey: cel('args[0]'),
|
|
69
|
-
cacheValue: cel('{"id": args[1].id, "name": args[1].name}'),
|
|
70
|
-
})
|
|
71
|
-
async set2(_id: number, _value: TSummerCacheTestData): Promise<void> {
|
|
72
|
-
// do nothing
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@Caching.set({ cacheName: 'test-vona:caching', cacheKeyFn: 'cacheKey' })
|
|
76
|
-
async set3(_id: number, value: TSummerCacheTestData): Promise<TSummerCacheTestData> {
|
|
77
|
-
return value;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@Caching.del({ cacheName: 'test-vona:caching' })
|
|
81
|
-
async del(_id: number): Promise<void> {
|
|
82
|
-
// do nothing
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@Caching.clear({ cacheName: 'test-vona:caching' })
|
|
86
|
-
async clear(): Promise<void> {
|
|
87
|
-
// do nothing
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
|
-
import { BeanBase } from 'vona';
|
|
3
|
-
import { Service } from 'vona-module-a-bean';
|
|
4
|
-
import { $relationDynamic } from 'vona-module-a-orm';
|
|
5
|
-
|
|
6
|
-
import { ModelCategory } from '../model/category.ts';
|
|
7
|
-
|
|
8
|
-
@Service()
|
|
9
|
-
export class ServiceCategory extends BeanBase {
|
|
10
|
-
async categoryTreeDynamic() {
|
|
11
|
-
// create
|
|
12
|
-
const treeCreate = await this.scope.model.category.insert(
|
|
13
|
-
{
|
|
14
|
-
name: 'Category-1',
|
|
15
|
-
children2: [
|
|
16
|
-
{
|
|
17
|
-
name: 'Category-1-1',
|
|
18
|
-
children2: [{ name: 'Category-1-1-1' }],
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'Category-1-2',
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
with: {
|
|
27
|
-
children2: $relationDynamic.hasMany(() => ModelCategory, 'categoryIdParent', {
|
|
28
|
-
with: {
|
|
29
|
-
children2: $relationDynamic.hasMany(() => ModelCategory, 'categoryIdParent', {}),
|
|
30
|
-
},
|
|
31
|
-
}),
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
);
|
|
35
|
-
// get
|
|
36
|
-
const tree = await this.scope.model.category.get(
|
|
37
|
-
{
|
|
38
|
-
id: treeCreate.id,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
with: {
|
|
42
|
-
children2: $relationDynamic.hasMany(() => ModelCategory, 'categoryIdParent', {
|
|
43
|
-
columns: ['id', 'name'],
|
|
44
|
-
with: {
|
|
45
|
-
children2: $relationDynamic.hasMany(() => ModelCategory, 'categoryIdParent', {
|
|
46
|
-
columns: ['id', 'name'],
|
|
47
|
-
}),
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
);
|
|
53
|
-
assert.equal(tree?.children2.length, 2);
|
|
54
|
-
assert.equal(tree?.children2[0].children2.length, 1);
|
|
55
|
-
// update
|
|
56
|
-
await this.scope.model.category.update(
|
|
57
|
-
{
|
|
58
|
-
id: treeCreate.id,
|
|
59
|
-
name: 'Category-1-Update',
|
|
60
|
-
children2: [
|
|
61
|
-
// create
|
|
62
|
-
{ name: 'Category-1-3' },
|
|
63
|
-
// update
|
|
64
|
-
{ id: treeCreate.children2?.[0].id, name: 'Category-1-1-Update' },
|
|
65
|
-
// delete
|
|
66
|
-
{ id: treeCreate.children2?.[1].id, deleted: true },
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
with: {
|
|
71
|
-
children2: $relationDynamic.hasMany(() => ModelCategory, 'categoryIdParent'),
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
);
|
|
75
|
-
// delete
|
|
76
|
-
await this.scope.model.category.delete(
|
|
77
|
-
{
|
|
78
|
-
id: treeCreate.id,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
with: {
|
|
82
|
-
children2: $relationDynamic.hasMany(() => ModelCategory, 'categoryIdParent', {
|
|
83
|
-
with: {
|
|
84
|
-
children2: $relationDynamic.hasMany(() => ModelCategory, 'categoryIdParent', {}),
|
|
85
|
-
},
|
|
86
|
-
}),
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async categoryTreeReverse() {
|
|
93
|
-
// create
|
|
94
|
-
const treeCreate = await this.scope.model.category.insert({
|
|
95
|
-
name: 'Category-1',
|
|
96
|
-
children: [
|
|
97
|
-
{
|
|
98
|
-
name: 'Category-1-1',
|
|
99
|
-
children: [{ name: 'Category-1-1-1' }],
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: 'Category-1-2',
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
});
|
|
106
|
-
// 'Category-1-1-1'
|
|
107
|
-
const subCategoryId = treeCreate.children?.[0].children?.[0].id;
|
|
108
|
-
// get: reverse
|
|
109
|
-
const subCategory = await this.scope.model.categoryChain.get({
|
|
110
|
-
id: subCategoryId,
|
|
111
|
-
});
|
|
112
|
-
assert.equal(subCategory?.parent?.parent?.id, treeCreate.id);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
async categoryTree() {
|
|
116
|
-
// create
|
|
117
|
-
const treeCreate = await this.scope.model.category.insert({
|
|
118
|
-
name: 'Category-1',
|
|
119
|
-
children: [
|
|
120
|
-
{
|
|
121
|
-
name: 'Category-1-1',
|
|
122
|
-
children: [{ name: 'Category-1-1-1' }],
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: 'Category-1-2',
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
});
|
|
129
|
-
// get
|
|
130
|
-
const tree = await this.scope.model.category.get({
|
|
131
|
-
id: treeCreate.id,
|
|
132
|
-
});
|
|
133
|
-
assert.equal(tree?.children.length, 2);
|
|
134
|
-
assert.equal(tree?.children[0].children.length, 1);
|
|
135
|
-
// update
|
|
136
|
-
await this.scope.model.category.update({
|
|
137
|
-
id: treeCreate.id,
|
|
138
|
-
name: 'Category-1-Update',
|
|
139
|
-
children: [
|
|
140
|
-
// create
|
|
141
|
-
{ name: 'Category-1-3' },
|
|
142
|
-
// update
|
|
143
|
-
{ id: treeCreate.children?.[0].id, name: 'Category-1-1-Update' },
|
|
144
|
-
// delete
|
|
145
|
-
{ id: treeCreate.children?.[1].id, deleted: true },
|
|
146
|
-
],
|
|
147
|
-
});
|
|
148
|
-
// delete
|
|
149
|
-
await this.scope.model.category.delete({
|
|
150
|
-
id: treeCreate.id,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { BeanBase } from 'vona';
|
|
2
|
-
import { Service } from 'vona-module-a-bean';
|
|
3
|
-
import { $relationDynamic } from 'vona-module-a-orm';
|
|
4
|
-
|
|
5
|
-
import { ModelProduct } from '../model/product.ts';
|
|
6
|
-
|
|
7
|
-
@Service()
|
|
8
|
-
export class ServiceOrder extends BeanBase {
|
|
9
|
-
async relationHasMany() {
|
|
10
|
-
// insert
|
|
11
|
-
const orderCreate = await this.scope.model.order.insert(
|
|
12
|
-
{
|
|
13
|
-
orderNo: 'Order001',
|
|
14
|
-
products2: [{ name: 'Apple' }, { name: 'Pear' }],
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
with: {
|
|
18
|
-
products2: $relationDynamic.hasMany(() => ModelProduct, 'orderId'),
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
);
|
|
22
|
-
// get
|
|
23
|
-
await this.scope.model.order.get(
|
|
24
|
-
{
|
|
25
|
-
id: orderCreate.id,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
with: {
|
|
29
|
-
products2: $relationDynamic.hasMany(() => ModelProduct, 'orderId', {
|
|
30
|
-
columns: ['id', 'name', 'price', 'quantity', 'amount'],
|
|
31
|
-
}),
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
);
|
|
35
|
-
// update
|
|
36
|
-
await this.scope.model.order.update(
|
|
37
|
-
{
|
|
38
|
-
id: orderCreate.id,
|
|
39
|
-
orderNo: 'Order001-Update',
|
|
40
|
-
products2: [
|
|
41
|
-
// create product: Peach
|
|
42
|
-
{ name: 'Peach' },
|
|
43
|
-
// update product: Apple
|
|
44
|
-
{ id: orderCreate.products?.[0].id, name: 'Apple-Update' },
|
|
45
|
-
// delete product: Pear
|
|
46
|
-
{ id: orderCreate.products?.[1].id, deleted: true },
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
with: {
|
|
51
|
-
products2: $relationDynamic.hasMany(() => ModelProduct, 'orderId'),
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
);
|
|
55
|
-
// delete
|
|
56
|
-
await this.scope.model.order.delete(
|
|
57
|
-
{
|
|
58
|
-
id: orderCreate.id,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
with: {
|
|
62
|
-
products2: $relationDynamic.hasMany(() => ModelProduct, 'orderId'),
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import type { TableIdentity } from 'table-identity';
|
|
2
|
-
import type { IQueryParams } from 'vona-module-a-orm';
|
|
3
|
-
|
|
4
|
-
import { BeanBase } from 'vona';
|
|
5
|
-
import { Service } from 'vona-module-a-bean';
|
|
6
|
-
import { Core } from 'vona-module-a-core';
|
|
7
|
-
import { $relationDynamic } from 'vona-module-a-orm';
|
|
8
|
-
|
|
9
|
-
import { ModelPost } from '../model/post.ts';
|
|
10
|
-
import { ModelPostContent } from '../model/postContent.ts';
|
|
11
|
-
|
|
12
|
-
@Service()
|
|
13
|
-
export class ServicePost extends BeanBase {
|
|
14
|
-
async findMany(params?: IQueryParams<ModelPost>) {
|
|
15
|
-
return await this.scope.model.post.selectAndCount({
|
|
16
|
-
...params,
|
|
17
|
-
include: { postContent: true },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async group() {
|
|
22
|
-
const result = await this.scope.model.post.group({
|
|
23
|
-
groups: 'userId',
|
|
24
|
-
aggrs: {
|
|
25
|
-
count: '*',
|
|
26
|
-
sum: 'stars',
|
|
27
|
-
},
|
|
28
|
-
orders: [['count_all', 'desc']],
|
|
29
|
-
});
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async aggregate() {
|
|
34
|
-
const result = await this.scope.model.post.aggregate({
|
|
35
|
-
aggrs: {
|
|
36
|
-
count: ['*', 'stars'],
|
|
37
|
-
sum: 'stars',
|
|
38
|
-
avg: 'stars',
|
|
39
|
-
min: 'stars',
|
|
40
|
-
max: 'stars',
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async count() {
|
|
47
|
-
return await this.scope.model.post.count();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async relationBelongsTo() {
|
|
51
|
-
const postContent = await this.scope.model.postContent.select({
|
|
52
|
-
with: {
|
|
53
|
-
post: $relationDynamic.belongsTo(
|
|
54
|
-
() => ModelPostContent,
|
|
55
|
-
() => ModelPost,
|
|
56
|
-
'postId',
|
|
57
|
-
{
|
|
58
|
-
columns: ['id', 'title'],
|
|
59
|
-
},
|
|
60
|
-
),
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
// eslint-disable-next-line no-console
|
|
64
|
-
console.log(postContent[0]?.post?.title);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async relationHasOne() {
|
|
68
|
-
// insert
|
|
69
|
-
const postCreate = await this.scope.model.post.insert(
|
|
70
|
-
{
|
|
71
|
-
title: 'Post001',
|
|
72
|
-
postContent: {
|
|
73
|
-
content: 'This is a post',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
with: {
|
|
78
|
-
postContent: $relationDynamic.hasOne(() => ModelPostContent, 'postId', {
|
|
79
|
-
columns: ['id', 'content'],
|
|
80
|
-
}),
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
);
|
|
84
|
-
// get
|
|
85
|
-
const post = await this.scope.model.post.get(
|
|
86
|
-
{
|
|
87
|
-
id: postCreate.id,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
with: {
|
|
91
|
-
postContent: $relationDynamic.hasOne(() => ModelPostContent, 'postId', {
|
|
92
|
-
columns: ['id', 'content'],
|
|
93
|
-
}),
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
);
|
|
97
|
-
// update
|
|
98
|
-
await this.scope.model.post.update(
|
|
99
|
-
{
|
|
100
|
-
id: postCreate.id,
|
|
101
|
-
title: 'Post001-Update',
|
|
102
|
-
postContent: {
|
|
103
|
-
content: 'This is a post-changed',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
with: {
|
|
108
|
-
postContent: $relationDynamic.hasOne(() => ModelPostContent, 'postId', {
|
|
109
|
-
columns: ['id', 'content'],
|
|
110
|
-
}),
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
);
|
|
114
|
-
// delete
|
|
115
|
-
await this.scope.model.post.delete(
|
|
116
|
-
{
|
|
117
|
-
id: postCreate.id,
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
with: {
|
|
121
|
-
postContent: $relationDynamic.hasOne(() => ModelPostContent, 'postId'),
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
);
|
|
125
|
-
// eslint-disable-next-line no-console
|
|
126
|
-
console.log(post?.postContent?.id);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@Core.transaction()
|
|
130
|
-
async transaction() {
|
|
131
|
-
// insert
|
|
132
|
-
const post = await this.scope.model.post.insert({
|
|
133
|
-
title: 'Post001',
|
|
134
|
-
});
|
|
135
|
-
// cache
|
|
136
|
-
await this.scope.cacheRedis.post.set(post, post.id);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
async transactionManually() {
|
|
140
|
-
const db = this.bean.database.getDb({ clientName: 'default' });
|
|
141
|
-
await db.transaction.begin(async () => {
|
|
142
|
-
const modelPost = this.scope.model.post.newInstance(db);
|
|
143
|
-
const post = await modelPost.insert({ title: 'Post001' });
|
|
144
|
-
await this.scope.cacheRedis.post.set(post, post.id, { db });
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
async create() {
|
|
149
|
-
const post = await this.scope.model.post.insert({
|
|
150
|
-
title: 'Post001',
|
|
151
|
-
});
|
|
152
|
-
// console.log(post.id);
|
|
153
|
-
return post;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
async createBulk() {
|
|
157
|
-
const posts = await this.scope.model.post.insertBulk([
|
|
158
|
-
{ title: 'Post001' },
|
|
159
|
-
{ title: 'Post002' },
|
|
160
|
-
]);
|
|
161
|
-
// console.log(posts[0].id, posts[1].id);
|
|
162
|
-
return posts;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
async update() {
|
|
166
|
-
const post = await this.scope.model.post.update({
|
|
167
|
-
id: 1,
|
|
168
|
-
title: 'Post001-Update',
|
|
169
|
-
});
|
|
170
|
-
return post;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
async update2() {
|
|
174
|
-
const post = await this.scope.model.post.update(
|
|
175
|
-
{
|
|
176
|
-
title: 'Post001-Update',
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
where: {
|
|
180
|
-
title: { _startsWith_: 'Post001' },
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
);
|
|
184
|
-
return post;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
async updateBulk() {
|
|
188
|
-
const posts = await this.scope.model.post.updateBulk([
|
|
189
|
-
{ id: 1, title: 'Post001-Update' },
|
|
190
|
-
{ id: 2, title: 'Post002-Update' },
|
|
191
|
-
]);
|
|
192
|
-
return posts;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
async delete() {
|
|
196
|
-
await this.scope.model.post.delete({
|
|
197
|
-
id: 1,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
async delete2() {
|
|
202
|
-
await this.scope.model.post.delete({
|
|
203
|
-
title: {
|
|
204
|
-
_startsWith_: 'Post',
|
|
205
|
-
},
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
async deleteBulk() {
|
|
210
|
-
await this.scope.model.post.deleteBulk([1, 2]);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
async mutate() {
|
|
214
|
-
// insert
|
|
215
|
-
const post = await this.scope.model.post.mutate({
|
|
216
|
-
title: 'Post001',
|
|
217
|
-
});
|
|
218
|
-
// update
|
|
219
|
-
await this.scope.model.post.mutate({
|
|
220
|
-
id: post.id,
|
|
221
|
-
title: 'Post001-Update',
|
|
222
|
-
});
|
|
223
|
-
// delete
|
|
224
|
-
await this.scope.model.post.mutate({
|
|
225
|
-
id: post.id,
|
|
226
|
-
deleted: true,
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
async mutateBulk() {
|
|
231
|
-
await this.scope.model.post.mutateBulk([
|
|
232
|
-
// insert
|
|
233
|
-
{ title: 'Post003' },
|
|
234
|
-
// update
|
|
235
|
-
{ id: 1, title: 'Post001-Update' },
|
|
236
|
-
// delete
|
|
237
|
-
{ id: 2, deleted: true },
|
|
238
|
-
]);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
async select() {
|
|
242
|
-
return await this.scope.model.post.select({
|
|
243
|
-
where: {
|
|
244
|
-
stars: '_skip_',
|
|
245
|
-
},
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
async select2() {
|
|
250
|
-
return await this.scope.model.post.select(
|
|
251
|
-
{
|
|
252
|
-
columns: ['id', 'title', 'userId'],
|
|
253
|
-
where: {
|
|
254
|
-
'id': { _gt_: 1 },
|
|
255
|
-
'testVonaUser.id': 1,
|
|
256
|
-
},
|
|
257
|
-
joins: [['innerJoin', 'testVonaUser', ['userId', 'testVonaUser.id']]],
|
|
258
|
-
offset: 0,
|
|
259
|
-
limit: 20,
|
|
260
|
-
orders: [['createdAt', 'desc']],
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
disableDeleted: false,
|
|
264
|
-
},
|
|
265
|
-
'test-vona:user',
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
async get(id: TableIdentity) {
|
|
270
|
-
return await this.scope.model.post.getById(id);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
async mget(ids: TableIdentity[]) {
|
|
274
|
-
return await this.scope.model.post.mget(ids);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
// async count() {
|
|
278
|
-
// return await this.scope.model.post.count();
|
|
279
|
-
// }
|
|
280
|
-
}
|