vona-module-test-vona 5.0.82 → 5.0.84
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/dist/.metadata/index.d.ts +11 -0
- package/dist/bean/summerCache.caching.d.ts +12 -0
- package/dist/bean/summerCache.test.d.ts +1 -1
- package/dist/controller/order.d.ts +5 -5
- package/dist/controller/post.d.ts +6 -7
- package/dist/dto/orderCreate.d.ts +1 -1
- package/dist/dto/orderQueryPage.d.ts +1 -1
- package/dist/dto/orderUpdate.d.ts +1 -1
- package/dist/dto/postCreate.d.ts +1 -1
- package/dist/dto/postQuery.d.ts +1 -0
- package/dist/dto/userCreate.d.ts +1 -1
- package/dist/dto/userUpdate.d.ts +1 -1
- package/dist/index.js +299 -295
- package/dist/service/caching.d.ts +3 -4
- package/dist/service/post.d.ts +5 -5
- package/package.json +1 -1
- package/src/.metadata/index.ts +17 -2
- package/src/bean/summerCache.caching.ts +29 -0
- package/src/bean/summerCache.test.ts +4 -4
- package/src/controller/bean.ts +1 -1
- package/src/controller/cacheMem.ts +1 -1
- package/src/controller/cacheRedis.ts +1 -1
- package/src/controller/dtoTest.ts +1 -1
- package/src/controller/onion.ts +1 -1
- package/src/controller/order.ts +4 -13
- package/src/controller/passport.ts +1 -1
- package/src/controller/performAction.ts +1 -1
- package/src/controller/post.ts +4 -8
- package/src/controller/queue.ts +1 -1
- package/src/controller/serializer.ts +1 -1
- package/src/controller/summer.ts +3 -3
- package/src/controller/tail.ts +1 -1
- package/src/controller/transaction.ts +1 -1
- package/src/controller/upload.ts +1 -1
- package/src/dto/orderQuery.ts +7 -10
- package/src/dto/orderQueryPage.ts +1 -1
- package/src/dto/postQuery.ts +10 -6
- package/src/dto/profile.ts +1 -1
- package/src/dto/roleLazy.ts +1 -1
- package/src/dto/serializerArray.ts +1 -1
- package/src/dto/serializerLazy.ts +1 -1
- package/src/dto/serializerSimple.ts +1 -1
- package/src/dto/signin.ts +1 -1
- package/src/dto/user.ts +1 -1
- package/src/dto/userLazy.ts +1 -1
- package/src/entity/category.ts +1 -1
- package/src/entity/order.ts +1 -1
- package/src/entity/post.ts +1 -1
- package/src/entity/postContent.ts +1 -1
- package/src/entity/product.ts +1 -1
- package/src/entity/role.ts +1 -1
- package/src/entity/roleUser.ts +1 -1
- package/src/entity/test.ts +1 -1
- package/src/entity/user.ts +1 -1
- package/src/model/testDynamicTable.ts +2 -2
- package/src/service/caching.ts +16 -21
- package/test/cache/caching.test.ts +5 -2
- package/test/database/database.test.ts +2 -2
- package/test/database/dtoAggregate.test.ts +1 -1
- package/test/database/dtoGet.test.ts +3 -3
- package/test/database/dtoGroup.test.ts +1 -1
- package/test/database/dtoLazy.test.ts +1 -1
- package/test/database/dtoMutate.test.ts +2 -2
- package/test/database/dtoQuery.test.ts +9 -0
- package/test/upload.test.ts +1 -1
- package/test/utils/mappedTypes.test.ts +1 -1
|
@@ -1,10 +1,9 @@
|
|
|
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
|
export declare class ServiceCaching extends BeanBase {
|
|
5
|
-
cacheKey(
|
|
6
|
-
|
|
7
|
-
cacheValueSet(_value: any, args: any[], _prop: string, _options: TypeCachingActionOptions): any;
|
|
5
|
+
cacheKey(info: ICachingActionKeyInfo, _options: TypeCachingActionOptions): any;
|
|
6
|
+
cacheValue(info: ICachingActionValueInfo, _options: TypeCachingActionOptions): any;
|
|
8
7
|
get(id: number): Promise<TSummerCacheTestData>;
|
|
9
8
|
get2(_id: number): Promise<TSummerCacheTestData>;
|
|
10
9
|
get3(_id: number): Promise<TSummerCacheTestData>;
|
package/dist/service/post.d.ts
CHANGED
|
@@ -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" | "
|
|
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.
|
|
54
|
-
user: "testVonaUser.name" | "testVonaUser.id" | "testVonaUser.
|
|
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.
|
|
58
|
-
user: "testVonaUser.name" | "testVonaUser.id" | "testVonaUser.
|
|
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
package/src/.metadata/index.ts
CHANGED
|
@@ -1465,19 +1465,32 @@ declare module 'vona-module-test-vona' {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
/** serializerTransform: end */
|
|
1467
1467
|
/** summerCache: begin */
|
|
1468
|
+
export * from '../bean/summerCache.caching.ts';
|
|
1468
1469
|
export * from '../bean/summerCache.test.ts';
|
|
1469
1470
|
|
|
1470
1471
|
import { type IDecoratorSummerCacheOptions } from 'vona-module-a-summer';
|
|
1471
1472
|
declare module 'vona-module-a-summer' {
|
|
1472
1473
|
|
|
1473
1474
|
export interface ISummerCacheRecord {
|
|
1474
|
-
'test-vona:
|
|
1475
|
+
'test-vona:caching': IDecoratorSummerCacheOptions;
|
|
1476
|
+
'test-vona:test': IDecoratorSummerCacheOptions;
|
|
1475
1477
|
}
|
|
1476
1478
|
|
|
1477
1479
|
|
|
1478
1480
|
}
|
|
1479
1481
|
declare module 'vona-module-test-vona' {
|
|
1480
1482
|
|
|
1483
|
+
export interface SummerCacheCaching {
|
|
1484
|
+
/** @internal */
|
|
1485
|
+
get scope(): ScopeModuleTestVona;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
export interface SummerCacheCaching {
|
|
1489
|
+
get $beanFullName(): 'test-vona.summerCache.caching';
|
|
1490
|
+
get $onionName(): 'test-vona:caching';
|
|
1491
|
+
get $onionOptions(): IDecoratorSummerCacheOptions;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1481
1494
|
export interface SummerCacheTest {
|
|
1482
1495
|
/** @internal */
|
|
1483
1496
|
get scope(): ScopeModuleTestVona;
|
|
@@ -1491,9 +1504,11 @@ declare module 'vona-module-test-vona' {
|
|
|
1491
1504
|
}
|
|
1492
1505
|
/** summerCache: end */
|
|
1493
1506
|
/** summerCache: begin */
|
|
1507
|
+
import type { SummerCacheCaching } from '../bean/summerCache.caching.ts';
|
|
1494
1508
|
import type { SummerCacheTest } from '../bean/summerCache.test.ts';
|
|
1495
1509
|
export interface IModuleSummerCache {
|
|
1496
|
-
'
|
|
1510
|
+
'caching': SummerCacheCaching;
|
|
1511
|
+
'test': SummerCacheTest;
|
|
1497
1512
|
}
|
|
1498
1513
|
/** summerCache: end */
|
|
1499
1514
|
/** dto: begin */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ISummerCacheGet, TSummerCacheActionOptions } from 'vona-module-a-summer';
|
|
2
|
+
import { BeanSummerCacheBase, SummerCache } from 'vona-module-a-summer';
|
|
3
|
+
|
|
4
|
+
export interface TSummerCacheCachingKey { id: number }
|
|
5
|
+
export interface TSummerCacheCachingData { id: number; name: string }
|
|
6
|
+
|
|
7
|
+
@SummerCache({
|
|
8
|
+
mode: 'all',
|
|
9
|
+
mem: {
|
|
10
|
+
max: 2,
|
|
11
|
+
ttl: 1 * 1000,
|
|
12
|
+
},
|
|
13
|
+
redis: {
|
|
14
|
+
ttl: 3 * 1000,
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
export class SummerCacheCaching
|
|
18
|
+
extends BeanSummerCacheBase<TSummerCacheCachingKey, TSummerCacheCachingData>
|
|
19
|
+
implements ISummerCacheGet<TSummerCacheCachingKey, TSummerCacheCachingData> {
|
|
20
|
+
async getNative(
|
|
21
|
+
key?: TSummerCacheCachingKey,
|
|
22
|
+
_options?: TSummerCacheActionOptions<TSummerCacheCachingKey, TSummerCacheCachingData>,
|
|
23
|
+
): Promise<TSummerCacheCachingData | undefined> {
|
|
24
|
+
return {
|
|
25
|
+
id: key!.id,
|
|
26
|
+
name: `name_${key!.id}`,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -18,12 +18,12 @@ export class SummerCacheTest
|
|
|
18
18
|
extends BeanSummerCacheBase<TSummerCacheTestKey, TSummerCacheTestData>
|
|
19
19
|
implements ISummerCacheGet<TSummerCacheTestKey, TSummerCacheTestData> {
|
|
20
20
|
async getNative(
|
|
21
|
-
key
|
|
21
|
+
key?: TSummerCacheTestKey,
|
|
22
22
|
_options?: TSummerCacheActionOptions<TSummerCacheTestKey, TSummerCacheTestData>,
|
|
23
|
-
): Promise<TSummerCacheTestData |
|
|
23
|
+
): Promise<TSummerCacheTestData | undefined> {
|
|
24
24
|
return {
|
|
25
|
-
id: key
|
|
26
|
-
name: `name_${key
|
|
25
|
+
id: key!.id,
|
|
26
|
+
name: `name_${key!.id}`,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
}
|
package/src/controller/bean.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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';
|
package/src/controller/onion.ts
CHANGED
|
@@ -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-
|
|
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';
|
package/src/controller/order.ts
CHANGED
|
@@ -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
|
|
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-
|
|
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.
|
|
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.
|
|
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-
|
|
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-
|
|
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
|
|
package/src/controller/post.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IQueryParams } from 'vona-module-a-orm';
|
|
2
|
-
import type { IDecoratorControllerOptions
|
|
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-
|
|
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.
|
|
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.
|
|
53
|
+
async findMany(@Arg.filter(DtoPostQuery) params: IQueryParams<ModelPost>) {
|
|
58
54
|
return await this.scope.service.post.findMany(params);
|
|
59
55
|
}
|
|
60
56
|
}
|
package/src/controller/queue.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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';
|
package/src/controller/summer.ts
CHANGED
|
@@ -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-
|
|
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';
|
|
@@ -30,8 +30,8 @@ export class ControllerSummer extends BeanBase {
|
|
|
30
30
|
cacheOtherModule = this.bean.summer.cache(`${__ThisModule__}.summerCache.${name}`) as SummerCacheTest;
|
|
31
31
|
assert.equal(cache, cacheOtherModule);
|
|
32
32
|
|
|
33
|
-
let value: TSummerCacheTestData |
|
|
34
|
-
let values: Array<TSummerCacheTestData |
|
|
33
|
+
let value: TSummerCacheTestData | undefined;
|
|
34
|
+
let values: Array<TSummerCacheTestData | undefined>;
|
|
35
35
|
|
|
36
36
|
// get: peek
|
|
37
37
|
value = await cache.peek(key1);
|
package/src/controller/tail.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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
|
|
package/src/controller/upload.ts
CHANGED
|
@@ -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-
|
|
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';
|
package/src/dto/orderQuery.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
-
import { Api, v } from 'vona-module-a-
|
|
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(
|
|
20
|
-
|
|
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-
|
|
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';
|
package/src/dto/postQuery.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
-
import { Api, v } from 'vona-module-a-
|
|
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,19 +7,23 @@ import { EntityPost } from '../entity/post.ts';
|
|
|
7
7
|
export interface IDtoOptionsPostQuery extends IDecoratorDtoOptions {}
|
|
8
8
|
|
|
9
9
|
@Dto<IDtoOptionsPostQuery>({
|
|
10
|
-
openapi: {
|
|
10
|
+
openapi: { filter: { table: $tableName(EntityPost) } },
|
|
11
11
|
})
|
|
12
12
|
export class DtoPostQuery extends $Dto.queryPage(EntityPost, ['title']) {
|
|
13
13
|
@Api.field(v.optional())
|
|
14
14
|
title?: string;
|
|
15
15
|
|
|
16
|
-
@Api.field(
|
|
17
|
-
|
|
16
|
+
@Api.field(
|
|
17
|
+
v.filter({
|
|
18
18
|
table: 'testVonaUser',
|
|
19
19
|
joinOn: ['userId', 'testVonaUser.id'],
|
|
20
20
|
originalName: 'name',
|
|
21
21
|
op: '_eqI_',
|
|
22
|
-
},
|
|
23
|
-
|
|
22
|
+
}),
|
|
23
|
+
v.optional(),
|
|
24
|
+
)
|
|
24
25
|
userName?: string;
|
|
26
|
+
|
|
27
|
+
@Api.field(v.filterDateRange({ separator: ' - ' }), v.optional())
|
|
28
|
+
createdAt: string;
|
|
25
29
|
}
|
package/src/dto/profile.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
-
import { Api, v } from 'vona-module-a-
|
|
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 {}
|
package/src/dto/roleLazy.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
-
import { Api, v } from 'vona-module-a-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
package/src/dto/userLazy.ts
CHANGED
package/src/entity/category.ts
CHANGED
|
@@ -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-
|
|
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 {}
|
package/src/entity/order.ts
CHANGED
|
@@ -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-
|
|
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
|
|
package/src/entity/post.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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 {}
|
package/src/entity/product.ts
CHANGED
|
@@ -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-
|
|
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
|
|
package/src/entity/role.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
|
|
2
|
-
import { Api } from 'vona-module-a-
|
|
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 {}
|
package/src/entity/roleUser.ts
CHANGED
|
@@ -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-
|
|
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 {}
|
package/src/entity/test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
|
|
2
|
-
import { Api, v } from 'vona-module-a-
|
|
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
|
|
package/src/entity/user.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
|
|
2
|
-
import { Api, v } from 'vona-module-a-
|
|
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
|
|
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}_${
|
|
13
|
+
return `${defaultTable}_${DateTime.now().toFormat('yyyyMMdd')}`;
|
|
14
14
|
},
|
|
15
15
|
softDeletionPrune: {
|
|
16
16
|
handler: async (_ctx, _modelInstance: ModelTestDynamicTable) => {
|