vona-module-test-vona 5.0.44 → 5.0.46
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 +44 -1
- package/dist/bean/meta.version.d.ts +3 -2
- package/dist/controller/post.d.ts +66 -0
- package/dist/dto/postQuery.d.ts +9 -0
- package/dist/dto/postQueryRes.d.ts +12 -0
- package/dist/index.js +494 -385
- package/dist/service/post.d.ts +58 -0
- package/dist/service/user.d.ts +13 -0
- package/package.json +1 -1
- package/src/.metadata/index.ts +52 -1
- package/src/bean/meta.version.ts +17 -2
- package/src/controller/captcha.ts +1 -2
- package/src/controller/dtoTest.ts +2 -2
- package/src/controller/onion.ts +2 -2
- package/src/controller/passport.ts +2 -2
- package/src/controller/performAction.ts +2 -2
- package/src/controller/post.ts +31 -0
- package/src/controller/transaction.ts +2 -2
- package/src/controller/upload.ts +2 -2
- package/src/dto/postQuery.ts +23 -0
- package/src/dto/postQueryRes.ts +9 -0
- package/src/service/post.ts +10 -0
- package/src/service/user.ts +24 -0
- package/test/captcha.test.ts +1 -1
- package/test/database/dtoAggregate.test.ts +28 -30
- package/test/database/dtoGet.test.ts +37 -41
- package/test/database/dtoGroup.test.ts +28 -30
- package/test/database/dtoMutate.test.ts +40 -42
- package/test/database/dtoQuery.test.ts +55 -0
- package/test/database/modelRelationsJoins.test.ts +11 -0
- package/test/utils/performAction.test.ts +1 -1
package/dist/service/post.d.ts
CHANGED
|
@@ -1,7 +1,65 @@
|
|
|
1
1
|
import type { TableIdentity } from 'table-identity';
|
|
2
|
+
import type { IQueryParams } from 'vona-module-a-orm';
|
|
2
3
|
import { BeanBase } from 'vona';
|
|
3
4
|
import { ModelPost } from '../model/post.ts';
|
|
4
5
|
export declare class ServicePost extends BeanBase {
|
|
6
|
+
findMany(params: IQueryParams<ModelPost>): Promise<import("vona-module-a-orm").TypeModelSelectAndCount<import("vona-module-test-vona").EntityPost, ModelPost, {
|
|
7
|
+
include: {
|
|
8
|
+
postContent: true;
|
|
9
|
+
};
|
|
10
|
+
with?: Record<string, unknown>;
|
|
11
|
+
distinct?: boolean | keyof import("vona-module-test-vona").EntityPost | (keyof import("vona-module-test-vona").EntityPost)[] | undefined;
|
|
12
|
+
columns?: "iid" | "id" | "createdAt" | "updatedAt" | "deleted" | "*" | "title" | "userId" | "stars" | ("iid" | "id" | "createdAt" | "updatedAt" | "deleted" | "*" | "title" | "userId" | "stars")[] | undefined;
|
|
13
|
+
where?: import("vona-module-a-orm").TypeModelWhereInner<{
|
|
14
|
+
"testVonaPostContent.content": string;
|
|
15
|
+
"testVonaPostContent.postId": TableIdentity;
|
|
16
|
+
"testVonaPostContent.id": TableIdentity;
|
|
17
|
+
"testVonaPostContent.createdAt": Date;
|
|
18
|
+
"testVonaPostContent.updatedAt": Date;
|
|
19
|
+
"testVonaPostContent.deleted": boolean;
|
|
20
|
+
"testVonaPostContent.iid": number;
|
|
21
|
+
} & {
|
|
22
|
+
"testVonaPost.title": string;
|
|
23
|
+
"testVonaPost.userId": TableIdentity;
|
|
24
|
+
"testVonaPost.stars"?: number | undefined;
|
|
25
|
+
"testVonaPost.id": TableIdentity;
|
|
26
|
+
"testVonaPost.createdAt": Date;
|
|
27
|
+
"testVonaPost.updatedAt": Date;
|
|
28
|
+
"testVonaPost.deleted": boolean;
|
|
29
|
+
"testVonaPost.iid": number;
|
|
30
|
+
} & import("vona-module-test-vona").EntityPost> | import("vona-module-a-orm").TypeModelWhereInner<{
|
|
31
|
+
"testVonaUser.name": string;
|
|
32
|
+
"testVonaUser.age"?: number | undefined;
|
|
33
|
+
"testVonaUser.scores"?: number | undefined;
|
|
34
|
+
"testVonaUser.id": TableIdentity;
|
|
35
|
+
"testVonaUser.createdAt": Date;
|
|
36
|
+
"testVonaUser.updatedAt": Date;
|
|
37
|
+
"testVonaUser.deleted": boolean;
|
|
38
|
+
"testVonaUser.iid": number;
|
|
39
|
+
} & {
|
|
40
|
+
"testVonaPost.title": string;
|
|
41
|
+
"testVonaPost.userId": TableIdentity;
|
|
42
|
+
"testVonaPost.stars"?: number | undefined;
|
|
43
|
+
"testVonaPost.id": TableIdentity;
|
|
44
|
+
"testVonaPost.createdAt": Date;
|
|
45
|
+
"testVonaPost.updatedAt": Date;
|
|
46
|
+
"testVonaPost.deleted": boolean;
|
|
47
|
+
"testVonaPost.iid": number;
|
|
48
|
+
} & import("vona-module-test-vona").EntityPost> | undefined;
|
|
49
|
+
joins?: import("vona-module-a-orm").IModelSelectParamsJoin<import("vona-module-test-vona").EntityPost, import("vona").TypeRecordValues<{
|
|
50
|
+
postContent: "testVonaPostContent";
|
|
51
|
+
user: "testVonaUser";
|
|
52
|
+
}>, import("vona-module-a-orm").TypeEntityTableColumnNamesOfModelSelf<ModelPost> | import("vona").TypeRecordValues<{
|
|
53
|
+
postContent: "testVonaPostContent.content" | "testVonaPostContent.postId" | "testVonaPostContent.id" | "testVonaPostContent.createdAt" | "testVonaPostContent.updatedAt" | "testVonaPostContent.deleted" | "testVonaPostContent.iid";
|
|
54
|
+
user: "testVonaUser.name" | "testVonaUser.age" | "testVonaUser.scores" | "testVonaUser.id" | "testVonaUser.createdAt" | "testVonaUser.updatedAt" | "testVonaUser.deleted" | "testVonaUser.iid";
|
|
55
|
+
}>>[] | undefined;
|
|
56
|
+
orders?: import("vona-module-a-orm").IModelSelectParamsOrder<import("vona-module-a-orm").TypeEntityTableColumnNamesOfModelSelf<ModelPost> | import("vona").TypeRecordValues<{
|
|
57
|
+
postContent: "testVonaPostContent.content" | "testVonaPostContent.postId" | "testVonaPostContent.id" | "testVonaPostContent.createdAt" | "testVonaPostContent.updatedAt" | "testVonaPostContent.deleted" | "testVonaPostContent.iid";
|
|
58
|
+
user: "testVonaUser.name" | "testVonaUser.age" | "testVonaUser.scores" | "testVonaUser.id" | "testVonaUser.createdAt" | "testVonaUser.updatedAt" | "testVonaUser.deleted" | "testVonaUser.iid";
|
|
59
|
+
}>>[] | undefined;
|
|
60
|
+
limit?: number;
|
|
61
|
+
offset?: number;
|
|
62
|
+
}, undefined, undefined, undefined, 50>>;
|
|
5
63
|
group(): Promise<({
|
|
6
64
|
userId: TableIdentity;
|
|
7
65
|
} & import("vona-module-a-orm").TypeRecordAggrsValuesToObject<import("vona-module-a-orm").TypeRecordAggrsValues<{
|
package/dist/service/user.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { BeanBase } from 'vona';
|
|
2
2
|
export declare class ServiceUser extends BeanBase {
|
|
3
|
+
userStats(): Promise<import("vona-module-a-orm").TypeRecordAggrsValuesToObject<import("vona-module-a-orm").TypeRecordAggrsValues<{
|
|
4
|
+
count: "count_all";
|
|
5
|
+
sum: "sum_scores";
|
|
6
|
+
max: "max_age";
|
|
7
|
+
min: "min_age";
|
|
8
|
+
}>>>;
|
|
9
|
+
findUsers(): Promise<import("vona-module-a-orm").TypeModelRelationResult_Normal<import("vona-module-test-vona").EntityUser, import("vona-module-test-vona").ModelUser, {
|
|
10
|
+
where: {
|
|
11
|
+
age: {
|
|
12
|
+
_gt_: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}, undefined, 50>[]>;
|
|
3
16
|
relationBelongsToMany(): Promise<void>;
|
|
4
17
|
}
|
package/package.json
CHANGED
package/src/.metadata/index.ts
CHANGED
|
@@ -445,7 +445,7 @@ declare module 'vona' {
|
|
|
445
445
|
}
|
|
446
446
|
/** model: end */
|
|
447
447
|
/** model: begin */
|
|
448
|
-
import type { IModelGetOptions, IModelMethodOptions, IModelSelectParams, TableIdentity, TypeModelRelationResult, TypeModelWhere, IModelInsertOptions, TypeModelMutateRelationData, IModelDeleteOptions, IModelUpdateOptions, IModelMutateOptions, IModelSelectCountParams, IModelSelectAggrParams, TypeModelAggrRelationResult, IModelSelectGroupParams, TypeModelGroupRelationResult } from 'vona-module-a-orm';
|
|
448
|
+
import type { IModelGetOptions, IModelMethodOptions, IModelSelectParams, TableIdentity, TypeModelSelectAndCount, TypeModelRelationResult, TypeModelWhere, IModelInsertOptions, TypeModelMutateRelationData, IModelDeleteOptions, IModelUpdateOptions, IModelMutateOptions, IModelSelectCountParams, IModelSelectAggrParams, TypeModelAggrRelationResult, IModelSelectGroupParams, TypeModelGroupRelationResult } from 'vona-module-a-orm';
|
|
449
449
|
import { SymbolKeyEntity, SymbolKeyEntityMeta, SymbolKeyModelOptions } from 'vona-module-a-orm';
|
|
450
450
|
declare module 'vona-module-test-vona' {
|
|
451
451
|
export interface IModelOptionsCategory {
|
|
@@ -510,6 +510,7 @@ roles: IModelRelationBelongsToMany<'test-vona:roleUser', 'test-vona:role', false
|
|
|
510
510
|
[SymbolKeyModelOptions]: IModelOptionsCategory;
|
|
511
511
|
get<T extends IModelGetOptions<EntityCategory,ModelCategory>>(where: TypeModelWhere<EntityCategory>, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T> | undefined>;
|
|
512
512
|
mget<T extends IModelGetOptions<EntityCategory,ModelCategory>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T>[]>;
|
|
513
|
+
selectAndCount<T extends IModelSelectParams<EntityCategory,ModelCategory,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityCategory, ModelCategory, T>>;
|
|
513
514
|
select<T extends IModelSelectParams<EntityCategory,ModelCategory,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T>[]>;
|
|
514
515
|
insert<T extends IModelInsertOptions<EntityCategory,ModelCategory>>(data?: TypeModelMutateRelationData<EntityCategory,ModelCategory, T>, options?: T): Promise<TypeModelMutateRelationData<EntityCategory,ModelCategory, T, true>>;
|
|
515
516
|
insertBulk<T extends IModelInsertOptions<EntityCategory,ModelCategory>>(items: TypeModelMutateRelationData<EntityCategory,ModelCategory, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityCategory,ModelCategory, T, true>[]>;
|
|
@@ -529,6 +530,7 @@ export interface ModelCategoryChain {
|
|
|
529
530
|
[SymbolKeyModelOptions]: IModelOptionsCategoryChain;
|
|
530
531
|
get<T extends IModelGetOptions<EntityCategory,ModelCategoryChain>>(where: TypeModelWhere<EntityCategory>, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T> | undefined>;
|
|
531
532
|
mget<T extends IModelGetOptions<EntityCategory,ModelCategoryChain>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T>[]>;
|
|
533
|
+
selectAndCount<T extends IModelSelectParams<EntityCategory,ModelCategoryChain,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityCategory, ModelCategoryChain, T>>;
|
|
532
534
|
select<T extends IModelSelectParams<EntityCategory,ModelCategoryChain,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T>[]>;
|
|
533
535
|
insert<T extends IModelInsertOptions<EntityCategory,ModelCategoryChain>>(data?: TypeModelMutateRelationData<EntityCategory,ModelCategoryChain, T>, options?: T): Promise<TypeModelMutateRelationData<EntityCategory,ModelCategoryChain, T, true>>;
|
|
534
536
|
insertBulk<T extends IModelInsertOptions<EntityCategory,ModelCategoryChain>>(items: TypeModelMutateRelationData<EntityCategory,ModelCategoryChain, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityCategory,ModelCategoryChain, T, true>[]>;
|
|
@@ -548,6 +550,7 @@ export interface ModelOrder {
|
|
|
548
550
|
[SymbolKeyModelOptions]: IModelOptionsOrder;
|
|
549
551
|
get<T extends IModelGetOptions<EntityOrder,ModelOrder>>(where: TypeModelWhere<EntityOrder>, options?: T): Promise<TypeModelRelationResult<EntityOrder, ModelOrder, T> | undefined>;
|
|
550
552
|
mget<T extends IModelGetOptions<EntityOrder,ModelOrder>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityOrder, ModelOrder, T>[]>;
|
|
553
|
+
selectAndCount<T extends IModelSelectParams<EntityOrder,ModelOrder,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityOrder, ModelOrder, T>>;
|
|
551
554
|
select<T extends IModelSelectParams<EntityOrder,ModelOrder,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityOrder, ModelOrder, T>[]>;
|
|
552
555
|
insert<T extends IModelInsertOptions<EntityOrder,ModelOrder>>(data?: TypeModelMutateRelationData<EntityOrder,ModelOrder, T>, options?: T): Promise<TypeModelMutateRelationData<EntityOrder,ModelOrder, T, true>>;
|
|
553
556
|
insertBulk<T extends IModelInsertOptions<EntityOrder,ModelOrder>>(items: TypeModelMutateRelationData<EntityOrder,ModelOrder, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityOrder,ModelOrder, T, true>[]>;
|
|
@@ -567,6 +570,7 @@ export interface ModelOrderStats {
|
|
|
567
570
|
[SymbolKeyModelOptions]: IModelOptionsOrderStats;
|
|
568
571
|
get<T extends IModelGetOptions<EntityOrder,ModelOrderStats>>(where: TypeModelWhere<EntityOrder>, options?: T): Promise<TypeModelRelationResult<EntityOrder, ModelOrderStats, T> | undefined>;
|
|
569
572
|
mget<T extends IModelGetOptions<EntityOrder,ModelOrderStats>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityOrder, ModelOrderStats, T>[]>;
|
|
573
|
+
selectAndCount<T extends IModelSelectParams<EntityOrder,ModelOrderStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityOrder, ModelOrderStats, T>>;
|
|
570
574
|
select<T extends IModelSelectParams<EntityOrder,ModelOrderStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityOrder, ModelOrderStats, T>[]>;
|
|
571
575
|
insert<T extends IModelInsertOptions<EntityOrder,ModelOrderStats>>(data?: TypeModelMutateRelationData<EntityOrder,ModelOrderStats, T>, options?: T): Promise<TypeModelMutateRelationData<EntityOrder,ModelOrderStats, T, true>>;
|
|
572
576
|
insertBulk<T extends IModelInsertOptions<EntityOrder,ModelOrderStats>>(items: TypeModelMutateRelationData<EntityOrder,ModelOrderStats, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityOrder,ModelOrderStats, T, true>[]>;
|
|
@@ -586,6 +590,7 @@ export interface ModelPost {
|
|
|
586
590
|
[SymbolKeyModelOptions]: IModelOptionsPost;
|
|
587
591
|
get<T extends IModelGetOptions<EntityPost,ModelPost>>(where: TypeModelWhere<EntityPost>, options?: T): Promise<TypeModelRelationResult<EntityPost, ModelPost, T> | undefined>;
|
|
588
592
|
mget<T extends IModelGetOptions<EntityPost,ModelPost>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityPost, ModelPost, T>[]>;
|
|
593
|
+
selectAndCount<T extends IModelSelectParams<EntityPost,ModelPost,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityPost, ModelPost, T>>;
|
|
589
594
|
select<T extends IModelSelectParams<EntityPost,ModelPost,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityPost, ModelPost, T>[]>;
|
|
590
595
|
insert<T extends IModelInsertOptions<EntityPost,ModelPost>>(data?: TypeModelMutateRelationData<EntityPost,ModelPost, T>, options?: T): Promise<TypeModelMutateRelationData<EntityPost,ModelPost, T, true>>;
|
|
591
596
|
insertBulk<T extends IModelInsertOptions<EntityPost,ModelPost>>(items: TypeModelMutateRelationData<EntityPost,ModelPost, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityPost,ModelPost, T, true>[]>;
|
|
@@ -605,6 +610,7 @@ export interface ModelPostContent {
|
|
|
605
610
|
[SymbolKeyModelOptions]: IModelOptionsPostContent;
|
|
606
611
|
get<T extends IModelGetOptions<EntityPostContent,ModelPostContent>>(where: TypeModelWhere<EntityPostContent>, options?: T): Promise<TypeModelRelationResult<EntityPostContent, ModelPostContent, T> | undefined>;
|
|
607
612
|
mget<T extends IModelGetOptions<EntityPostContent,ModelPostContent>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityPostContent, ModelPostContent, T>[]>;
|
|
613
|
+
selectAndCount<T extends IModelSelectParams<EntityPostContent,ModelPostContent,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityPostContent, ModelPostContent, T>>;
|
|
608
614
|
select<T extends IModelSelectParams<EntityPostContent,ModelPostContent,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityPostContent, ModelPostContent, T>[]>;
|
|
609
615
|
insert<T extends IModelInsertOptions<EntityPostContent,ModelPostContent>>(data?: TypeModelMutateRelationData<EntityPostContent,ModelPostContent, T>, options?: T): Promise<TypeModelMutateRelationData<EntityPostContent,ModelPostContent, T, true>>;
|
|
610
616
|
insertBulk<T extends IModelInsertOptions<EntityPostContent,ModelPostContent>>(items: TypeModelMutateRelationData<EntityPostContent,ModelPostContent, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityPostContent,ModelPostContent, T, true>[]>;
|
|
@@ -624,6 +630,7 @@ export interface ModelProduct {
|
|
|
624
630
|
[SymbolKeyModelOptions]: IModelOptionsProduct;
|
|
625
631
|
get<T extends IModelGetOptions<EntityProduct,ModelProduct>>(where: TypeModelWhere<EntityProduct>, options?: T): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T> | undefined>;
|
|
626
632
|
mget<T extends IModelGetOptions<EntityProduct,ModelProduct>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T>[]>;
|
|
633
|
+
selectAndCount<T extends IModelSelectParams<EntityProduct,ModelProduct,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityProduct, ModelProduct, T>>;
|
|
627
634
|
select<T extends IModelSelectParams<EntityProduct,ModelProduct,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T>[]>;
|
|
628
635
|
insert<T extends IModelInsertOptions<EntityProduct,ModelProduct>>(data?: TypeModelMutateRelationData<EntityProduct,ModelProduct, T>, options?: T): Promise<TypeModelMutateRelationData<EntityProduct,ModelProduct, T, true>>;
|
|
629
636
|
insertBulk<T extends IModelInsertOptions<EntityProduct,ModelProduct>>(items: TypeModelMutateRelationData<EntityProduct,ModelProduct, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityProduct,ModelProduct, T, true>[]>;
|
|
@@ -643,6 +650,7 @@ export interface ModelRole {
|
|
|
643
650
|
[SymbolKeyModelOptions]: IModelOptionsRole;
|
|
644
651
|
get<T extends IModelGetOptions<EntityRole,ModelRole>>(where: TypeModelWhere<EntityRole>, options?: T): Promise<TypeModelRelationResult<EntityRole, ModelRole, T> | undefined>;
|
|
645
652
|
mget<T extends IModelGetOptions<EntityRole,ModelRole>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityRole, ModelRole, T>[]>;
|
|
653
|
+
selectAndCount<T extends IModelSelectParams<EntityRole,ModelRole,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityRole, ModelRole, T>>;
|
|
646
654
|
select<T extends IModelSelectParams<EntityRole,ModelRole,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRole, ModelRole, T>[]>;
|
|
647
655
|
insert<T extends IModelInsertOptions<EntityRole,ModelRole>>(data?: TypeModelMutateRelationData<EntityRole,ModelRole, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRole,ModelRole, T, true>>;
|
|
648
656
|
insertBulk<T extends IModelInsertOptions<EntityRole,ModelRole>>(items: TypeModelMutateRelationData<EntityRole,ModelRole, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRole,ModelRole, T, true>[]>;
|
|
@@ -662,6 +670,7 @@ export interface ModelRoleUser {
|
|
|
662
670
|
[SymbolKeyModelOptions]: IModelOptionsRoleUser;
|
|
663
671
|
get<T extends IModelGetOptions<EntityRoleUser,ModelRoleUser>>(where: TypeModelWhere<EntityRoleUser>, options?: T): Promise<TypeModelRelationResult<EntityRoleUser, ModelRoleUser, T> | undefined>;
|
|
664
672
|
mget<T extends IModelGetOptions<EntityRoleUser,ModelRoleUser>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityRoleUser, ModelRoleUser, T>[]>;
|
|
673
|
+
selectAndCount<T extends IModelSelectParams<EntityRoleUser,ModelRoleUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityRoleUser, ModelRoleUser, T>>;
|
|
665
674
|
select<T extends IModelSelectParams<EntityRoleUser,ModelRoleUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRoleUser, ModelRoleUser, T>[]>;
|
|
666
675
|
insert<T extends IModelInsertOptions<EntityRoleUser,ModelRoleUser>>(data?: TypeModelMutateRelationData<EntityRoleUser,ModelRoleUser, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRoleUser,ModelRoleUser, T, true>>;
|
|
667
676
|
insertBulk<T extends IModelInsertOptions<EntityRoleUser,ModelRoleUser>>(items: TypeModelMutateRelationData<EntityRoleUser,ModelRoleUser, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRoleUser,ModelRoleUser, T, true>[]>;
|
|
@@ -681,6 +690,7 @@ export interface ModelTest {
|
|
|
681
690
|
[SymbolKeyModelOptions]: IModelOptionsTest;
|
|
682
691
|
get<T extends IModelGetOptions<EntityTest,ModelTest>>(where: TypeModelWhere<EntityTest>, options?: T): Promise<TypeModelRelationResult<EntityTest, ModelTest, T> | undefined>;
|
|
683
692
|
mget<T extends IModelGetOptions<EntityTest,ModelTest>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityTest, ModelTest, T>[]>;
|
|
693
|
+
selectAndCount<T extends IModelSelectParams<EntityTest,ModelTest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityTest, ModelTest, T>>;
|
|
684
694
|
select<T extends IModelSelectParams<EntityTest,ModelTest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityTest, ModelTest, T>[]>;
|
|
685
695
|
insert<T extends IModelInsertOptions<EntityTest,ModelTest>>(data?: TypeModelMutateRelationData<EntityTest,ModelTest, T>, options?: T): Promise<TypeModelMutateRelationData<EntityTest,ModelTest, T, true>>;
|
|
686
696
|
insertBulk<T extends IModelInsertOptions<EntityTest,ModelTest>>(items: TypeModelMutateRelationData<EntityTest,ModelTest, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityTest,ModelTest, T, true>[]>;
|
|
@@ -700,6 +710,7 @@ export interface ModelTestDynamicTable {
|
|
|
700
710
|
[SymbolKeyModelOptions]: IModelOptionsTestDynamicTable;
|
|
701
711
|
get<T extends IModelGetOptions<EntityTest,ModelTestDynamicTable>>(where: TypeModelWhere<EntityTest>, options?: T): Promise<TypeModelRelationResult<EntityTest, ModelTestDynamicTable, T> | undefined>;
|
|
702
712
|
mget<T extends IModelGetOptions<EntityTest,ModelTestDynamicTable>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityTest, ModelTestDynamicTable, T>[]>;
|
|
713
|
+
selectAndCount<T extends IModelSelectParams<EntityTest,ModelTestDynamicTable,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityTest, ModelTestDynamicTable, T>>;
|
|
703
714
|
select<T extends IModelSelectParams<EntityTest,ModelTestDynamicTable,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityTest, ModelTestDynamicTable, T>[]>;
|
|
704
715
|
insert<T extends IModelInsertOptions<EntityTest,ModelTestDynamicTable>>(data?: TypeModelMutateRelationData<EntityTest,ModelTestDynamicTable, T>, options?: T): Promise<TypeModelMutateRelationData<EntityTest,ModelTestDynamicTable, T, true>>;
|
|
705
716
|
insertBulk<T extends IModelInsertOptions<EntityTest,ModelTestDynamicTable>>(items: TypeModelMutateRelationData<EntityTest,ModelTestDynamicTable, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityTest,ModelTestDynamicTable, T, true>[]>;
|
|
@@ -719,6 +730,7 @@ export interface ModelUser {
|
|
|
719
730
|
[SymbolKeyModelOptions]: IModelOptionsUser;
|
|
720
731
|
get<T extends IModelGetOptions<EntityUser,ModelUser>>(where: TypeModelWhere<EntityUser>, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUser, T> | undefined>;
|
|
721
732
|
mget<T extends IModelGetOptions<EntityUser,ModelUser>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUser, T>[]>;
|
|
733
|
+
selectAndCount<T extends IModelSelectParams<EntityUser,ModelUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityUser, ModelUser, T>>;
|
|
722
734
|
select<T extends IModelSelectParams<EntityUser,ModelUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUser, T>[]>;
|
|
723
735
|
insert<T extends IModelInsertOptions<EntityUser,ModelUser>>(data?: TypeModelMutateRelationData<EntityUser,ModelUser, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUser, T, true>>;
|
|
724
736
|
insertBulk<T extends IModelInsertOptions<EntityUser,ModelUser>>(items: TypeModelMutateRelationData<EntityUser,ModelUser, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUser, T, true>[]>;
|
|
@@ -738,6 +750,7 @@ export interface ModelUserStats {
|
|
|
738
750
|
[SymbolKeyModelOptions]: IModelOptionsUserStats;
|
|
739
751
|
get<T extends IModelGetOptions<EntityUser,ModelUserStats>>(where: TypeModelWhere<EntityUser>, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T> | undefined>;
|
|
740
752
|
mget<T extends IModelGetOptions<EntityUser,ModelUserStats>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T>[]>;
|
|
753
|
+
selectAndCount<T extends IModelSelectParams<EntityUser,ModelUserStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityUser, ModelUserStats, T>>;
|
|
741
754
|
select<T extends IModelSelectParams<EntityUser,ModelUserStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T>[]>;
|
|
742
755
|
insert<T extends IModelInsertOptions<EntityUser,ModelUserStats>>(data?: TypeModelMutateRelationData<EntityUser,ModelUserStats, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUserStats, T, true>>;
|
|
743
756
|
insertBulk<T extends IModelInsertOptions<EntityUser,ModelUserStats>>(items: TypeModelMutateRelationData<EntityUser,ModelUserStats, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUserStats, T, true>[]>;
|
|
@@ -757,6 +770,7 @@ export interface ModelUserStatsGroup {
|
|
|
757
770
|
[SymbolKeyModelOptions]: IModelOptionsUserStatsGroup;
|
|
758
771
|
get<T extends IModelGetOptions<EntityUser,ModelUserStatsGroup>>(where: TypeModelWhere<EntityUser>, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T> | undefined>;
|
|
759
772
|
mget<T extends IModelGetOptions<EntityUser,ModelUserStatsGroup>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T>[]>;
|
|
773
|
+
selectAndCount<T extends IModelSelectParams<EntityUser,ModelUserStatsGroup,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityUser, ModelUserStatsGroup, T>>;
|
|
760
774
|
select<T extends IModelSelectParams<EntityUser,ModelUserStatsGroup,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T>[]>;
|
|
761
775
|
insert<T extends IModelInsertOptions<EntityUser,ModelUserStatsGroup>>(data?: TypeModelMutateRelationData<EntityUser,ModelUserStatsGroup, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUserStatsGroup, T, true>>;
|
|
762
776
|
insertBulk<T extends IModelInsertOptions<EntityUser,ModelUserStatsGroup>>(items: TypeModelMutateRelationData<EntityUser,ModelUserStatsGroup, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUserStatsGroup, T, true>[]>;
|
|
@@ -1318,6 +1332,8 @@ export * from '../dto/orderCreate.ts';
|
|
|
1318
1332
|
export * from '../dto/orderResult.ts';
|
|
1319
1333
|
export * from '../dto/orderUpdate.ts';
|
|
1320
1334
|
export * from '../dto/postCreate.ts';
|
|
1335
|
+
export * from '../dto/postQuery.ts';
|
|
1336
|
+
export * from '../dto/postQueryRes.ts';
|
|
1321
1337
|
export * from '../dto/profile.ts';
|
|
1322
1338
|
export * from '../dto/roleLazy.ts';
|
|
1323
1339
|
export * from '../dto/signin.ts';
|
|
@@ -1330,6 +1346,8 @@ import type { IDtoOptionsOrderCreate } from '../dto/orderCreate.ts';
|
|
|
1330
1346
|
import type { IDtoOptionsOrderResult } from '../dto/orderResult.ts';
|
|
1331
1347
|
import type { IDtoOptionsOrderUpdate } from '../dto/orderUpdate.ts';
|
|
1332
1348
|
import type { IDtoOptionsPostCreate } from '../dto/postCreate.ts';
|
|
1349
|
+
import type { IDtoOptionsPostQuery } from '../dto/postQuery.ts';
|
|
1350
|
+
import type { IDtoOptionsPostQueryRes } from '../dto/postQueryRes.ts';
|
|
1333
1351
|
import type { IDtoOptionsProfile } from '../dto/profile.ts';
|
|
1334
1352
|
import type { IDtoOptionsRoleLazy } from '../dto/roleLazy.ts';
|
|
1335
1353
|
import type { IDtoOptionsSignin } from '../dto/signin.ts';
|
|
@@ -1346,6 +1364,8 @@ declare module 'vona-module-a-web' {
|
|
|
1346
1364
|
'test-vona:orderResult': IDtoOptionsOrderResult;
|
|
1347
1365
|
'test-vona:orderUpdate': IDtoOptionsOrderUpdate;
|
|
1348
1366
|
'test-vona:postCreate': IDtoOptionsPostCreate;
|
|
1367
|
+
'test-vona:postQuery': IDtoOptionsPostQuery;
|
|
1368
|
+
'test-vona:postQueryRes': IDtoOptionsPostQueryRes;
|
|
1349
1369
|
'test-vona:profile': IDtoOptionsProfile;
|
|
1350
1370
|
'test-vona:roleLazy': IDtoOptionsRoleLazy;
|
|
1351
1371
|
'test-vona:signin': IDtoOptionsSignin;
|
|
@@ -1367,6 +1387,8 @@ import type { DtoOrderCreate } from '../dto/orderCreate.ts';
|
|
|
1367
1387
|
import type { DtoOrderResult } from '../dto/orderResult.ts';
|
|
1368
1388
|
import type { DtoOrderUpdate } from '../dto/orderUpdate.ts';
|
|
1369
1389
|
import type { DtoPostCreate } from '../dto/postCreate.ts';
|
|
1390
|
+
import type { DtoPostQuery } from '../dto/postQuery.ts';
|
|
1391
|
+
import type { DtoPostQueryRes } from '../dto/postQueryRes.ts';
|
|
1370
1392
|
import type { DtoProfile } from '../dto/profile.ts';
|
|
1371
1393
|
import type { DtoRoleLazy } from '../dto/roleLazy.ts';
|
|
1372
1394
|
import type { DtoSignin } from '../dto/signin.ts';
|
|
@@ -1396,6 +1418,14 @@ declare module 'vona-module-test-vona' {
|
|
|
1396
1418
|
fields?: TypeEntityOptionsFields<DtoPostCreate, IDtoOptionsPostCreate[TypeSymbolKeyFieldsMore]>;
|
|
1397
1419
|
}
|
|
1398
1420
|
|
|
1421
|
+
export interface IDtoOptionsPostQuery {
|
|
1422
|
+
fields?: TypeEntityOptionsFields<DtoPostQuery, IDtoOptionsPostQuery[TypeSymbolKeyFieldsMore]>;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
export interface IDtoOptionsPostQueryRes {
|
|
1426
|
+
fields?: TypeEntityOptionsFields<DtoPostQueryRes, IDtoOptionsPostQueryRes[TypeSymbolKeyFieldsMore]>;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1399
1429
|
export interface IDtoOptionsProfile {
|
|
1400
1430
|
fields?: TypeEntityOptionsFields<DtoProfile, IDtoOptionsProfile[TypeSymbolKeyFieldsMore]>;
|
|
1401
1431
|
}
|
|
@@ -1435,6 +1465,7 @@ export * from '../controller/guardPassport.ts';
|
|
|
1435
1465
|
export * from '../controller/onion.ts';
|
|
1436
1466
|
export * from '../controller/passport.ts';
|
|
1437
1467
|
export * from '../controller/performAction.ts';
|
|
1468
|
+
export * from '../controller/post.ts';
|
|
1438
1469
|
export * from '../controller/queue.ts';
|
|
1439
1470
|
export * from '../controller/summer.ts';
|
|
1440
1471
|
export * from '../controller/tail.ts';
|
|
@@ -1449,6 +1480,7 @@ import type { IControllerOptionsGuardPassport } from '../controller/guardPasspor
|
|
|
1449
1480
|
import type { IControllerOptionsOnion } from '../controller/onion.ts';
|
|
1450
1481
|
import type { IControllerOptionsPassport } from '../controller/passport.ts';
|
|
1451
1482
|
import type { IControllerOptionsPerformAction } from '../controller/performAction.ts';
|
|
1483
|
+
import type { IControllerOptionsPost } from '../controller/post.ts';
|
|
1452
1484
|
import type { IControllerOptionsQueue } from '../controller/queue.ts';
|
|
1453
1485
|
import type { IControllerOptionsSummer } from '../controller/summer.ts';
|
|
1454
1486
|
import type { IControllerOptionsTail } from '../controller/tail.ts';
|
|
@@ -1467,6 +1499,7 @@ declare module 'vona-module-a-web' {
|
|
|
1467
1499
|
'test-vona:onion': IControllerOptionsOnion;
|
|
1468
1500
|
'test-vona:passport': IControllerOptionsPassport;
|
|
1469
1501
|
'test-vona:performAction': IControllerOptionsPerformAction;
|
|
1502
|
+
'test-vona:post': IControllerOptionsPost;
|
|
1470
1503
|
'test-vona:queue': IControllerOptionsQueue;
|
|
1471
1504
|
'test-vona:summer': IControllerOptionsSummer;
|
|
1472
1505
|
'test-vona:tail': IControllerOptionsTail;
|
|
@@ -1568,6 +1601,16 @@ declare module 'vona-module-test-vona' {
|
|
|
1568
1601
|
get $onionName(): 'test-vona:performAction';
|
|
1569
1602
|
}
|
|
1570
1603
|
|
|
1604
|
+
export interface ControllerPost {
|
|
1605
|
+
/** @internal */
|
|
1606
|
+
get scope(): ScopeModuleTestVona;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
export interface ControllerPost {
|
|
1610
|
+
get $beanFullName(): 'test-vona.controller.post';
|
|
1611
|
+
get $onionName(): 'test-vona:post';
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1571
1614
|
export interface ControllerQueue {
|
|
1572
1615
|
/** @internal */
|
|
1573
1616
|
get scope(): ScopeModuleTestVona;
|
|
@@ -1639,6 +1682,8 @@ import type { ControllerPassport } from '../controller/passport.ts';
|
|
|
1639
1682
|
// @ts-ignore ignore
|
|
1640
1683
|
import type { ControllerPerformAction } from '../controller/performAction.ts';
|
|
1641
1684
|
// @ts-ignore ignore
|
|
1685
|
+
import type { ControllerPost } from '../controller/post.ts';
|
|
1686
|
+
// @ts-ignore ignore
|
|
1642
1687
|
import type { ControllerQueue } from '../controller/queue.ts';
|
|
1643
1688
|
// @ts-ignore ignore
|
|
1644
1689
|
import type { ControllerSummer } from '../controller/summer.ts';
|
|
@@ -1686,6 +1731,10 @@ declare module 'vona-module-test-vona' {
|
|
|
1686
1731
|
actions?: TypeControllerOptionsActions<ControllerPerformAction>;
|
|
1687
1732
|
}
|
|
1688
1733
|
|
|
1734
|
+
export interface IControllerOptionsPost {
|
|
1735
|
+
actions?: TypeControllerOptionsActions<ControllerPost>;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1689
1738
|
export interface IControllerOptionsQueue {
|
|
1690
1739
|
actions?: TypeControllerOptionsActions<ControllerQueue>;
|
|
1691
1740
|
}
|
|
@@ -1726,6 +1775,8 @@ declare module 'vona-module-a-web' {
|
|
|
1726
1775
|
'/test/vona/onion/echo6': undefined;
|
|
1727
1776
|
'/test/vona/passport/echo/:name': undefined;
|
|
1728
1777
|
'/test/vona/passport/isAuthenticated': undefined;
|
|
1778
|
+
'/test/vona/post/findManyEcho': undefined;
|
|
1779
|
+
'/test/vona/post/findMany': undefined;
|
|
1729
1780
|
}
|
|
1730
1781
|
export interface IApiPathPostRecord{
|
|
1731
1782
|
'/test/vona/cacheMem': undefined;
|
package/src/bean/meta.version.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IMetaVersionUpdate, IMetaVersionUpdateOptions } from 'vona-module-a-version';
|
|
1
|
+
import type { IMetaVersionTest, IMetaVersionTestOptions, IMetaVersionUpdate, IMetaVersionUpdateOptions } from 'vona-module-a-version';
|
|
2
2
|
import { BeanBase } from 'vona';
|
|
3
3
|
import { Meta } from 'vona-module-a-meta';
|
|
4
4
|
|
|
5
5
|
@Meta()
|
|
6
|
-
export class MetaVersion extends BeanBase implements IMetaVersionUpdate {
|
|
6
|
+
export class MetaVersion extends BeanBase implements IMetaVersionUpdate, IMetaVersionTest {
|
|
7
7
|
async update(options: IMetaVersionUpdateOptions) {
|
|
8
8
|
if (options.version === 1) {
|
|
9
9
|
// testVonaTest
|
|
@@ -78,4 +78,19 @@ export class MetaVersion extends BeanBase implements IMetaVersionUpdate {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
async test(_options: IMetaVersionTestOptions) {
|
|
83
|
+
// user: Kevin
|
|
84
|
+
const userKevin = await this.scope.model.user.insert({ name: 'Kevin' });
|
|
85
|
+
// create: post/postContent
|
|
86
|
+
await this.scope.model.post.insert({
|
|
87
|
+
title: 'test:post001',
|
|
88
|
+
postContent: {
|
|
89
|
+
content: 'this is a test post!',
|
|
90
|
+
},
|
|
91
|
+
userId: userKevin?.id,
|
|
92
|
+
}, {
|
|
93
|
+
include: { postContent: true },
|
|
94
|
+
});
|
|
95
|
+
}
|
|
81
96
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
2
2
|
import { BeanBase } from 'vona';
|
|
3
3
|
import { Aspect } from 'vona-module-a-aspect';
|
|
4
|
-
import { Arg } from 'vona-module-a-openapi';
|
|
5
4
|
import { Passport } from 'vona-module-a-user';
|
|
6
|
-
import { Controller, Web } from 'vona-module-a-web';
|
|
5
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
7
6
|
import { DtoSignin } from '../dto/signin.ts';
|
|
8
7
|
|
|
9
8
|
export interface IControllerOptionsCaptcha extends IDecoratorControllerOptions {}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
2
2
|
import { BeanBase } from 'vona';
|
|
3
|
-
import { Api,
|
|
3
|
+
import { Api, v } from 'vona-module-a-openapi';
|
|
4
4
|
import { $Dto, TableIdentity } from 'vona-module-a-orm';
|
|
5
|
-
import { Controller, Web } from 'vona-module-a-web';
|
|
5
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
6
6
|
import { DtoCategoryTree } from '../dto/categoryTree.ts';
|
|
7
7
|
import { DtoUserCreate } from '../dto/userCreate.ts';
|
|
8
8
|
import { DtoUserLazy } from '../dto/userLazy.ts';
|
package/src/controller/onion.ts
CHANGED
|
@@ -2,10 +2,10 @@ 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,
|
|
5
|
+
import { Api, v } from 'vona-module-a-openapi';
|
|
6
6
|
import { Database } from 'vona-module-a-orm';
|
|
7
7
|
import { Passport } from 'vona-module-a-user';
|
|
8
|
-
import { Controller, Web } from 'vona-module-a-web';
|
|
8
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { $locale } from '../.metadata/index.ts';
|
|
11
11
|
import { DtoUser } from '../dto/user.ts';
|
|
@@ -4,9 +4,9 @@ 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,
|
|
7
|
+
import { Api, v } from 'vona-module-a-openapi';
|
|
8
8
|
import { $getUserName, Passport } from 'vona-module-a-user';
|
|
9
|
-
import { Controller, Web } from 'vona-module-a-web';
|
|
9
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
10
10
|
|
|
11
11
|
export interface IControllerOptionsPassport extends IDecoratorControllerOptions {}
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
2
2
|
import { BeanBase } from 'vona';
|
|
3
|
-
import { Api
|
|
3
|
+
import { Api } from 'vona-module-a-openapi';
|
|
4
4
|
import { Passport } from 'vona-module-a-user';
|
|
5
|
-
import { Controller, Web } from 'vona-module-a-web';
|
|
5
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
6
6
|
|
|
7
7
|
export interface IControllerOptionsPerformAction extends IDecoratorControllerOptions {}
|
|
8
8
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IQueryParams } from 'vona-module-a-orm';
|
|
2
|
+
import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
3
|
+
import type { ModelPost } from '../model/post.ts';
|
|
4
|
+
import { BeanBase } from 'vona';
|
|
5
|
+
import { Api } from 'vona-module-a-openapi';
|
|
6
|
+
import { Passport } from 'vona-module-a-user';
|
|
7
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
8
|
+
import { DtoPostQuery } from '../dto/postQuery.ts';
|
|
9
|
+
import { DtoPostQueryRes } from '../dto/postQueryRes.ts';
|
|
10
|
+
|
|
11
|
+
export interface IControllerOptionsPost extends IDecoratorControllerOptions {}
|
|
12
|
+
|
|
13
|
+
@Controller<IControllerOptionsPost>('post', { meta: { mode: ['test', 'dev'] } })
|
|
14
|
+
export class ControllerPost extends BeanBase {
|
|
15
|
+
@Web.get('findManyEcho')
|
|
16
|
+
@Api.body(DtoPostQueryRes)
|
|
17
|
+
@Passport.public()
|
|
18
|
+
findManyEcho(@Arg.queryPro(DtoPostQuery) params: IQueryParams<ModelPost>) {
|
|
19
|
+
return params;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Web.get('findMany')
|
|
23
|
+
@Api.body(DtoPostQueryRes)
|
|
24
|
+
@Passport.public()
|
|
25
|
+
async findMany(@Arg.queryPro(DtoPostQuery) params: IQueryParams<ModelPost>) {
|
|
26
|
+
if (!params.orders) {
|
|
27
|
+
params.orders = [['testVonaPost.createdAt', 'desc']];
|
|
28
|
+
}
|
|
29
|
+
return await this.scope.service.post.findMany(params);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
2
2
|
import { BeanBase } from 'vona';
|
|
3
|
-
import { Api
|
|
3
|
+
import { Api } from 'vona-module-a-openapi';
|
|
4
4
|
import { Database } from 'vona-module-a-orm';
|
|
5
5
|
import { Passport } from 'vona-module-a-user';
|
|
6
|
-
import { Controller, Web } from 'vona-module-a-web';
|
|
6
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
7
7
|
|
|
8
8
|
const tableNameFail = '__tempTransactionFail';
|
|
9
9
|
const tableNameSuccess = '__tempTransactionSuccess';
|
package/src/controller/upload.ts
CHANGED
|
@@ -3,10 +3,10 @@ import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
|
3
3
|
import assert from 'node:assert';
|
|
4
4
|
import { BeanBase } from 'vona';
|
|
5
5
|
import { Aspect } from 'vona-module-a-aspect';
|
|
6
|
-
import { Api,
|
|
6
|
+
import { Api, v } from 'vona-module-a-openapi';
|
|
7
7
|
import { SymbolUploadValue } from 'vona-module-a-upload';
|
|
8
8
|
import { Passport } from 'vona-module-a-user';
|
|
9
|
-
import { Controller, Web } from 'vona-module-a-web';
|
|
9
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
|
|
12
12
|
export interface IControllerOptionsUpload extends IDecoratorControllerOptions {}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
import { Api, v } from 'vona-module-a-openapi';
|
|
3
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
4
|
+
import { Dto } from 'vona-module-a-web';
|
|
5
|
+
import { EntityPost } from '../entity/post.ts';
|
|
6
|
+
|
|
7
|
+
export interface IDtoOptionsPostQuery extends IDecoratorDtoOptions {}
|
|
8
|
+
|
|
9
|
+
@Dto<IDtoOptionsPostQuery>()
|
|
10
|
+
export class DtoPostQuery extends $Dto.queryPage(EntityPost, ['title']) {
|
|
11
|
+
@Api.field(v.optional(), v.openapi({
|
|
12
|
+
query: {
|
|
13
|
+
join: {
|
|
14
|
+
type: 'innerJoin',
|
|
15
|
+
table: 'testVonaUser',
|
|
16
|
+
on: ['userId', 'testVonaUser.id'],
|
|
17
|
+
},
|
|
18
|
+
originalName: 'name',
|
|
19
|
+
op: '_eq_',
|
|
20
|
+
},
|
|
21
|
+
}))
|
|
22
|
+
userName?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
3
|
+
import { Dto } from 'vona-module-a-web';
|
|
4
|
+
import { ModelPost } from '../model/post.ts';
|
|
5
|
+
|
|
6
|
+
export interface IDtoOptionsPostQueryRes extends IDecoratorDtoOptions {}
|
|
7
|
+
|
|
8
|
+
@Dto<IDtoOptionsPostQueryRes>()
|
|
9
|
+
export class DtoPostQueryRes extends $Dto.selectAndCount(() => ModelPost, { include: { postContent: true } }) {}
|
package/src/service/post.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TableIdentity } from 'table-identity';
|
|
2
|
+
import type { IQueryParams } from 'vona-module-a-orm';
|
|
2
3
|
import { BeanBase } from 'vona';
|
|
3
4
|
import { Service } from 'vona-module-a-bean';
|
|
4
5
|
import { $relationDynamic, Database } from 'vona-module-a-orm';
|
|
@@ -7,6 +8,15 @@ import { ModelPostContent } from '../model/postContent.ts';
|
|
|
7
8
|
|
|
8
9
|
@Service()
|
|
9
10
|
export class ServicePost extends BeanBase {
|
|
11
|
+
async findMany(params: IQueryParams<ModelPost>) {
|
|
12
|
+
return await this.scope.model.post.selectAndCount(
|
|
13
|
+
{
|
|
14
|
+
...params,
|
|
15
|
+
include: { postContent: true },
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
async group() {
|
|
11
21
|
const result = await this.scope.model.post.group({
|
|
12
22
|
groups: 'userId',
|
package/src/service/user.ts
CHANGED
|
@@ -6,6 +6,30 @@ import { ModelRoleUser } from '../model/roleUser.ts';
|
|
|
6
6
|
|
|
7
7
|
@Service()
|
|
8
8
|
export class ServiceUser extends BeanBase {
|
|
9
|
+
async userStats() {
|
|
10
|
+
const userStats = await this.scope.model.user.aggregate({
|
|
11
|
+
aggrs: {
|
|
12
|
+
count: '*',
|
|
13
|
+
sum: 'scores',
|
|
14
|
+
max: 'age',
|
|
15
|
+
min: 'age',
|
|
16
|
+
},
|
|
17
|
+
where: {
|
|
18
|
+
scores: { _gt_: 30 },
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
return userStats;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async findUsers() {
|
|
25
|
+
const users = await this.scope.model.user.select({
|
|
26
|
+
where: {
|
|
27
|
+
age: { _gt_: 18 },
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return users;
|
|
31
|
+
}
|
|
32
|
+
|
|
9
33
|
async relationBelongsToMany() {
|
|
10
34
|
// insert: roles
|
|
11
35
|
const roles = await this.scope.model.role.insertBulk([
|
package/test/captcha.test.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { app } from 'vona-mock';
|
|
|
7
7
|
describe('captcha.test.ts', () => {
|
|
8
8
|
// scene/provider
|
|
9
9
|
const sceneName = 'a-captchasimple:simple';
|
|
10
|
-
const providerName = 'a-captchasimple:
|
|
10
|
+
const providerName = 'a-captchasimple:imageText';
|
|
11
11
|
it('action:captcha', async () => {
|
|
12
12
|
await app.bean.executor.mockCtx(async () => {
|
|
13
13
|
// create
|