vona-module-test-vona 5.0.81 → 5.0.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/controller/order.d.ts +5 -5
  2. package/dist/controller/post.d.ts +6 -7
  3. package/dist/dto/orderCreate.d.ts +1 -1
  4. package/dist/dto/orderQueryPage.d.ts +1 -1
  5. package/dist/dto/orderUpdate.d.ts +1 -1
  6. package/dist/dto/postCreate.d.ts +1 -1
  7. package/dist/dto/postQuery.d.ts +2 -0
  8. package/dist/dto/userCreate.d.ts +1 -1
  9. package/dist/dto/userUpdate.d.ts +1 -1
  10. package/dist/index.js +112 -123
  11. package/dist/service/caching.d.ts +3 -4
  12. package/dist/service/post.d.ts +5 -5
  13. package/package.json +1 -1
  14. package/src/controller/bean.ts +1 -1
  15. package/src/controller/cacheMem.ts +1 -1
  16. package/src/controller/cacheRedis.ts +1 -1
  17. package/src/controller/dtoTest.ts +1 -1
  18. package/src/controller/onion.ts +1 -1
  19. package/src/controller/order.ts +4 -13
  20. package/src/controller/passport.ts +1 -1
  21. package/src/controller/performAction.ts +1 -1
  22. package/src/controller/post.ts +4 -8
  23. package/src/controller/queue.ts +1 -1
  24. package/src/controller/serializer.ts +1 -1
  25. package/src/controller/summer.ts +1 -1
  26. package/src/controller/tail.ts +1 -1
  27. package/src/controller/transaction.ts +1 -1
  28. package/src/controller/upload.ts +1 -1
  29. package/src/dto/orderQuery.ts +7 -10
  30. package/src/dto/orderQueryPage.ts +1 -1
  31. package/src/dto/postQuery.ts +13 -6
  32. package/src/dto/profile.ts +1 -1
  33. package/src/dto/roleLazy.ts +1 -1
  34. package/src/dto/serializerArray.ts +1 -1
  35. package/src/dto/serializerLazy.ts +1 -1
  36. package/src/dto/serializerSimple.ts +1 -1
  37. package/src/dto/signin.ts +1 -1
  38. package/src/dto/user.ts +1 -1
  39. package/src/dto/userLazy.ts +1 -1
  40. package/src/entity/category.ts +1 -1
  41. package/src/entity/order.ts +1 -1
  42. package/src/entity/post.ts +1 -1
  43. package/src/entity/postContent.ts +1 -1
  44. package/src/entity/product.ts +1 -1
  45. package/src/entity/role.ts +1 -1
  46. package/src/entity/roleUser.ts +1 -1
  47. package/src/entity/test.ts +1 -1
  48. package/src/entity/user.ts +1 -1
  49. package/src/model/testDynamicTable.ts +2 -2
  50. package/src/service/caching.ts +15 -20
  51. package/test/database/database.test.ts +2 -2
  52. package/test/database/dtoAggregate.test.ts +1 -1
  53. package/test/database/dtoGet.test.ts +3 -3
  54. package/test/database/dtoGroup.test.ts +1 -1
  55. package/test/database/dtoLazy.test.ts +1 -1
  56. package/test/database/dtoMutate.test.ts +2 -2
  57. package/test/database/dtoQuery.test.ts +9 -0
  58. package/test/runtime.test.ts +22 -0
  59. package/test/upload.test.ts +1 -1
  60. package/test/utils/mappedTypes.test.ts +1 -1
@@ -9,7 +9,7 @@ export declare class ServicePost extends BeanBase {
9
9
  };
10
10
  with?: Record<string, unknown>;
11
11
  distinct?: boolean | keyof import("vona-module-test-vona").EntityPost | (keyof import("vona-module-test-vona").EntityPost)[] | undefined;
12
- columns?: "title" | "id" | "iid" | "createdAt" | "updatedAt" | "deleted" | "*" | "userId" | "stars" | ("title" | "id" | "iid" | "createdAt" | "updatedAt" | "deleted" | "*" | "userId" | "stars")[] | undefined;
12
+ columns?: "title" | "id" | "userId" | "*" | "iid" | "deleted" | "createdAt" | "updatedAt" | "stars" | ("title" | "id" | "userId" | "*" | "iid" | "deleted" | "createdAt" | "updatedAt" | "stars")[] | undefined;
13
13
  where?: import("vona-module-a-orm").TypeModelWhereInner<{
14
14
  "testVonaUser.name": string;
15
15
  "testVonaUser.age"?: number | undefined;
@@ -50,12 +50,12 @@ export declare class ServicePost extends BeanBase {
50
50
  postContent: "testVonaPostContent";
51
51
  user: "testVonaUser";
52
52
  }>, import("vona-module-a-orm").TypeEntityTableColumnNamesOfModelSelf<ModelPost> | import("vona").TypeRecordValues<{
53
- postContent: "testVonaPostContent.content" | "testVonaPostContent.id" | "testVonaPostContent.iid" | "testVonaPostContent.createdAt" | "testVonaPostContent.updatedAt" | "testVonaPostContent.deleted" | "testVonaPostContent.postId";
54
- user: "testVonaUser.name" | "testVonaUser.id" | "testVonaUser.iid" | "testVonaUser.createdAt" | "testVonaUser.updatedAt" | "testVonaUser.deleted" | "testVonaUser.age" | "testVonaUser.scores";
53
+ postContent: "testVonaPostContent.content" | "testVonaPostContent.id" | "testVonaPostContent.iid" | "testVonaPostContent.deleted" | "testVonaPostContent.createdAt" | "testVonaPostContent.updatedAt" | "testVonaPostContent.postId";
54
+ user: "testVonaUser.name" | "testVonaUser.id" | "testVonaUser.age" | "testVonaUser.iid" | "testVonaUser.deleted" | "testVonaUser.createdAt" | "testVonaUser.updatedAt" | "testVonaUser.scores";
55
55
  }>>[] | undefined;
56
56
  orders?: import("vona-module-a-orm").IModelSelectParamsOrder<import("vona-module-a-orm").TypeEntityTableColumnNamesOfModelSelf<ModelPost> | import("vona").TypeRecordValues<{
57
- postContent: "testVonaPostContent.content" | "testVonaPostContent.id" | "testVonaPostContent.iid" | "testVonaPostContent.createdAt" | "testVonaPostContent.updatedAt" | "testVonaPostContent.deleted" | "testVonaPostContent.postId";
58
- user: "testVonaUser.name" | "testVonaUser.id" | "testVonaUser.iid" | "testVonaUser.createdAt" | "testVonaUser.updatedAt" | "testVonaUser.deleted" | "testVonaUser.age" | "testVonaUser.scores";
57
+ postContent: "testVonaPostContent.content" | "testVonaPostContent.id" | "testVonaPostContent.iid" | "testVonaPostContent.deleted" | "testVonaPostContent.createdAt" | "testVonaPostContent.updatedAt" | "testVonaPostContent.postId";
58
+ user: "testVonaUser.name" | "testVonaUser.id" | "testVonaUser.age" | "testVonaUser.iid" | "testVonaUser.deleted" | "testVonaUser.createdAt" | "testVonaUser.updatedAt" | "testVonaUser.scores";
59
59
  }>>[] | undefined;
60
60
  limit?: number;
61
61
  offset?: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-test-vona",
3
3
  "type": "module",
4
- "version": "5.0.81",
4
+ "version": "5.0.83",
5
5
  "title": "test-vona",
6
6
  "vonaModule": {
7
7
  "fileVersion": 1,
@@ -1,7 +1,7 @@
1
1
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import assert from 'node:assert';
3
3
  import { BeanBase, cast } from 'vona';
4
- import { Api } from 'vona-module-a-openapi';
4
+ import { Api } from 'vona-module-a-openapiutils';
5
5
  import { Passport } from 'vona-module-a-user';
6
6
  import { Controller, Web } from 'vona-module-a-web';
7
7
  import { __ThisModule__ } from '../.metadata/this.ts';
@@ -2,7 +2,7 @@ import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import assert from 'node:assert';
3
3
  import { sleep } from '@cabloy/utils';
4
4
  import { BeanBase, retry } from 'vona';
5
- import { Api } from 'vona-module-a-openapi';
5
+ import { Api } from 'vona-module-a-openapiutils';
6
6
  import { Passport } from 'vona-module-a-user';
7
7
  import { Controller, Web } from 'vona-module-a-web';
8
8
 
@@ -2,7 +2,7 @@ import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import assert from 'node:assert';
3
3
  import { sleep } from '@cabloy/utils';
4
4
  import { BeanBase, retry } from 'vona';
5
- import { Api } from 'vona-module-a-openapi';
5
+ import { Api } from 'vona-module-a-openapiutils';
6
6
  import { Passport } from 'vona-module-a-user';
7
7
  import { Controller, Web } from 'vona-module-a-web';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
2
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
3
3
  import { BeanBase } from 'vona';
4
- import { Api, v } from 'vona-module-a-openapi';
4
+ import { Api, v } from 'vona-module-a-openapiutils';
5
5
  import { $Dto } from 'vona-module-a-orm';
6
6
  import { Arg, Controller, Web } from 'vona-module-a-web';
7
7
  import { DtoCategoryTree } from '../dto/categoryTree.ts';
@@ -2,7 +2,7 @@ import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import { BeanBase } from 'vona';
3
3
  import { Aspect } from 'vona-module-a-aspect';
4
4
  import { Core } from 'vona-module-a-core';
5
- import { Api, v } from 'vona-module-a-openapi';
5
+ import { Api, v } from 'vona-module-a-openapiutils';
6
6
  import { Passport } from 'vona-module-a-user';
7
7
  import { Arg, Controller, Web } from 'vona-module-a-web';
8
8
  import { z } from 'zod';
@@ -1,10 +1,9 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
- import type { VonaContext } from 'vona';
3
2
  import type { IQueryParams } from 'vona-module-a-orm';
4
- import type { IDecoratorControllerOptions, IPipeOptionsQueryTransformInfo } from 'vona-module-a-web';
3
+ import type { IDecoratorControllerOptions } from 'vona-module-a-web';
5
4
  import type { ModelOrder } from '../model/order.ts';
6
5
  import { BeanBase } from 'vona';
7
- import { Api, v } from 'vona-module-a-openapi';
6
+ import { Api, v } from 'vona-module-a-openapiutils';
8
7
  import { Arg, Controller, Web } from 'vona-module-a-web';
9
8
  import { DtoOrderCreate } from '../dto/orderCreate.ts';
10
9
  import { DtoOrderQuery } from '../dto/orderQuery.ts';
@@ -15,14 +14,6 @@ import { DtoOrderUpdate } from '../dto/orderUpdate.ts';
15
14
 
16
15
  export interface IControllerOptionsOrder extends IDecoratorControllerOptions {}
17
16
 
18
- function myCustomQueryTransform(_ctx: VonaContext, info: IPipeOptionsQueryTransformInfo): boolean | undefined {
19
- if (info.key === 'userName') {
20
- info.params.where[info.fullName] = info.value;
21
- return true;
22
- }
23
- return undefined;
24
- }
25
-
26
17
  @Controller<IControllerOptionsOrder>('order')
27
18
  export class ControllerOrder extends BeanBase {
28
19
  @Web.post('create')
@@ -39,7 +30,7 @@ export class ControllerOrder extends BeanBase {
39
30
  @Web.get('findAll')
40
31
  @Api.body(v.array(DtoOrderResult))
41
32
  async findAll(
42
- @Arg.queryPro(DtoOrderQuery, myCustomQueryTransform) params: IQueryParams<ModelOrder>,
33
+ @Arg.filter(DtoOrderQuery) params: IQueryParams<ModelOrder>,
43
34
  ): Promise<DtoOrderResult[]> {
44
35
  return this.scope.model.order.select({
45
36
  ...params,
@@ -52,7 +43,7 @@ export class ControllerOrder extends BeanBase {
52
43
  @Web.get('findMany')
53
44
  @Api.body(DtoOrderResultPage)
54
45
  async findMany(
55
- @Arg.queryPro(DtoOrderQueryPage) params: IQueryParams<ModelOrder>,
46
+ @Arg.filter(DtoOrderQueryPage) params: IQueryParams<ModelOrder>,
56
47
  ) {
57
48
  return this.scope.model.order.selectAndCount({
58
49
  ...params,
@@ -4,7 +4,7 @@ import type { IDecoratorControllerOptions } from 'vona-module-a-web';
4
4
  import assert from 'node:assert';
5
5
  import { BeanBase } from 'vona';
6
6
  import { DtoJwtToken } from 'vona-module-a-jwt';
7
- import { Api, v } from 'vona-module-a-openapi';
7
+ import { Api, v } from 'vona-module-a-openapiutils';
8
8
  import { Passport } from 'vona-module-a-user';
9
9
  import { Arg, Controller, Web } from 'vona-module-a-web';
10
10
 
@@ -1,6 +1,6 @@
1
1
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import { BeanBase } from 'vona';
3
- import { Api } from 'vona-module-a-openapi';
3
+ import { Api } from 'vona-module-a-openapiutils';
4
4
  import { Passport } from 'vona-module-a-user';
5
5
  import { Arg, Controller, Web } from 'vona-module-a-web';
6
6
 
@@ -1,8 +1,8 @@
1
1
  import type { IQueryParams } from 'vona-module-a-orm';
2
- import type { IDecoratorControllerOptions, IPipeOptionsQueryTransformInfo } from 'vona-module-a-web';
2
+ import type { IDecoratorControllerOptions } from 'vona-module-a-web';
3
3
  import type { ModelPost } from '../model/post.ts';
4
4
  import { BeanBase } from 'vona';
5
- import { Api, v } from 'vona-module-a-openapi';
5
+ import { Api, v } from 'vona-module-a-openapiutils';
6
6
  import { Passport } from 'vona-module-a-user';
7
7
  import { Arg, Controller, Web } from 'vona-module-a-web';
8
8
  import { DtoPostAggregate } from '../dto/postAggregate.ts';
@@ -43,18 +43,14 @@ export class ControllerPost extends BeanBase {
43
43
  @Web.get('findManyEcho')
44
44
  @Api.body(DtoPostQueryRes)
45
45
  @Passport.public()
46
- findManyEcho(@Arg.queryPro(DtoPostQuery) params: IQueryParams<ModelPost>) {
46
+ findManyEcho(@Arg.filter(DtoPostQuery) params: IQueryParams<ModelPost>) {
47
47
  return params;
48
48
  }
49
49
 
50
- findManyQueryTransform(_info: IPipeOptionsQueryTransformInfo): boolean | undefined {
51
- return undefined;
52
- }
53
-
54
50
  @Web.get('findMany')
55
51
  @Api.body(DtoPostQueryRes)
56
52
  @Passport.public()
57
- async findMany(@Arg.queryPro(DtoPostQuery) params: IQueryParams<ModelPost>) {
53
+ async findMany(@Arg.filter(DtoPostQuery) params: IQueryParams<ModelPost>) {
58
54
  return await this.scope.service.post.findMany(params);
59
55
  }
60
56
  }
@@ -1,7 +1,7 @@
1
1
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import assert from 'node:assert';
3
3
  import { BeanBase } from 'vona';
4
- import { Api } from 'vona-module-a-openapi';
4
+ import { Api } from 'vona-module-a-openapiutils';
5
5
  import { Passport } from 'vona-module-a-user';
6
6
  import { Controller, Web } from 'vona-module-a-web';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import { BeanBase } from 'vona';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Serializer } from 'vona-module-a-serialization';
5
5
  import { Passport } from 'vona-module-a-user';
6
6
  import { Arg, Controller, Web } from 'vona-module-a-web';
@@ -3,7 +3,7 @@ import type { SummerCacheTest, TSummerCacheTestData } from '../bean/summerCache.
3
3
  import assert from 'node:assert';
4
4
  import { sleep } from '@cabloy/utils';
5
5
  import { BeanBase, retry } from 'vona';
6
- import { Api } from 'vona-module-a-openapi';
6
+ import { Api } from 'vona-module-a-openapiutils';
7
7
  import { Passport } from 'vona-module-a-user';
8
8
  import { Controller, Web } from 'vona-module-a-web';
9
9
  import { __ThisModule__ } from '../.metadata/this.ts';
@@ -1,7 +1,7 @@
1
1
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import assert from 'node:assert';
3
3
  import { BeanBase, cast } from 'vona';
4
- import { Api } from 'vona-module-a-openapi';
4
+ import { Api } from 'vona-module-a-openapiutils';
5
5
  import { Passport } from 'vona-module-a-user';
6
6
  import { Controller, Web } from 'vona-module-a-web';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
2
2
  import { BeanBase } from 'vona';
3
3
  import { Core } from 'vona-module-a-core';
4
- import { Api } from 'vona-module-a-openapi';
4
+ import { Api } from 'vona-module-a-openapiutils';
5
5
  import { Passport } from 'vona-module-a-user';
6
6
  import { Arg, Controller, Web } from 'vona-module-a-web';
7
7
 
@@ -3,7 +3,7 @@ import type { IDecoratorControllerOptions } from 'vona-module-a-web';
3
3
  import assert from 'node:assert';
4
4
  import { BeanBase } from 'vona';
5
5
  import { Core } from 'vona-module-a-core';
6
- import { Api, v } from 'vona-module-a-openapi';
6
+ import { Api, v } from 'vona-module-a-openapiutils';
7
7
  import { SymbolUploadValue } from 'vona-module-a-upload';
8
8
  import { Passport } from 'vona-module-a-user';
9
9
  import { Arg, Controller, Web } from 'vona-module-a-web';
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { $Dto, $tableName } from 'vona-module-a-orm';
4
4
  import { Dto } from 'vona-module-a-web';
5
5
  import { EntityOrder } from '../entity/order.ts';
@@ -8,21 +8,18 @@ import { EntityUser } from '../entity/user.ts';
8
8
  export interface IDtoOptionsOrderQuery extends IDecoratorDtoOptions {}
9
9
 
10
10
  @Dto<IDtoOptionsOrderQuery>({
11
- openapi: {
12
- query: {
13
- table: $tableName(EntityOrder),
14
- },
15
- },
11
+ openapi: { filter: { table: $tableName(EntityOrder) } },
16
12
  })
17
13
  export class DtoOrderQuery
18
14
  extends $Dto.query(EntityOrder, ['orderNo', 'remark']) {
19
- @Api.field(v.optional(), v.openapi({
20
- query: {
15
+ @Api.field(
16
+ v.filter({
21
17
  table: $tableName(EntityUser),
22
18
  joinType: 'innerJoin',
23
19
  joinOn: ['userId', 'testVonaUser.id'],
24
20
  originalName: 'name',
25
- },
26
- }))
21
+ }),
22
+ v.optional(),
23
+ )
27
24
  userName?: string;
28
25
  }
@@ -1,6 +1,6 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
2
  import { $Class } from 'vona';
3
- import { Api } from 'vona-module-a-openapi';
3
+ import { Api } from 'vona-module-a-openapiutils';
4
4
  import { $Dto } from 'vona-module-a-orm';
5
5
  import { Dto } from 'vona-module-a-web';
6
6
  import z from 'zod';
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { $Dto, $tableName } from 'vona-module-a-orm';
4
4
  import { Dto } from 'vona-module-a-web';
5
5
  import { EntityPost } from '../entity/post.ts';
@@ -7,16 +7,23 @@ import { EntityPost } from '../entity/post.ts';
7
7
  export interface IDtoOptionsPostQuery extends IDecoratorDtoOptions {}
8
8
 
9
9
  @Dto<IDtoOptionsPostQuery>({
10
- openapi: { query: { table: $tableName(EntityPost) } },
10
+ openapi: { filter: { table: $tableName(EntityPost) } },
11
11
  })
12
12
  export class DtoPostQuery extends $Dto.queryPage(EntityPost, ['title']) {
13
- @Api.field(v.optional(), v.openapi({
14
- query: {
13
+ @Api.field(v.optional())
14
+ title?: string;
15
+
16
+ @Api.field(
17
+ v.filter({
15
18
  table: 'testVonaUser',
16
19
  joinOn: ['userId', 'testVonaUser.id'],
17
20
  originalName: 'name',
18
21
  op: '_eqI_',
19
- },
20
- }))
22
+ }),
23
+ v.optional(),
24
+ )
21
25
  userName?: string;
26
+
27
+ @Api.field(v.filterDateRange({ separator: ' - ' }), v.optional())
28
+ createdAt: string;
22
29
  }
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { Dto } from 'vona-module-a-web';
4
4
 
5
5
  export interface IDtoOptionsProfile extends IDecoratorDtoOptions {}
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { Dto } from 'vona-module-a-web';
4
4
  import { DtoUserLazy } from './userLazy.ts';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { Dto } from 'vona-module-a-web';
4
4
  import { DtoSerializerSimple } from './serializerSimple.ts';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { Dto } from 'vona-module-a-web';
4
4
  import { DtoSerializerSimple } from './serializerSimple.ts';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { Serializer } from 'vona-module-a-serialization';
4
4
  import { Dto } from 'vona-module-a-web';
5
5
  import { SensitiveEmail } from '../lib/serializer.ts';
package/src/dto/signin.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { DtoCaptchaVerify } from 'vona-module-a-captcha';
2
2
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Dto } from 'vona-module-a-web';
5
5
 
6
6
  export interface IDtoOptionsSignin extends IDecoratorDtoOptions {}
package/src/dto/user.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
2
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Dto } from 'vona-module-a-web';
5
5
  import { $locale } from '../.metadata/index.ts';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorDtoOptions } from 'vona-module-a-web';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { Dto } from 'vona-module-a-web';
4
4
  import { DtoRoleLazy } from './roleLazy.ts';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
2
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Entity, EntityBase } from 'vona-module-a-orm';
5
5
 
6
6
  export interface IEntityOptionsCategory extends IDecoratorEntityOptions {}
@@ -1,6 +1,6 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
2
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Entity, EntityBase } from 'vona-module-a-orm';
5
5
  import { $locale } from '../.metadata/index.ts';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
2
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Entity, EntityBase } from 'vona-module-a-orm';
5
5
 
6
6
  export interface IEntityOptionsPost extends IDecoratorEntityOptions {}
@@ -1,6 +1,6 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
2
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Entity, EntityBase } from 'vona-module-a-orm';
5
5
 
6
6
  export interface IEntityOptionsPostContent extends IDecoratorEntityOptions {}
@@ -1,6 +1,6 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
2
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Entity, EntityBase } from 'vona-module-a-orm';
5
5
  import { $locale } from '../.metadata/index.ts';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
2
- import { Api } from 'vona-module-a-openapi';
2
+ import { Api } from 'vona-module-a-openapiutils';
3
3
  import { Entity, EntityBase } from 'vona-module-a-orm';
4
4
 
5
5
  export interface IEntityOptionsRole extends IDecoratorEntityOptions {}
@@ -1,6 +1,6 @@
1
1
  import type { TableIdentity } from 'table-identity';
2
2
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
3
- import { Api, v } from 'vona-module-a-openapi';
3
+ import { Api, v } from 'vona-module-a-openapiutils';
4
4
  import { Entity, EntityBase } from 'vona-module-a-orm';
5
5
 
6
6
  export interface IEntityOptionsRoleUser extends IDecoratorEntityOptions {}
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { Entity, EntityBase } from 'vona-module-a-orm';
4
4
  import { $locale } from '../.metadata/index.ts';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
2
- import { Api, v } from 'vona-module-a-openapi';
2
+ import { Api, v } from 'vona-module-a-openapiutils';
3
3
  import { Entity, EntityBase } from 'vona-module-a-orm';
4
4
 
5
5
  export interface IEntityOptionsUser extends IDecoratorEntityOptions {}
@@ -1,6 +1,6 @@
1
1
  import type { VonaContext } from 'vona';
2
2
  import type { IDecoratorModelOptions, ITableRecord } from 'vona-module-a-orm';
3
- import moment from 'moment';
3
+ import { DateTime } from 'luxon';
4
4
  import { BeanModelBase, Model } from 'vona-module-a-orm';
5
5
  import { EntityTest } from '../entity/test.ts';
6
6
 
@@ -10,7 +10,7 @@ export interface IModelOptionsTestDynamicTable extends IDecoratorModelOptions<En
10
10
  entity: EntityTest,
11
11
  table(ctx: VonaContext, _where: EntityTest | undefined, defaultTable: keyof ITableRecord) {
12
12
  if (ctx.instanceName !== '') return defaultTable;
13
- return `${defaultTable}_${moment().format('YYYYMMDD')}`;
13
+ return `${defaultTable}_${DateTime.now().toFormat('yyyyMMdd')}`;
14
14
  },
15
15
  softDeletionPrune: {
16
16
  handler: async (_ctx, _modelInstance: ModelTestDynamicTable) => {
@@ -1,29 +1,24 @@
1
- import type { TypeCachingActionOptions } from 'vona-module-a-caching';
1
+ import type { ICachingActionKeyInfo, ICachingActionValueInfo, TypeCachingActionOptions } from 'vona-module-a-caching';
2
2
  import type { TSummerCacheTestData } from '../bean/summerCache.test.ts';
3
3
  import { BeanBase } from 'vona';
4
4
  import { Service } from 'vona-module-a-bean';
5
- import { getKeyHash } from 'vona-module-a-cache';
6
5
  import { Caching } from 'vona-module-a-caching';
7
6
 
8
- function cacheKeyFn(this: ServiceCaching, args: [], prop: string, options: TypeCachingActionOptions): any {
9
- return `${this.$beanFullName}_${options.cacheProp ?? prop}_${getKeyHash(args)}`;
7
+ function cacheKeyFn(this: ServiceCaching, info: ICachingActionKeyInfo, _options: TypeCachingActionOptions): any {
8
+ return info.args[0];
10
9
  }
11
10
 
12
11
  @Service()
13
12
  export class ServiceCaching extends BeanBase {
14
- cacheKey(args: any[], prop: string, options: TypeCachingActionOptions) {
15
- return `${this.$beanFullName}_${options.cacheProp ?? prop}_${getKeyHash(args)}`;
13
+ cacheKey(info: ICachingActionKeyInfo, _options: TypeCachingActionOptions) {
14
+ return info.args[0];
16
15
  }
17
16
 
18
- cacheKeySet(args: any[], prop: string, options: TypeCachingActionOptions) {
19
- return `${this.$beanFullName}_${options.cacheProp ?? prop}_${getKeyHash(args.slice(0, -1))}`;
17
+ cacheValue(info: ICachingActionValueInfo, _options: TypeCachingActionOptions) {
18
+ return info.args[1];
20
19
  }
21
20
 
22
- cacheValueSet(_value: any, args: any[], _prop: string, _options: TypeCachingActionOptions) {
23
- return args[args.length - 1];
24
- }
25
-
26
- @Caching.get({ cacheName: 'test-vona:test', cacheProp: 'test', cacheKeyFn: 'cacheKey' })
21
+ @Caching.get({ cacheName: 'test-vona:test', cacheKeyFn: 'cacheKey' })
27
22
  async get(id: number): Promise<TSummerCacheTestData> {
28
23
  return {
29
24
  id,
@@ -31,39 +26,39 @@ export class ServiceCaching extends BeanBase {
31
26
  };
32
27
  }
33
28
 
34
- @Caching.get({ cacheName: 'test-vona:test', cacheProp: 'test', cacheKeyFn })
29
+ @Caching.get({ cacheName: 'test-vona:test', cacheKeyFn })
35
30
  async get2(_id: number): Promise<TSummerCacheTestData> {
36
31
  return undefined as any;
37
32
  }
38
33
 
39
- @Caching.get({ cacheName: 'test-vona:test', cacheProp: 'test', cacheKey: 'cel://join([get(self,"$beanFullName"),options.cacheProp,hashkey(args)],"_")' })
34
+ @Caching.get({ cacheName: 'test-vona:test', cacheKey: 'cel://args[0]' })
40
35
  async get3(_id: number): Promise<TSummerCacheTestData> {
41
36
  return undefined as any;
42
37
  }
43
38
 
44
39
  // default cacheKey
45
- @Caching.get({ cacheName: 'test-vona:test', cacheProp: 'test' })
40
+ @Caching.get({ cacheName: 'test-vona:test' })
46
41
  async get4(_id: number): Promise<TSummerCacheTestData> {
47
42
  return undefined as any;
48
43
  }
49
44
 
50
- @Caching.set({ cacheName: 'test-vona:test', cacheProp: 'test', cacheKeyFn: 'cacheKeySet', cacheValueFn: 'cacheValueSet' })
45
+ @Caching.set({ cacheName: 'test-vona:test', cacheKeyFn: 'cacheKey', cacheValueFn: 'cacheValue' })
51
46
  async set(_id: number, _value: TSummerCacheTestData): Promise<void> {
52
47
  // do nothing
53
48
  }
54
49
 
55
50
  //
56
- @Caching.set({ cacheName: 'test-vona:test', cacheProp: 'test', cacheKey: 'cel://join([get(self,"$beanFullName"),options.cacheProp,hashkey([args[0]])],"_")', cacheValue: 'cel://{"id": args[1].id, "name": args[1].name}' })
51
+ @Caching.set({ cacheName: 'test-vona:test', cacheKey: 'cel://args[0]', cacheValue: 'cel://{"id": args[1].id, "name": args[1].name}' })
57
52
  async set2(_id: number, _value: TSummerCacheTestData): Promise<void> {
58
53
  // do nothing
59
54
  }
60
55
 
61
- @Caching.set({ cacheName: 'test-vona:test', cacheProp: 'test', cacheKeyFn: 'cacheKeySet' })
56
+ @Caching.set({ cacheName: 'test-vona:test', cacheKeyFn: 'cacheKey' })
62
57
  async set3(_id: number, value: TSummerCacheTestData): Promise<TSummerCacheTestData> {
63
58
  return value;
64
59
  }
65
60
 
66
- @Caching.del({ cacheName: 'test-vona:test', cacheProp: 'test' })
61
+ @Caching.del({ cacheName: 'test-vona:test' })
67
62
  async del(_id: number): Promise<void> {
68
63
  // do nothing
69
64
  }
@@ -1,7 +1,7 @@
1
1
  import assert from 'node:assert';
2
2
  import { describe, it } from 'node:test';
3
3
  import { catchError } from '@cabloy/utils';
4
- import moment from 'moment';
4
+ import { DateTime } from 'luxon';
5
5
  import { app } from 'vona-mock';
6
6
 
7
7
  describe('database.test.ts', () => {
@@ -100,7 +100,7 @@ describe('database.test.ts', () => {
100
100
  const entityTest = scopeTest.entity.test;
101
101
  const modelTest = scopeTest.model.testDynamicTable;
102
102
  // tableName
103
- const tableName = `${entityTest.$table}_${moment().format('YYYYMMDD')}`;
103
+ const tableName = `${entityTest.$table}_${DateTime.now().toFormat('yyyyMMdd')}`;
104
104
  // create table
105
105
  await app.bean.model.createTable(tableName, table => {
106
106
  table.basicFields();
@@ -3,7 +3,7 @@ import type z from 'zod';
3
3
  import assert from 'node:assert';
4
4
  import { describe, it } from 'node:test';
5
5
  import { app } from 'vona-mock';
6
- import { getTargetDecoratorRules } from 'vona-module-a-openapi';
6
+ import { getTargetDecoratorRules } from 'vona-module-a-openapiutils';
7
7
  import { $Dto } from 'vona-module-a-orm';
8
8
  import { ModelUserStats } from 'vona-module-test-vona';
9
9