cabloy 5.1.20 → 5.1.21
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 -4
- package/vona/pnpm-lock.yaml +60 -58
- 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-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,142 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
|
-
import { describe, it } from 'node:test';
|
|
3
|
-
import { app } from 'vona-mock';
|
|
4
|
-
|
|
5
|
-
describe('transaction.test.ts', () => {
|
|
6
|
-
const tableNameFail = '__tempTransactionFail';
|
|
7
|
-
const tableNameSuccess = '__tempTransactionSuccess';
|
|
8
|
-
|
|
9
|
-
it('action:transaction:fail', async () => {
|
|
10
|
-
// transaction
|
|
11
|
-
await app.bean.executor.mockCtx(async () => {
|
|
12
|
-
// create table
|
|
13
|
-
await app.bean.model.createTable(tableNameFail, table => {
|
|
14
|
-
table.basicFields();
|
|
15
|
-
table.string('name');
|
|
16
|
-
});
|
|
17
|
-
// create a new item
|
|
18
|
-
const res = await app.bean.model.insert(tableNameFail as any, {
|
|
19
|
-
name: 'hello',
|
|
20
|
-
});
|
|
21
|
-
const id = res.id;
|
|
22
|
-
|
|
23
|
-
// try to change name
|
|
24
|
-
const itemNew = {
|
|
25
|
-
id,
|
|
26
|
-
name: 'hello!!',
|
|
27
|
-
};
|
|
28
|
-
try {
|
|
29
|
-
await app.bean.executor.performAction('post', '/test/vona/transaction/fail', {
|
|
30
|
-
body: itemNew,
|
|
31
|
-
});
|
|
32
|
-
} catch (_err) {}
|
|
33
|
-
|
|
34
|
-
// check name
|
|
35
|
-
const item = await app.bean.model.get(tableNameFail as any, {
|
|
36
|
-
id,
|
|
37
|
-
});
|
|
38
|
-
assert.notEqual(item.name, itemNew.name);
|
|
39
|
-
|
|
40
|
-
// drop table
|
|
41
|
-
await app.bean.model.dropTable(tableNameFail);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// aop method
|
|
45
|
-
const scopeTest = app.scope('test-vona');
|
|
46
|
-
await app.bean.executor.mockCtx(async () => {
|
|
47
|
-
// create table
|
|
48
|
-
await app.bean.model.createTable(tableNameFail, table => {
|
|
49
|
-
table.basicFields();
|
|
50
|
-
table.string('name');
|
|
51
|
-
});
|
|
52
|
-
// create a new item
|
|
53
|
-
const res = await app.bean.model.insert(tableNameFail as any, {
|
|
54
|
-
name: 'hello',
|
|
55
|
-
});
|
|
56
|
-
const id = res.id;
|
|
57
|
-
|
|
58
|
-
// try to change name
|
|
59
|
-
const itemNew = {
|
|
60
|
-
id,
|
|
61
|
-
name: 'hello!!',
|
|
62
|
-
};
|
|
63
|
-
try {
|
|
64
|
-
await scopeTest.service.transaction.fail(itemNew);
|
|
65
|
-
} catch (_err) {}
|
|
66
|
-
|
|
67
|
-
// check name
|
|
68
|
-
const item = await app.bean.model.get(tableNameFail as any, {
|
|
69
|
-
id,
|
|
70
|
-
});
|
|
71
|
-
assert.notEqual(item.name, itemNew.name);
|
|
72
|
-
|
|
73
|
-
// drop table
|
|
74
|
-
await app.bean.model.dropTable(tableNameFail);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('action:transaction:success', async () => {
|
|
79
|
-
// transaction
|
|
80
|
-
await app.bean.executor.mockCtx(async () => {
|
|
81
|
-
// create table
|
|
82
|
-
await app.bean.model.createTable(tableNameSuccess, table => {
|
|
83
|
-
table.basicFields();
|
|
84
|
-
table.string('name');
|
|
85
|
-
});
|
|
86
|
-
// create a new item
|
|
87
|
-
const res = await app.bean.model.insert(tableNameSuccess as any, {
|
|
88
|
-
name: 'hello',
|
|
89
|
-
});
|
|
90
|
-
const id = res.id;
|
|
91
|
-
|
|
92
|
-
// try to change name
|
|
93
|
-
const itemNew = {
|
|
94
|
-
id,
|
|
95
|
-
name: 'hello!!',
|
|
96
|
-
};
|
|
97
|
-
await app.bean.executor.performAction('post', '/test/vona/transaction/success', {
|
|
98
|
-
body: itemNew,
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// check name
|
|
102
|
-
const item = await app.bean.model.get(tableNameSuccess as any, {
|
|
103
|
-
id,
|
|
104
|
-
});
|
|
105
|
-
assert.equal(item.name, itemNew.name);
|
|
106
|
-
|
|
107
|
-
// drop table
|
|
108
|
-
await app.bean.model.dropTable(tableNameSuccess);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// aop method
|
|
112
|
-
const scopeTest = app.scope('test-vona');
|
|
113
|
-
await app.bean.executor.mockCtx(async () => {
|
|
114
|
-
// create table
|
|
115
|
-
await app.bean.model.createTable(tableNameSuccess, table => {
|
|
116
|
-
table.basicFields();
|
|
117
|
-
table.string('name');
|
|
118
|
-
});
|
|
119
|
-
// create a new item
|
|
120
|
-
const res = await app.bean.model.insert(tableNameSuccess as any, {
|
|
121
|
-
name: 'hello',
|
|
122
|
-
});
|
|
123
|
-
const id = res.id;
|
|
124
|
-
|
|
125
|
-
// try to change name
|
|
126
|
-
const itemNew = {
|
|
127
|
-
id,
|
|
128
|
-
name: 'hello!!',
|
|
129
|
-
};
|
|
130
|
-
await scopeTest.service.transaction.success(itemNew);
|
|
131
|
-
|
|
132
|
-
// check name
|
|
133
|
-
const item = await app.bean.model.get(tableNameSuccess as any, {
|
|
134
|
-
id,
|
|
135
|
-
});
|
|
136
|
-
assert.equal(item.name, itemNew.name);
|
|
137
|
-
|
|
138
|
-
// drop table
|
|
139
|
-
await app.bean.model.dropTable(tableNameSuccess);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
|
-
import { describe, it } from 'node:test';
|
|
3
|
-
import { app } from 'vona-mock';
|
|
4
|
-
|
|
5
|
-
describe('event.test.ts', () => {
|
|
6
|
-
it('action:event', async () => {
|
|
7
|
-
await app.bean.executor.mockCtx(async () => {
|
|
8
|
-
// scope
|
|
9
|
-
const scopeTest = app.scope('test-vona');
|
|
10
|
-
const result = await scopeTest.event.helloEcho.emit({ text: 'hello' }, 'world');
|
|
11
|
-
assert.equal(result, 'hello world');
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { catchError } from '@cabloy/utils';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import { describe, it } from 'node:test';
|
|
4
|
-
import { app } from 'vona-mock';
|
|
5
|
-
|
|
6
|
-
describe('guardPassport.test.ts', () => {
|
|
7
|
-
it('action:guardPassport:userName', async () => {
|
|
8
|
-
await app.bean.executor.mockCtx(async () => {
|
|
9
|
-
await app.bean.passport.signinMock();
|
|
10
|
-
const res = await app.bean.executor.performAction(
|
|
11
|
-
'get',
|
|
12
|
-
'/test/vona/guardPassport/testUserName',
|
|
13
|
-
{
|
|
14
|
-
innerAccess: false,
|
|
15
|
-
},
|
|
16
|
-
);
|
|
17
|
-
assert.equal(res, undefined);
|
|
18
|
-
const [_, err] = await catchError(() => {
|
|
19
|
-
return app.bean.executor.performAction('get', '/test/vona/guardPassport/testUserNameFail', {
|
|
20
|
-
innerAccess: false,
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
assert.equal(err?.code, 403);
|
|
24
|
-
await app.bean.passport.signout();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('action:guardPassport:roleName', async () => {
|
|
29
|
-
await app.bean.executor.mockCtx(async () => {
|
|
30
|
-
await app.bean.passport.signinMock();
|
|
31
|
-
const res = await app.bean.executor.performAction(
|
|
32
|
-
'get',
|
|
33
|
-
'/test/vona/guardPassport/testRoleName',
|
|
34
|
-
{
|
|
35
|
-
innerAccess: false,
|
|
36
|
-
},
|
|
37
|
-
);
|
|
38
|
-
assert.equal(res, undefined);
|
|
39
|
-
const [_, err] = await catchError(() => {
|
|
40
|
-
return app.bean.executor.performAction('get', '/test/vona/guardPassport/testRoleNameFail', {
|
|
41
|
-
innerAccess: false,
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
assert.equal(err?.code, 403);
|
|
45
|
-
await app.bean.passport.signout();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
|
-
import { describe, it } from 'node:test';
|
|
3
|
-
import { app } from 'vona-mock';
|
|
4
|
-
|
|
5
|
-
describe('instance.test.ts', () => {
|
|
6
|
-
it('action:instance:shareTest', async () => {
|
|
7
|
-
await app.bean.executor.mockCtx(
|
|
8
|
-
async () => {
|
|
9
|
-
const scopeDatabase = app.scope('a-orm');
|
|
10
|
-
const defaultClientName = scopeDatabase.service.database.getDefaultClientName();
|
|
11
|
-
assert.equal(app.ctx.instanceName, 'shareTest');
|
|
12
|
-
assert.equal(app.ctx.instance.name, 'shareTest');
|
|
13
|
-
assert.equal(app.bean.database.current.clientName, defaultClientName);
|
|
14
|
-
assert.equal(
|
|
15
|
-
['sqlite3', 'pg', 'mysql'].includes(app.bean.database.current.clientName),
|
|
16
|
-
true,
|
|
17
|
-
);
|
|
18
|
-
},
|
|
19
|
-
{ instanceName: 'shareTest' as any },
|
|
20
|
-
);
|
|
21
|
-
});
|
|
22
|
-
it('action:instance:isolateTest', async () => {
|
|
23
|
-
await app.bean.executor.mockCtx(
|
|
24
|
-
async () => {
|
|
25
|
-
const scopeDatabase = app.scope('a-orm');
|
|
26
|
-
const defaultClientName = scopeDatabase.service.database.getDefaultClientName();
|
|
27
|
-
assert.equal(app.ctx.instanceName, 'isolateTest');
|
|
28
|
-
assert.equal(app.ctx.instance.name, 'isolateTest');
|
|
29
|
-
assert.equal(app.bean.database.current.clientName, defaultClientName);
|
|
30
|
-
assert.equal(app.bean.database.current.clientName, 'isolateTest');
|
|
31
|
-
},
|
|
32
|
-
{ instanceName: 'isolateTest' as any },
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { IPayloadData } from 'vona-module-a-jwt';
|
|
2
|
-
|
|
3
|
-
import { catchError } from '@cabloy/utils';
|
|
4
|
-
import assert from 'node:assert';
|
|
5
|
-
import { describe, it } from 'node:test';
|
|
6
|
-
import { app } from 'vona-mock';
|
|
7
|
-
|
|
8
|
-
describe('jwt.test.ts', () => {
|
|
9
|
-
it('action:jwt', async () => {
|
|
10
|
-
await app.bean.executor.mockCtx(async () => {
|
|
11
|
-
// sign
|
|
12
|
-
const payloadData: IPayloadData = { userId: 1, authId: 1 };
|
|
13
|
-
const token = await app.bean.jwt.get('access').sign(payloadData);
|
|
14
|
-
assert.equal(token.split('.').length, 3);
|
|
15
|
-
// verify
|
|
16
|
-
const [payloadDataVerified1] = await catchError(async () => {
|
|
17
|
-
return await app.bean.jwt.get('refresh').verify(token);
|
|
18
|
-
});
|
|
19
|
-
assert.equal(payloadDataVerified1, undefined);
|
|
20
|
-
// verify
|
|
21
|
-
const payloadDataVerified2 = await app.bean.jwt.get('access').verify(token);
|
|
22
|
-
assert.deepEqual(payloadData, payloadDataVerified2);
|
|
23
|
-
// create jwt token
|
|
24
|
-
const jwtToken = await app.bean.jwt.create(payloadData);
|
|
25
|
-
assert.equal(!!jwtToken.accessToken, true);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
|
-
import { describe, it } from 'node:test';
|
|
3
|
-
import { app, mockModuleInfo } from 'vona-mock';
|
|
4
|
-
|
|
5
|
-
import { __ThisModule__ } from '../src/.metadata/this.ts';
|
|
6
|
-
|
|
7
|
-
describe('locale.test.ts', () => {
|
|
8
|
-
it('action:locale', async () => {
|
|
9
|
-
const moduleInfo = mockModuleInfo();
|
|
10
|
-
assert.equal(moduleInfo.relativeName, __ThisModule__);
|
|
11
|
-
await app.bean.executor.mockCtx(
|
|
12
|
-
async () => {
|
|
13
|
-
const ctx = app.ctx;
|
|
14
|
-
// ctx.locale
|
|
15
|
-
assert.equal(ctx.locale, 'zh-cn');
|
|
16
|
-
// getText
|
|
17
|
-
assert.equal(
|
|
18
|
-
app.meta.locale.getText(false, moduleInfo.relativeName, ctx.locale, 'TestHelloWorld'),
|
|
19
|
-
'您好,世界',
|
|
20
|
-
);
|
|
21
|
-
assert.equal(
|
|
22
|
-
app.meta.locale.getText(false, undefined, ctx.locale, 'test-vona::TestHelloWorld'),
|
|
23
|
-
'您好,世界',
|
|
24
|
-
);
|
|
25
|
-
// scope locale
|
|
26
|
-
const scopeTest = app.scope('test-vona');
|
|
27
|
-
assert.equal(scopeTest.locale.TestHelloWorld(), '您好,世界');
|
|
28
|
-
},
|
|
29
|
-
{ locale: 'zh-cn' },
|
|
30
|
-
);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('action:locale:plurals', async () => {
|
|
34
|
-
await app.bean.executor.mockCtx(async () => {
|
|
35
|
-
// scope
|
|
36
|
-
const scopeTest = app.scope('test-vona');
|
|
37
|
-
// english
|
|
38
|
-
assert.equal(scopeTest.locale.TestApples_.locale('en-us', 0), 'no apples');
|
|
39
|
-
assert.equal(scopeTest.locale.TestApples_.locale('en-us', 1), 'one apple');
|
|
40
|
-
assert.equal(scopeTest.locale.TestApples_.locale('en-us', 2), '2 apples');
|
|
41
|
-
// chinese
|
|
42
|
-
assert.equal(scopeTest.locale.TestApples_.locale('zh-cn', 0), '没有苹果');
|
|
43
|
-
assert.equal(scopeTest.locale.TestApples_.locale('zh-cn', 1), '1个苹果');
|
|
44
|
-
assert.equal(scopeTest.locale.TestApples_.locale('zh-cn', 2), '2个苹果');
|
|
45
|
-
// english
|
|
46
|
-
assert.equal(
|
|
47
|
-
scopeTest.locale.TestNameApples_.locale('en-us', 'Mike', 0),
|
|
48
|
-
'Mike has no apples',
|
|
49
|
-
);
|
|
50
|
-
assert.equal(
|
|
51
|
-
scopeTest.locale.TestNameApples_.locale('en-us', 'Mike', 1),
|
|
52
|
-
'Mike has one apple',
|
|
53
|
-
);
|
|
54
|
-
assert.equal(
|
|
55
|
-
scopeTest.locale.TestNameApples_.locale('en-us', 'Mike', 2),
|
|
56
|
-
'Mike has 2 apples',
|
|
57
|
-
);
|
|
58
|
-
// chinese
|
|
59
|
-
assert.equal(scopeTest.locale.TestNameApples_.locale('zh-cn', 'Mike', 0), 'Mike没有苹果');
|
|
60
|
-
assert.equal(scopeTest.locale.TestNameApples_.locale('zh-cn', 'Mike', 1), 'Mike有1个苹果');
|
|
61
|
-
assert.equal(scopeTest.locale.TestNameApples_.locale('zh-cn', 'Mike', 2), 'Mike有2个苹果');
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import { app } from 'vona-mock';
|
|
3
|
-
|
|
4
|
-
describe.skip('mail.test.ts', () => {
|
|
5
|
-
it('action:mail', async () => {
|
|
6
|
-
await app.bean.executor.mockCtx(async () => {
|
|
7
|
-
await app.bean.mail.send({
|
|
8
|
-
to: 'someone@cabloy.com',
|
|
9
|
-
subject: 'this is a test mail',
|
|
10
|
-
text: 'message body!',
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { catchError } from '@cabloy/utils';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import { describe, it } from 'node:test';
|
|
4
|
-
import { app } from 'vona-mock';
|
|
5
|
-
|
|
6
|
-
describe('passport.test.ts', () => {
|
|
7
|
-
it('action:passport:simple', async () => {
|
|
8
|
-
await app.bean.executor.mockCtx(async () => {
|
|
9
|
-
await app.bean.passport.signinMock();
|
|
10
|
-
assert.equal(app.bean.passport.isAuthenticated, true);
|
|
11
|
-
assert.equal(app.bean.passport.current, app.ctx.passport);
|
|
12
|
-
assert.equal(app.bean.passport.currentUser, app.ctx.user);
|
|
13
|
-
await app.bean.executor.performAction('get', '/test/vona/passport/echo/:name', {
|
|
14
|
-
params: { name: 'admin' },
|
|
15
|
-
});
|
|
16
|
-
await app.bean.passport.signout();
|
|
17
|
-
assert.equal(app.bean.passport.isAuthenticated, false);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('action:passport:full', async () => {
|
|
22
|
-
await app.bean.executor.mockCtx(async () => {
|
|
23
|
-
// login
|
|
24
|
-
const jwt = await app.bean.executor.performAction('post', '/test/vona/passport/login', {
|
|
25
|
-
body: {
|
|
26
|
-
name: 'admin',
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
assert.equal(!!jwt?.accessToken, true);
|
|
30
|
-
// isAuthenticated
|
|
31
|
-
let isAuthenticated = await app.bean.executor.performAction(
|
|
32
|
-
'get',
|
|
33
|
-
'/test/vona/passport/isAuthenticated',
|
|
34
|
-
);
|
|
35
|
-
assert.equal(isAuthenticated, true);
|
|
36
|
-
// isAuthenticated: isolate
|
|
37
|
-
const [isAuthenticated2, _err] = await catchError(async () => {
|
|
38
|
-
return await app.bean.executor.newCtxIsolate(async () => {
|
|
39
|
-
return await app.bean.executor.performAction(
|
|
40
|
-
'get',
|
|
41
|
-
'/test/vona/passport/isAuthenticated',
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
assert.equal(isAuthenticated2, undefined);
|
|
46
|
-
// isAuthenticated: isolate + header
|
|
47
|
-
isAuthenticated = await app.bean.executor.newCtxIsolate(async () => {
|
|
48
|
-
return await app.bean.executor.performAction('get', '/test/vona/passport/isAuthenticated', {
|
|
49
|
-
authToken: jwt.accessToken,
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
assert.equal(isAuthenticated, true);
|
|
53
|
-
// refresh
|
|
54
|
-
const jwtNew = await app.bean.executor.performAction('post', '/test/vona/passport/refresh', {
|
|
55
|
-
body: {
|
|
56
|
-
refreshToken: jwt.refreshToken,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
assert.equal(!!jwtNew.accessToken, true);
|
|
60
|
-
// logout
|
|
61
|
-
await app.bean.executor.performAction('post', '/test/vona/passport/logout');
|
|
62
|
-
// isAuthenticated: isolate + header
|
|
63
|
-
const [isAuthenticated3] = await catchError(async () => {
|
|
64
|
-
return await app.bean.executor.performAction('get', '/test/vona/passport/isAuthenticated');
|
|
65
|
-
});
|
|
66
|
-
assert.equal(isAuthenticated3, undefined);
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import { app } from 'vona-mock';
|
|
3
|
-
|
|
4
|
-
describe('queue.test.ts', () => {
|
|
5
|
-
it('action:queue', async () => {
|
|
6
|
-
await app.bean.executor.mockCtx(async () => {
|
|
7
|
-
await app.bean.executor.performAction('post', '/test/vona/queue/push');
|
|
8
|
-
await app.bean.executor.performAction('post', '/test/vona/queue/pushAsync');
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import fse from 'fs-extra';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { describe, it } from 'node:test';
|
|
5
|
-
import { loadJSONFile } from 'vona';
|
|
6
|
-
import { app } from 'vona-mock';
|
|
7
|
-
|
|
8
|
-
describe('runtime.test.ts', () => {
|
|
9
|
-
it('action:runtime', async () => {
|
|
10
|
-
await app.bean.executor.mockCtx(async () => {
|
|
11
|
-
const runtimeFile = path.join(app.projectPath, '.app/runtime/-.json');
|
|
12
|
-
if (!fse.existsSync(runtimeFile)) throw new Error('dev server not running');
|
|
13
|
-
const runtime = await loadJSONFile(runtimeFile);
|
|
14
|
-
const runtimeUser = runtime['a-user'];
|
|
15
|
-
// isAuthenticated: isolate + header
|
|
16
|
-
const isAuthenticated = await app.bean.executor.newCtxIsolate(async () => {
|
|
17
|
-
return await app.bean.executor.performAction('get', '/test/vona/passport/isAuthenticated', {
|
|
18
|
-
authToken: runtimeUser?.accessToken,
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
assert.equal(isAuthenticated, true);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DtoSerializerArray,
|
|
3
|
-
DtoSerializerLazy,
|
|
4
|
-
DtoSerializerSimple,
|
|
5
|
-
} from 'vona-module-test-vona';
|
|
6
|
-
|
|
7
|
-
import assert from 'node:assert';
|
|
8
|
-
import { describe, it } from 'node:test';
|
|
9
|
-
import { app } from 'vona-mock';
|
|
10
|
-
|
|
11
|
-
describe('serializer.test.ts', () => {
|
|
12
|
-
const dataSimple = {
|
|
13
|
-
password: '123456',
|
|
14
|
-
password2: '123456',
|
|
15
|
-
email: 'kevin@cabloy.com',
|
|
16
|
-
email2: 'kevin@cabloy.com',
|
|
17
|
-
email3: 'kevin@cabloy.com',
|
|
18
|
-
email4: 'kevin@cabloy.com',
|
|
19
|
-
email5: 'kevin@cabloy.com',
|
|
20
|
-
email6: 'kevin@cabloy.com',
|
|
21
|
-
email7: 'kevin@cabloy.com',
|
|
22
|
-
firstName: 'k',
|
|
23
|
-
lastName: 'v',
|
|
24
|
-
} as DtoSerializerSimple;
|
|
25
|
-
it('action:serializerSimple', async () => {
|
|
26
|
-
await app.bean.executor.mockCtx(async () => {
|
|
27
|
-
const res: DtoSerializerSimple = await app.bean.executor.performAction(
|
|
28
|
-
'post',
|
|
29
|
-
'/test/vona/serializer/echoSimple',
|
|
30
|
-
{
|
|
31
|
-
body: dataSimple,
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
assert.equal(res.password, undefined);
|
|
35
|
-
assert.equal(res.password2, undefined);
|
|
36
|
-
assert.equal(res.email, 'k****n@cabloy.com');
|
|
37
|
-
assert.equal(res.email2, 'k****n@cabloy.com');
|
|
38
|
-
assert.equal(res.email3, 'k****n@cabloy.com');
|
|
39
|
-
assert.equal(res.email4, 'k****n@cabloy.com');
|
|
40
|
-
assert.equal(res.email5, 'k****n@cabloy.com');
|
|
41
|
-
assert.equal(res.email6, 'k****n@cabloy.com');
|
|
42
|
-
assert.equal(res.email7, 'k****n@cabloy.com');
|
|
43
|
-
assert.equal(res.fullName, 'k v');
|
|
44
|
-
assert.equal(res.fullName2, 'k v');
|
|
45
|
-
assert.equal(res.fullName3, 'k v');
|
|
46
|
-
assert.equal(res.fullName4, 'k v');
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
it('action:serializerArray', async () => {
|
|
50
|
-
await app.bean.executor.mockCtx(async () => {
|
|
51
|
-
const res: DtoSerializerArray[] = await app.bean.executor.performAction(
|
|
52
|
-
'post',
|
|
53
|
-
'/test/vona/serializer/echoArray',
|
|
54
|
-
{
|
|
55
|
-
body: [{ simples: [dataSimple], simplesLazy: [dataSimple] }],
|
|
56
|
-
},
|
|
57
|
-
);
|
|
58
|
-
assert.equal(res[0].simples[0].password, '111111');
|
|
59
|
-
assert.equal(res[0].simples[0].password2, undefined);
|
|
60
|
-
assert.equal(res[0].simplesLazy[0].password, '111111');
|
|
61
|
-
assert.equal(res[0].simplesLazy[0].password2, undefined);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
it('action:serializerLazy', async () => {
|
|
65
|
-
await app.bean.executor.mockCtx(async () => {
|
|
66
|
-
const res: DtoSerializerLazy = await app.bean.executor.performAction(
|
|
67
|
-
'post',
|
|
68
|
-
'/test/vona/serializer/echoLazy',
|
|
69
|
-
{
|
|
70
|
-
body: {
|
|
71
|
-
simple: dataSimple,
|
|
72
|
-
simpleLazy: dataSimple,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
);
|
|
76
|
-
assert.equal(res.simple.password, '111111');
|
|
77
|
-
assert.equal(res.simple.password2, undefined);
|
|
78
|
-
assert.equal(res.simpleLazy.password, '111111');
|
|
79
|
-
assert.equal(res.simpleLazy.password2, undefined);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
|
-
import { describe, it } from 'node:test';
|
|
3
|
-
import { app } from 'vona-mock';
|
|
4
|
-
|
|
5
|
-
describe('static.test.ts', () => {
|
|
6
|
-
it('action:static', async () => {
|
|
7
|
-
await app.bean.executor.mockCtx(async () => {
|
|
8
|
-
const scopeTest = app.scope('test-vona');
|
|
9
|
-
const url = scopeTest.static.get('img/vona.png');
|
|
10
|
-
assert.equal(url, '/api/static/test/vona/img/vona.png');
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
it('action:asset', async () => {
|
|
14
|
-
await app.bean.executor.mockCtx(async () => {
|
|
15
|
-
const scopeTest = app.scope('test-vona');
|
|
16
|
-
const file = scopeTest.asset.get('static', 'img/vona.png');
|
|
17
|
-
assert.equal(file.includes('vona.png'), true);
|
|
18
|
-
const file2 = scopeTest.asset.get('img', 'vona.png');
|
|
19
|
-
assert.equal(file2.includes('vona.png'), true);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import { cast } from 'vona';
|
|
3
|
-
import { app } from 'vona-mock';
|
|
4
|
-
|
|
5
|
-
describe('tail.test.ts', () => {
|
|
6
|
-
it('action:tail', async () => {
|
|
7
|
-
await app.bean.executor.mockCtx(async () => {
|
|
8
|
-
cast(app.ctx)._tail_test_caller = 1;
|
|
9
|
-
await app.bean.executor.performAction('post', '/test/vona/tail');
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('action:tail:transaction', async () => {
|
|
14
|
-
await app.bean.executor.mockCtx(async () => {
|
|
15
|
-
cast(app.ctx)._tail_test_als_caller = 1;
|
|
16
|
-
await app.ctx.db.transaction.begin(async () => {
|
|
17
|
-
await app.bean.executor.performAction('post', '/test/vona/tail');
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
|
-
import { Blob } from 'node:buffer';
|
|
3
|
-
import { describe, it } from 'node:test';
|
|
4
|
-
import { app } from 'vona-mock';
|
|
5
|
-
import { $apiPath } from 'vona-module-a-openapiutils';
|
|
6
|
-
|
|
7
|
-
describe('upload.test.ts', () => {
|
|
8
|
-
it('action:upload:fields', async () => {
|
|
9
|
-
await app.bean.executor.mockCtx(async () => {
|
|
10
|
-
const formData = new FormData();
|
|
11
|
-
formData.append('name', 'zhennann');
|
|
12
|
-
formData.append('checkes', 'apple');
|
|
13
|
-
formData.append('checkes', 'pear');
|
|
14
|
-
// formData.append('checkes', ['apple', 'pear']);
|
|
15
|
-
const url = app.util.getAbsoluteUrlByApiPath($apiPath('/test/vona/upload/fields'));
|
|
16
|
-
const res = await fetch(url, {
|
|
17
|
-
method: 'POST',
|
|
18
|
-
body: formData,
|
|
19
|
-
});
|
|
20
|
-
const data = await res.json();
|
|
21
|
-
assert.equal(data.data.fields.find(item => item.name === 'name')?.value, 'zhennann');
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
it('action:upload:file', async () => {
|
|
25
|
-
await app.bean.executor.mockCtx(async () => {
|
|
26
|
-
const formData = new FormData();
|
|
27
|
-
formData.append('name', 'zhennann');
|
|
28
|
-
formData.append('welcome', new (Blob as any)(['hello world!']), 'file-test.txt');
|
|
29
|
-
const url = app.util.getAbsoluteUrlByApiPath($apiPath('/test/vona/upload/file'));
|
|
30
|
-
const res = await fetch(url, {
|
|
31
|
-
method: 'POST',
|
|
32
|
-
body: formData,
|
|
33
|
-
});
|
|
34
|
-
const data = await res.json();
|
|
35
|
-
assert.equal(data.data.fields.find(item => item.name === 'name')?.value, 'zhennann');
|
|
36
|
-
assert.equal(
|
|
37
|
-
data.data.files.find(item => item.name === 'welcome')?.info.filename,
|
|
38
|
-
'file-test.txt',
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
it('action:upload:files', async () => {
|
|
43
|
-
await app.bean.executor.mockCtx(async () => {
|
|
44
|
-
const formData = new FormData();
|
|
45
|
-
formData.append('name', 'zhennann');
|
|
46
|
-
formData.append(
|
|
47
|
-
'welcome1',
|
|
48
|
-
new (Blob as any)(['hello world!'], { type: 'text/plain' }),
|
|
49
|
-
'file-test1.txt',
|
|
50
|
-
);
|
|
51
|
-
formData.append(
|
|
52
|
-
'welcome2',
|
|
53
|
-
new (Blob as any)(['hello world!'], { type: 'text/plain' }),
|
|
54
|
-
'file-test2.txt',
|
|
55
|
-
);
|
|
56
|
-
formData.append('images', new (Blob as any)(['hello world!'], { type: 'text/plain' }));
|
|
57
|
-
formData.append('images', new (Blob as any)(['hello world!'], { type: 'text/plain' }));
|
|
58
|
-
const url = app.util.getAbsoluteUrlByApiPath($apiPath('/test/vona/upload/files'));
|
|
59
|
-
const res = await fetch(url, {
|
|
60
|
-
method: 'POST',
|
|
61
|
-
body: formData,
|
|
62
|
-
});
|
|
63
|
-
const data = await res.json();
|
|
64
|
-
assert.equal(data.data.fields.find(item => item.name === 'name')?.value, 'zhennann');
|
|
65
|
-
assert.equal(
|
|
66
|
-
data.data.files.find(item => item.name === 'welcome1')?.info.filename,
|
|
67
|
-
'file-test1.txt',
|
|
68
|
-
);
|
|
69
|
-
assert.equal(
|
|
70
|
-
data.data.files.find(item => item.name === 'welcome2')?.info.filename,
|
|
71
|
-
'file-test2.txt',
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|