vona-module-test-vona 5.0.58 → 5.0.60
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 +70 -0
- package/dist/index.js +2 -7
- package/package.json +1 -1
- package/src/.metadata/index.ts +70 -0
- package/src/controller/order.ts +1 -4
- package/src/service/post.ts +1 -1
- package/test/database/modelMagic.test.ts +37 -0
- package/test/database/modelRelationsMutate.test.ts +11 -11
|
@@ -448,6 +448,13 @@ declare module 'vona-module-test-vona' {
|
|
|
448
448
|
count<T extends IModelSelectCountParams<EntityCategory, ModelCategory, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
449
449
|
aggregate<T extends IModelSelectAggrParams<EntityCategory, ModelCategory, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
450
450
|
group<T extends IModelSelectGroupParams<EntityCategory, ModelCategory, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityCategory, T>[]>;
|
|
451
|
+
getById<T extends IModelGetOptions<EntityCategory, ModelCategory>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T> | undefined>;
|
|
452
|
+
updateById<T extends IModelUpdateOptions<EntityCategory, ModelCategory>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityCategory, ModelCategory, T>, options?: T): Promise<TypeModelMutateRelationData<EntityCategory, ModelCategory, T>>;
|
|
453
|
+
deleteById<T extends IModelDeleteOptions<EntityCategory, ModelCategory>>(id: TableIdentity, options?: T): Promise<void>;
|
|
454
|
+
getByName<T extends IModelGetOptions<EntityCategory, ModelCategory>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T> | undefined>;
|
|
455
|
+
getByNameEqI<T extends IModelGetOptions<EntityCategory, ModelCategory>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T> | undefined>;
|
|
456
|
+
selectByName<T extends IModelSelectParams<EntityCategory, ModelCategory, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T>[]>;
|
|
457
|
+
selectByNameEqI<T extends IModelSelectParams<EntityCategory, ModelCategory, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T>[]>;
|
|
451
458
|
}
|
|
452
459
|
interface ModelCategoryChain {
|
|
453
460
|
[SymbolKeyEntity]: EntityCategory;
|
|
@@ -468,6 +475,13 @@ declare module 'vona-module-test-vona' {
|
|
|
468
475
|
count<T extends IModelSelectCountParams<EntityCategory, ModelCategoryChain, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
469
476
|
aggregate<T extends IModelSelectAggrParams<EntityCategory, ModelCategoryChain, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
470
477
|
group<T extends IModelSelectGroupParams<EntityCategory, ModelCategoryChain, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityCategory, T>[]>;
|
|
478
|
+
getById<T extends IModelGetOptions<EntityCategory, ModelCategoryChain>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T> | undefined>;
|
|
479
|
+
updateById<T extends IModelUpdateOptions<EntityCategory, ModelCategoryChain>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityCategory, ModelCategoryChain, T>, options?: T): Promise<TypeModelMutateRelationData<EntityCategory, ModelCategoryChain, T>>;
|
|
480
|
+
deleteById<T extends IModelDeleteOptions<EntityCategory, ModelCategoryChain>>(id: TableIdentity, options?: T): Promise<void>;
|
|
481
|
+
getByName<T extends IModelGetOptions<EntityCategory, ModelCategoryChain>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T> | undefined>;
|
|
482
|
+
getByNameEqI<T extends IModelGetOptions<EntityCategory, ModelCategoryChain>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T> | undefined>;
|
|
483
|
+
selectByName<T extends IModelSelectParams<EntityCategory, ModelCategoryChain, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T>[]>;
|
|
484
|
+
selectByNameEqI<T extends IModelSelectParams<EntityCategory, ModelCategoryChain, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T>[]>;
|
|
471
485
|
}
|
|
472
486
|
interface ModelOrder {
|
|
473
487
|
[SymbolKeyEntity]: EntityOrder;
|
|
@@ -488,6 +502,9 @@ declare module 'vona-module-test-vona' {
|
|
|
488
502
|
count<T extends IModelSelectCountParams<EntityOrder, ModelOrder, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
489
503
|
aggregate<T extends IModelSelectAggrParams<EntityOrder, ModelOrder, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
490
504
|
group<T extends IModelSelectGroupParams<EntityOrder, ModelOrder, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityOrder, T>[]>;
|
|
505
|
+
getById<T extends IModelGetOptions<EntityOrder, ModelOrder>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityOrder, ModelOrder, T> | undefined>;
|
|
506
|
+
updateById<T extends IModelUpdateOptions<EntityOrder, ModelOrder>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityOrder, ModelOrder, T>, options?: T): Promise<TypeModelMutateRelationData<EntityOrder, ModelOrder, T>>;
|
|
507
|
+
deleteById<T extends IModelDeleteOptions<EntityOrder, ModelOrder>>(id: TableIdentity, options?: T): Promise<void>;
|
|
491
508
|
}
|
|
492
509
|
interface ModelOrderStats {
|
|
493
510
|
[SymbolKeyEntity]: EntityOrder;
|
|
@@ -508,6 +525,9 @@ declare module 'vona-module-test-vona' {
|
|
|
508
525
|
count<T extends IModelSelectCountParams<EntityOrder, ModelOrderStats, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
509
526
|
aggregate<T extends IModelSelectAggrParams<EntityOrder, ModelOrderStats, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
510
527
|
group<T extends IModelSelectGroupParams<EntityOrder, ModelOrderStats, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityOrder, T>[]>;
|
|
528
|
+
getById<T extends IModelGetOptions<EntityOrder, ModelOrderStats>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityOrder, ModelOrderStats, T> | undefined>;
|
|
529
|
+
updateById<T extends IModelUpdateOptions<EntityOrder, ModelOrderStats>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityOrder, ModelOrderStats, T>, options?: T): Promise<TypeModelMutateRelationData<EntityOrder, ModelOrderStats, T>>;
|
|
530
|
+
deleteById<T extends IModelDeleteOptions<EntityOrder, ModelOrderStats>>(id: TableIdentity, options?: T): Promise<void>;
|
|
511
531
|
}
|
|
512
532
|
interface ModelPost {
|
|
513
533
|
[SymbolKeyEntity]: EntityPost;
|
|
@@ -528,6 +548,9 @@ declare module 'vona-module-test-vona' {
|
|
|
528
548
|
count<T extends IModelSelectCountParams<EntityPost, ModelPost, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
529
549
|
aggregate<T extends IModelSelectAggrParams<EntityPost, ModelPost, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
530
550
|
group<T extends IModelSelectGroupParams<EntityPost, ModelPost, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityPost, T>[]>;
|
|
551
|
+
getById<T extends IModelGetOptions<EntityPost, ModelPost>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityPost, ModelPost, T> | undefined>;
|
|
552
|
+
updateById<T extends IModelUpdateOptions<EntityPost, ModelPost>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityPost, ModelPost, T>, options?: T): Promise<TypeModelMutateRelationData<EntityPost, ModelPost, T>>;
|
|
553
|
+
deleteById<T extends IModelDeleteOptions<EntityPost, ModelPost>>(id: TableIdentity, options?: T): Promise<void>;
|
|
531
554
|
}
|
|
532
555
|
interface ModelPostContent {
|
|
533
556
|
[SymbolKeyEntity]: EntityPostContent;
|
|
@@ -548,6 +571,9 @@ declare module 'vona-module-test-vona' {
|
|
|
548
571
|
count<T extends IModelSelectCountParams<EntityPostContent, ModelPostContent, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
549
572
|
aggregate<T extends IModelSelectAggrParams<EntityPostContent, ModelPostContent, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
550
573
|
group<T extends IModelSelectGroupParams<EntityPostContent, ModelPostContent, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityPostContent, T>[]>;
|
|
574
|
+
getById<T extends IModelGetOptions<EntityPostContent, ModelPostContent>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityPostContent, ModelPostContent, T> | undefined>;
|
|
575
|
+
updateById<T extends IModelUpdateOptions<EntityPostContent, ModelPostContent>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityPostContent, ModelPostContent, T>, options?: T): Promise<TypeModelMutateRelationData<EntityPostContent, ModelPostContent, T>>;
|
|
576
|
+
deleteById<T extends IModelDeleteOptions<EntityPostContent, ModelPostContent>>(id: TableIdentity, options?: T): Promise<void>;
|
|
551
577
|
}
|
|
552
578
|
interface ModelProduct {
|
|
553
579
|
[SymbolKeyEntity]: EntityProduct;
|
|
@@ -568,6 +594,13 @@ declare module 'vona-module-test-vona' {
|
|
|
568
594
|
count<T extends IModelSelectCountParams<EntityProduct, ModelProduct, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
569
595
|
aggregate<T extends IModelSelectAggrParams<EntityProduct, ModelProduct, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
570
596
|
group<T extends IModelSelectGroupParams<EntityProduct, ModelProduct, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityProduct, T>[]>;
|
|
597
|
+
getById<T extends IModelGetOptions<EntityProduct, ModelProduct>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T> | undefined>;
|
|
598
|
+
updateById<T extends IModelUpdateOptions<EntityProduct, ModelProduct>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityProduct, ModelProduct, T>, options?: T): Promise<TypeModelMutateRelationData<EntityProduct, ModelProduct, T>>;
|
|
599
|
+
deleteById<T extends IModelDeleteOptions<EntityProduct, ModelProduct>>(id: TableIdentity, options?: T): Promise<void>;
|
|
600
|
+
getByName<T extends IModelGetOptions<EntityProduct, ModelProduct>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T> | undefined>;
|
|
601
|
+
getByNameEqI<T extends IModelGetOptions<EntityProduct, ModelProduct>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T> | undefined>;
|
|
602
|
+
selectByName<T extends IModelSelectParams<EntityProduct, ModelProduct, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T>[]>;
|
|
603
|
+
selectByNameEqI<T extends IModelSelectParams<EntityProduct, ModelProduct, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T>[]>;
|
|
571
604
|
}
|
|
572
605
|
interface ModelRole {
|
|
573
606
|
[SymbolKeyEntity]: EntityRole;
|
|
@@ -588,6 +621,13 @@ declare module 'vona-module-test-vona' {
|
|
|
588
621
|
count<T extends IModelSelectCountParams<EntityRole, ModelRole, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
589
622
|
aggregate<T extends IModelSelectAggrParams<EntityRole, ModelRole, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
590
623
|
group<T extends IModelSelectGroupParams<EntityRole, ModelRole, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityRole, T>[]>;
|
|
624
|
+
getById<T extends IModelGetOptions<EntityRole, ModelRole>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRole, ModelRole, T> | undefined>;
|
|
625
|
+
updateById<T extends IModelUpdateOptions<EntityRole, ModelRole>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityRole, ModelRole, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRole, ModelRole, T>>;
|
|
626
|
+
deleteById<T extends IModelDeleteOptions<EntityRole, ModelRole>>(id: TableIdentity, options?: T): Promise<void>;
|
|
627
|
+
getByName<T extends IModelGetOptions<EntityRole, ModelRole>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityRole, ModelRole, T> | undefined>;
|
|
628
|
+
getByNameEqI<T extends IModelGetOptions<EntityRole, ModelRole>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityRole, ModelRole, T> | undefined>;
|
|
629
|
+
selectByName<T extends IModelSelectParams<EntityRole, ModelRole, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRole, ModelRole, T>[]>;
|
|
630
|
+
selectByNameEqI<T extends IModelSelectParams<EntityRole, ModelRole, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRole, ModelRole, T>[]>;
|
|
591
631
|
}
|
|
592
632
|
interface ModelRoleUser {
|
|
593
633
|
[SymbolKeyEntity]: EntityRoleUser;
|
|
@@ -608,6 +648,9 @@ declare module 'vona-module-test-vona' {
|
|
|
608
648
|
count<T extends IModelSelectCountParams<EntityRoleUser, ModelRoleUser, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
609
649
|
aggregate<T extends IModelSelectAggrParams<EntityRoleUser, ModelRoleUser, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
610
650
|
group<T extends IModelSelectGroupParams<EntityRoleUser, ModelRoleUser, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityRoleUser, T>[]>;
|
|
651
|
+
getById<T extends IModelGetOptions<EntityRoleUser, ModelRoleUser>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRoleUser, ModelRoleUser, T> | undefined>;
|
|
652
|
+
updateById<T extends IModelUpdateOptions<EntityRoleUser, ModelRoleUser>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityRoleUser, ModelRoleUser, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRoleUser, ModelRoleUser, T>>;
|
|
653
|
+
deleteById<T extends IModelDeleteOptions<EntityRoleUser, ModelRoleUser>>(id: TableIdentity, options?: T): Promise<void>;
|
|
611
654
|
}
|
|
612
655
|
interface ModelTest {
|
|
613
656
|
[SymbolKeyEntity]: EntityTest;
|
|
@@ -628,6 +671,9 @@ declare module 'vona-module-test-vona' {
|
|
|
628
671
|
count<T extends IModelSelectCountParams<EntityTest, ModelTest, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
629
672
|
aggregate<T extends IModelSelectAggrParams<EntityTest, ModelTest, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
630
673
|
group<T extends IModelSelectGroupParams<EntityTest, ModelTest, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityTest, T>[]>;
|
|
674
|
+
getById<T extends IModelGetOptions<EntityTest, ModelTest>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityTest, ModelTest, T> | undefined>;
|
|
675
|
+
updateById<T extends IModelUpdateOptions<EntityTest, ModelTest>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityTest, ModelTest, T>, options?: T): Promise<TypeModelMutateRelationData<EntityTest, ModelTest, T>>;
|
|
676
|
+
deleteById<T extends IModelDeleteOptions<EntityTest, ModelTest>>(id: TableIdentity, options?: T): Promise<void>;
|
|
631
677
|
}
|
|
632
678
|
interface ModelTestDynamicTable {
|
|
633
679
|
[SymbolKeyEntity]: EntityTest;
|
|
@@ -648,6 +694,9 @@ declare module 'vona-module-test-vona' {
|
|
|
648
694
|
count<T extends IModelSelectCountParams<EntityTest, ModelTestDynamicTable, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
649
695
|
aggregate<T extends IModelSelectAggrParams<EntityTest, ModelTestDynamicTable, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
650
696
|
group<T extends IModelSelectGroupParams<EntityTest, ModelTestDynamicTable, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityTest, T>[]>;
|
|
697
|
+
getById<T extends IModelGetOptions<EntityTest, ModelTestDynamicTable>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityTest, ModelTestDynamicTable, T> | undefined>;
|
|
698
|
+
updateById<T extends IModelUpdateOptions<EntityTest, ModelTestDynamicTable>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityTest, ModelTestDynamicTable, T>, options?: T): Promise<TypeModelMutateRelationData<EntityTest, ModelTestDynamicTable, T>>;
|
|
699
|
+
deleteById<T extends IModelDeleteOptions<EntityTest, ModelTestDynamicTable>>(id: TableIdentity, options?: T): Promise<void>;
|
|
651
700
|
}
|
|
652
701
|
interface ModelUser {
|
|
653
702
|
[SymbolKeyEntity]: EntityUser;
|
|
@@ -668,6 +717,13 @@ declare module 'vona-module-test-vona' {
|
|
|
668
717
|
count<T extends IModelSelectCountParams<EntityUser, ModelUser, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
669
718
|
aggregate<T extends IModelSelectAggrParams<EntityUser, ModelUser, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
670
719
|
group<T extends IModelSelectGroupParams<EntityUser, ModelUser, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityUser, T>[]>;
|
|
720
|
+
getById<T extends IModelGetOptions<EntityUser, ModelUser>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUser, T> | undefined>;
|
|
721
|
+
updateById<T extends IModelUpdateOptions<EntityUser, ModelUser>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityUser, ModelUser, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser, ModelUser, T>>;
|
|
722
|
+
deleteById<T extends IModelDeleteOptions<EntityUser, ModelUser>>(id: TableIdentity, options?: T): Promise<void>;
|
|
723
|
+
getByName<T extends IModelGetOptions<EntityUser, ModelUser>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUser, T> | undefined>;
|
|
724
|
+
getByNameEqI<T extends IModelGetOptions<EntityUser, ModelUser>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUser, T> | undefined>;
|
|
725
|
+
selectByName<T extends IModelSelectParams<EntityUser, ModelUser, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUser, T>[]>;
|
|
726
|
+
selectByNameEqI<T extends IModelSelectParams<EntityUser, ModelUser, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUser, T>[]>;
|
|
671
727
|
}
|
|
672
728
|
interface ModelUserStats {
|
|
673
729
|
[SymbolKeyEntity]: EntityUser;
|
|
@@ -688,6 +744,13 @@ declare module 'vona-module-test-vona' {
|
|
|
688
744
|
count<T extends IModelSelectCountParams<EntityUser, ModelUserStats, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
689
745
|
aggregate<T extends IModelSelectAggrParams<EntityUser, ModelUserStats, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
690
746
|
group<T extends IModelSelectGroupParams<EntityUser, ModelUserStats, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityUser, T>[]>;
|
|
747
|
+
getById<T extends IModelGetOptions<EntityUser, ModelUserStats>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T> | undefined>;
|
|
748
|
+
updateById<T extends IModelUpdateOptions<EntityUser, ModelUserStats>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityUser, ModelUserStats, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser, ModelUserStats, T>>;
|
|
749
|
+
deleteById<T extends IModelDeleteOptions<EntityUser, ModelUserStats>>(id: TableIdentity, options?: T): Promise<void>;
|
|
750
|
+
getByName<T extends IModelGetOptions<EntityUser, ModelUserStats>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T> | undefined>;
|
|
751
|
+
getByNameEqI<T extends IModelGetOptions<EntityUser, ModelUserStats>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T> | undefined>;
|
|
752
|
+
selectByName<T extends IModelSelectParams<EntityUser, ModelUserStats, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T>[]>;
|
|
753
|
+
selectByNameEqI<T extends IModelSelectParams<EntityUser, ModelUserStats, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T>[]>;
|
|
691
754
|
}
|
|
692
755
|
interface ModelUserStatsGroup {
|
|
693
756
|
[SymbolKeyEntity]: EntityUser;
|
|
@@ -708,6 +771,13 @@ declare module 'vona-module-test-vona' {
|
|
|
708
771
|
count<T extends IModelSelectCountParams<EntityUser, ModelUserStatsGroup, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
709
772
|
aggregate<T extends IModelSelectAggrParams<EntityUser, ModelUserStatsGroup, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
710
773
|
group<T extends IModelSelectGroupParams<EntityUser, ModelUserStatsGroup, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityUser, T>[]>;
|
|
774
|
+
getById<T extends IModelGetOptions<EntityUser, ModelUserStatsGroup>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T> | undefined>;
|
|
775
|
+
updateById<T extends IModelUpdateOptions<EntityUser, ModelUserStatsGroup>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityUser, ModelUserStatsGroup, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser, ModelUserStatsGroup, T>>;
|
|
776
|
+
deleteById<T extends IModelDeleteOptions<EntityUser, ModelUserStatsGroup>>(id: TableIdentity, options?: T): Promise<void>;
|
|
777
|
+
getByName<T extends IModelGetOptions<EntityUser, ModelUserStatsGroup>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T> | undefined>;
|
|
778
|
+
getByNameEqI<T extends IModelGetOptions<EntityUser, ModelUserStatsGroup>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T> | undefined>;
|
|
779
|
+
selectByName<T extends IModelSelectParams<EntityUser, ModelUserStatsGroup, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T>[]>;
|
|
780
|
+
selectByNameEqI<T extends IModelSelectParams<EntityUser, ModelUserStatsGroup, ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T>[]>;
|
|
711
781
|
}
|
|
712
782
|
}
|
|
713
783
|
declare module 'vona-module-a-orm' {
|
package/dist/index.js
CHANGED
|
@@ -1263,9 +1263,7 @@ let ServicePost = (_dec$X = Service(), _dec2$X = BeanInfo({
|
|
|
1263
1263
|
}, 'test-vona:user');
|
|
1264
1264
|
}
|
|
1265
1265
|
async get(id) {
|
|
1266
|
-
return await this.scope.model.post.
|
|
1267
|
-
id
|
|
1268
|
-
});
|
|
1266
|
+
return await this.scope.model.post.getById(id);
|
|
1269
1267
|
}
|
|
1270
1268
|
async mget(ids) {
|
|
1271
1269
|
return await this.scope.model.post.mget(ids);
|
|
@@ -2653,10 +2651,7 @@ let ControllerOrder = (_dec$a = Controller('order'), _dec2$a = BeanInfo({
|
|
|
2653
2651
|
return await this.scope.model.order.insert(data);
|
|
2654
2652
|
}
|
|
2655
2653
|
async update(id, data) {
|
|
2656
|
-
return await this.scope.model.order.
|
|
2657
|
-
...data,
|
|
2658
|
-
id
|
|
2659
|
-
});
|
|
2654
|
+
return await this.scope.model.order.updateById(id, data);
|
|
2660
2655
|
}
|
|
2661
2656
|
async findAll(params) {
|
|
2662
2657
|
return this.scope.model.order.select({
|
package/package.json
CHANGED
package/src/.metadata/index.ts
CHANGED
|
@@ -525,6 +525,13 @@ roles: IModelRelationBelongsToMany<'test-vona:roleUser', 'test-vona:role', false
|
|
|
525
525
|
count<T extends IModelSelectCountParams<EntityCategory,ModelCategory,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
526
526
|
aggregate<T extends IModelSelectAggrParams<EntityCategory,ModelCategory,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
527
527
|
group<T extends IModelSelectGroupParams<EntityCategory,ModelCategory,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityCategory, T>[]>;
|
|
528
|
+
getById<T extends IModelGetOptions<EntityCategory,ModelCategory>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T> | undefined>;
|
|
529
|
+
updateById<T extends IModelUpdateOptions<EntityCategory,ModelCategory>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityCategory,ModelCategory, T>, options?: T): Promise<TypeModelMutateRelationData<EntityCategory,ModelCategory, T>>;
|
|
530
|
+
deleteById<T extends IModelDeleteOptions<EntityCategory,ModelCategory>>(id: TableIdentity, options?: T): Promise<void>;
|
|
531
|
+
getByName<T extends IModelGetOptions<EntityCategory,ModelCategory>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T> | undefined>;
|
|
532
|
+
getByNameEqI<T extends IModelGetOptions<EntityCategory,ModelCategory>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T> | undefined>;
|
|
533
|
+
selectByName<T extends IModelSelectParams<EntityCategory,ModelCategory,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T>[]>;
|
|
534
|
+
selectByNameEqI<T extends IModelSelectParams<EntityCategory,ModelCategory,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategory, T>[]>;
|
|
528
535
|
}
|
|
529
536
|
export interface ModelCategoryChain {
|
|
530
537
|
[SymbolKeyEntity]: EntityCategory;
|
|
@@ -545,6 +552,13 @@ export interface ModelCategoryChain {
|
|
|
545
552
|
count<T extends IModelSelectCountParams<EntityCategory,ModelCategoryChain,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
546
553
|
aggregate<T extends IModelSelectAggrParams<EntityCategory,ModelCategoryChain,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
547
554
|
group<T extends IModelSelectGroupParams<EntityCategory,ModelCategoryChain,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityCategory, T>[]>;
|
|
555
|
+
getById<T extends IModelGetOptions<EntityCategory,ModelCategoryChain>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T> | undefined>;
|
|
556
|
+
updateById<T extends IModelUpdateOptions<EntityCategory,ModelCategoryChain>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityCategory,ModelCategoryChain, T>, options?: T): Promise<TypeModelMutateRelationData<EntityCategory,ModelCategoryChain, T>>;
|
|
557
|
+
deleteById<T extends IModelDeleteOptions<EntityCategory,ModelCategoryChain>>(id: TableIdentity, options?: T): Promise<void>;
|
|
558
|
+
getByName<T extends IModelGetOptions<EntityCategory,ModelCategoryChain>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T> | undefined>;
|
|
559
|
+
getByNameEqI<T extends IModelGetOptions<EntityCategory,ModelCategoryChain>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T> | undefined>;
|
|
560
|
+
selectByName<T extends IModelSelectParams<EntityCategory,ModelCategoryChain,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T>[]>;
|
|
561
|
+
selectByNameEqI<T extends IModelSelectParams<EntityCategory,ModelCategoryChain,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityCategory, ModelCategoryChain, T>[]>;
|
|
548
562
|
}
|
|
549
563
|
export interface ModelOrder {
|
|
550
564
|
[SymbolKeyEntity]: EntityOrder;
|
|
@@ -565,6 +579,9 @@ export interface ModelOrder {
|
|
|
565
579
|
count<T extends IModelSelectCountParams<EntityOrder,ModelOrder,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
566
580
|
aggregate<T extends IModelSelectAggrParams<EntityOrder,ModelOrder,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
567
581
|
group<T extends IModelSelectGroupParams<EntityOrder,ModelOrder,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityOrder, T>[]>;
|
|
582
|
+
getById<T extends IModelGetOptions<EntityOrder,ModelOrder>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityOrder, ModelOrder, T> | undefined>;
|
|
583
|
+
updateById<T extends IModelUpdateOptions<EntityOrder,ModelOrder>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityOrder,ModelOrder, T>, options?: T): Promise<TypeModelMutateRelationData<EntityOrder,ModelOrder, T>>;
|
|
584
|
+
deleteById<T extends IModelDeleteOptions<EntityOrder,ModelOrder>>(id: TableIdentity, options?: T): Promise<void>;
|
|
568
585
|
}
|
|
569
586
|
export interface ModelOrderStats {
|
|
570
587
|
[SymbolKeyEntity]: EntityOrder;
|
|
@@ -585,6 +602,9 @@ export interface ModelOrderStats {
|
|
|
585
602
|
count<T extends IModelSelectCountParams<EntityOrder,ModelOrderStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
586
603
|
aggregate<T extends IModelSelectAggrParams<EntityOrder,ModelOrderStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
587
604
|
group<T extends IModelSelectGroupParams<EntityOrder,ModelOrderStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityOrder, T>[]>;
|
|
605
|
+
getById<T extends IModelGetOptions<EntityOrder,ModelOrderStats>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityOrder, ModelOrderStats, T> | undefined>;
|
|
606
|
+
updateById<T extends IModelUpdateOptions<EntityOrder,ModelOrderStats>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityOrder,ModelOrderStats, T>, options?: T): Promise<TypeModelMutateRelationData<EntityOrder,ModelOrderStats, T>>;
|
|
607
|
+
deleteById<T extends IModelDeleteOptions<EntityOrder,ModelOrderStats>>(id: TableIdentity, options?: T): Promise<void>;
|
|
588
608
|
}
|
|
589
609
|
export interface ModelPost {
|
|
590
610
|
[SymbolKeyEntity]: EntityPost;
|
|
@@ -605,6 +625,9 @@ export interface ModelPost {
|
|
|
605
625
|
count<T extends IModelSelectCountParams<EntityPost,ModelPost,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
606
626
|
aggregate<T extends IModelSelectAggrParams<EntityPost,ModelPost,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
607
627
|
group<T extends IModelSelectGroupParams<EntityPost,ModelPost,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityPost, T>[]>;
|
|
628
|
+
getById<T extends IModelGetOptions<EntityPost,ModelPost>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityPost, ModelPost, T> | undefined>;
|
|
629
|
+
updateById<T extends IModelUpdateOptions<EntityPost,ModelPost>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityPost,ModelPost, T>, options?: T): Promise<TypeModelMutateRelationData<EntityPost,ModelPost, T>>;
|
|
630
|
+
deleteById<T extends IModelDeleteOptions<EntityPost,ModelPost>>(id: TableIdentity, options?: T): Promise<void>;
|
|
608
631
|
}
|
|
609
632
|
export interface ModelPostContent {
|
|
610
633
|
[SymbolKeyEntity]: EntityPostContent;
|
|
@@ -625,6 +648,9 @@ export interface ModelPostContent {
|
|
|
625
648
|
count<T extends IModelSelectCountParams<EntityPostContent,ModelPostContent,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
626
649
|
aggregate<T extends IModelSelectAggrParams<EntityPostContent,ModelPostContent,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
627
650
|
group<T extends IModelSelectGroupParams<EntityPostContent,ModelPostContent,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityPostContent, T>[]>;
|
|
651
|
+
getById<T extends IModelGetOptions<EntityPostContent,ModelPostContent>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityPostContent, ModelPostContent, T> | undefined>;
|
|
652
|
+
updateById<T extends IModelUpdateOptions<EntityPostContent,ModelPostContent>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityPostContent,ModelPostContent, T>, options?: T): Promise<TypeModelMutateRelationData<EntityPostContent,ModelPostContent, T>>;
|
|
653
|
+
deleteById<T extends IModelDeleteOptions<EntityPostContent,ModelPostContent>>(id: TableIdentity, options?: T): Promise<void>;
|
|
628
654
|
}
|
|
629
655
|
export interface ModelProduct {
|
|
630
656
|
[SymbolKeyEntity]: EntityProduct;
|
|
@@ -645,6 +671,13 @@ export interface ModelProduct {
|
|
|
645
671
|
count<T extends IModelSelectCountParams<EntityProduct,ModelProduct,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
646
672
|
aggregate<T extends IModelSelectAggrParams<EntityProduct,ModelProduct,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
647
673
|
group<T extends IModelSelectGroupParams<EntityProduct,ModelProduct,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityProduct, T>[]>;
|
|
674
|
+
getById<T extends IModelGetOptions<EntityProduct,ModelProduct>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T> | undefined>;
|
|
675
|
+
updateById<T extends IModelUpdateOptions<EntityProduct,ModelProduct>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityProduct,ModelProduct, T>, options?: T): Promise<TypeModelMutateRelationData<EntityProduct,ModelProduct, T>>;
|
|
676
|
+
deleteById<T extends IModelDeleteOptions<EntityProduct,ModelProduct>>(id: TableIdentity, options?: T): Promise<void>;
|
|
677
|
+
getByName<T extends IModelGetOptions<EntityProduct,ModelProduct>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T> | undefined>;
|
|
678
|
+
getByNameEqI<T extends IModelGetOptions<EntityProduct,ModelProduct>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T> | undefined>;
|
|
679
|
+
selectByName<T extends IModelSelectParams<EntityProduct,ModelProduct,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T>[]>;
|
|
680
|
+
selectByNameEqI<T extends IModelSelectParams<EntityProduct,ModelProduct,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityProduct, ModelProduct, T>[]>;
|
|
648
681
|
}
|
|
649
682
|
export interface ModelRole {
|
|
650
683
|
[SymbolKeyEntity]: EntityRole;
|
|
@@ -665,6 +698,13 @@ export interface ModelRole {
|
|
|
665
698
|
count<T extends IModelSelectCountParams<EntityRole,ModelRole,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
666
699
|
aggregate<T extends IModelSelectAggrParams<EntityRole,ModelRole,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
667
700
|
group<T extends IModelSelectGroupParams<EntityRole,ModelRole,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityRole, T>[]>;
|
|
701
|
+
getById<T extends IModelGetOptions<EntityRole,ModelRole>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRole, ModelRole, T> | undefined>;
|
|
702
|
+
updateById<T extends IModelUpdateOptions<EntityRole,ModelRole>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityRole,ModelRole, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRole,ModelRole, T>>;
|
|
703
|
+
deleteById<T extends IModelDeleteOptions<EntityRole,ModelRole>>(id: TableIdentity, options?: T): Promise<void>;
|
|
704
|
+
getByName<T extends IModelGetOptions<EntityRole,ModelRole>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityRole, ModelRole, T> | undefined>;
|
|
705
|
+
getByNameEqI<T extends IModelGetOptions<EntityRole,ModelRole>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityRole, ModelRole, T> | undefined>;
|
|
706
|
+
selectByName<T extends IModelSelectParams<EntityRole,ModelRole,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRole, ModelRole, T>[]>;
|
|
707
|
+
selectByNameEqI<T extends IModelSelectParams<EntityRole,ModelRole,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRole, ModelRole, T>[]>;
|
|
668
708
|
}
|
|
669
709
|
export interface ModelRoleUser {
|
|
670
710
|
[SymbolKeyEntity]: EntityRoleUser;
|
|
@@ -685,6 +725,9 @@ export interface ModelRoleUser {
|
|
|
685
725
|
count<T extends IModelSelectCountParams<EntityRoleUser,ModelRoleUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
686
726
|
aggregate<T extends IModelSelectAggrParams<EntityRoleUser,ModelRoleUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
687
727
|
group<T extends IModelSelectGroupParams<EntityRoleUser,ModelRoleUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityRoleUser, T>[]>;
|
|
728
|
+
getById<T extends IModelGetOptions<EntityRoleUser,ModelRoleUser>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRoleUser, ModelRoleUser, T> | undefined>;
|
|
729
|
+
updateById<T extends IModelUpdateOptions<EntityRoleUser,ModelRoleUser>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityRoleUser,ModelRoleUser, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRoleUser,ModelRoleUser, T>>;
|
|
730
|
+
deleteById<T extends IModelDeleteOptions<EntityRoleUser,ModelRoleUser>>(id: TableIdentity, options?: T): Promise<void>;
|
|
688
731
|
}
|
|
689
732
|
export interface ModelTest {
|
|
690
733
|
[SymbolKeyEntity]: EntityTest;
|
|
@@ -705,6 +748,9 @@ export interface ModelTest {
|
|
|
705
748
|
count<T extends IModelSelectCountParams<EntityTest,ModelTest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
706
749
|
aggregate<T extends IModelSelectAggrParams<EntityTest,ModelTest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
707
750
|
group<T extends IModelSelectGroupParams<EntityTest,ModelTest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityTest, T>[]>;
|
|
751
|
+
getById<T extends IModelGetOptions<EntityTest,ModelTest>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityTest, ModelTest, T> | undefined>;
|
|
752
|
+
updateById<T extends IModelUpdateOptions<EntityTest,ModelTest>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityTest,ModelTest, T>, options?: T): Promise<TypeModelMutateRelationData<EntityTest,ModelTest, T>>;
|
|
753
|
+
deleteById<T extends IModelDeleteOptions<EntityTest,ModelTest>>(id: TableIdentity, options?: T): Promise<void>;
|
|
708
754
|
}
|
|
709
755
|
export interface ModelTestDynamicTable {
|
|
710
756
|
[SymbolKeyEntity]: EntityTest;
|
|
@@ -725,6 +771,9 @@ export interface ModelTestDynamicTable {
|
|
|
725
771
|
count<T extends IModelSelectCountParams<EntityTest,ModelTestDynamicTable,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
726
772
|
aggregate<T extends IModelSelectAggrParams<EntityTest,ModelTestDynamicTable,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
727
773
|
group<T extends IModelSelectGroupParams<EntityTest,ModelTestDynamicTable,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityTest, T>[]>;
|
|
774
|
+
getById<T extends IModelGetOptions<EntityTest,ModelTestDynamicTable>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityTest, ModelTestDynamicTable, T> | undefined>;
|
|
775
|
+
updateById<T extends IModelUpdateOptions<EntityTest,ModelTestDynamicTable>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityTest,ModelTestDynamicTable, T>, options?: T): Promise<TypeModelMutateRelationData<EntityTest,ModelTestDynamicTable, T>>;
|
|
776
|
+
deleteById<T extends IModelDeleteOptions<EntityTest,ModelTestDynamicTable>>(id: TableIdentity, options?: T): Promise<void>;
|
|
728
777
|
}
|
|
729
778
|
export interface ModelUser {
|
|
730
779
|
[SymbolKeyEntity]: EntityUser;
|
|
@@ -745,6 +794,13 @@ export interface ModelUser {
|
|
|
745
794
|
count<T extends IModelSelectCountParams<EntityUser,ModelUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
746
795
|
aggregate<T extends IModelSelectAggrParams<EntityUser,ModelUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
747
796
|
group<T extends IModelSelectGroupParams<EntityUser,ModelUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityUser, T>[]>;
|
|
797
|
+
getById<T extends IModelGetOptions<EntityUser,ModelUser>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUser, T> | undefined>;
|
|
798
|
+
updateById<T extends IModelUpdateOptions<EntityUser,ModelUser>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityUser,ModelUser, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUser, T>>;
|
|
799
|
+
deleteById<T extends IModelDeleteOptions<EntityUser,ModelUser>>(id: TableIdentity, options?: T): Promise<void>;
|
|
800
|
+
getByName<T extends IModelGetOptions<EntityUser,ModelUser>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUser, T> | undefined>;
|
|
801
|
+
getByNameEqI<T extends IModelGetOptions<EntityUser,ModelUser>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUser, T> | undefined>;
|
|
802
|
+
selectByName<T extends IModelSelectParams<EntityUser,ModelUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUser, T>[]>;
|
|
803
|
+
selectByNameEqI<T extends IModelSelectParams<EntityUser,ModelUser,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUser, T>[]>;
|
|
748
804
|
}
|
|
749
805
|
export interface ModelUserStats {
|
|
750
806
|
[SymbolKeyEntity]: EntityUser;
|
|
@@ -765,6 +821,13 @@ export interface ModelUserStats {
|
|
|
765
821
|
count<T extends IModelSelectCountParams<EntityUser,ModelUserStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
766
822
|
aggregate<T extends IModelSelectAggrParams<EntityUser,ModelUserStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
767
823
|
group<T extends IModelSelectGroupParams<EntityUser,ModelUserStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityUser, T>[]>;
|
|
824
|
+
getById<T extends IModelGetOptions<EntityUser,ModelUserStats>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T> | undefined>;
|
|
825
|
+
updateById<T extends IModelUpdateOptions<EntityUser,ModelUserStats>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityUser,ModelUserStats, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUserStats, T>>;
|
|
826
|
+
deleteById<T extends IModelDeleteOptions<EntityUser,ModelUserStats>>(id: TableIdentity, options?: T): Promise<void>;
|
|
827
|
+
getByName<T extends IModelGetOptions<EntityUser,ModelUserStats>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T> | undefined>;
|
|
828
|
+
getByNameEqI<T extends IModelGetOptions<EntityUser,ModelUserStats>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T> | undefined>;
|
|
829
|
+
selectByName<T extends IModelSelectParams<EntityUser,ModelUserStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T>[]>;
|
|
830
|
+
selectByNameEqI<T extends IModelSelectParams<EntityUser,ModelUserStats,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStats, T>[]>;
|
|
768
831
|
}
|
|
769
832
|
export interface ModelUserStatsGroup {
|
|
770
833
|
[SymbolKeyEntity]: EntityUser;
|
|
@@ -785,6 +848,13 @@ export interface ModelUserStatsGroup {
|
|
|
785
848
|
count<T extends IModelSelectCountParams<EntityUser,ModelUserStatsGroup,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<BigNumber | undefined>;
|
|
786
849
|
aggregate<T extends IModelSelectAggrParams<EntityUser,ModelUserStatsGroup,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
787
850
|
group<T extends IModelSelectGroupParams<EntityUser,ModelUserStatsGroup,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityUser, T>[]>;
|
|
851
|
+
getById<T extends IModelGetOptions<EntityUser,ModelUserStatsGroup>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T> | undefined>;
|
|
852
|
+
updateById<T extends IModelUpdateOptions<EntityUser,ModelUserStatsGroup>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityUser,ModelUserStatsGroup, T>, options?: T): Promise<TypeModelMutateRelationData<EntityUser,ModelUserStatsGroup, T>>;
|
|
853
|
+
deleteById<T extends IModelDeleteOptions<EntityUser,ModelUserStatsGroup>>(id: TableIdentity, options?: T): Promise<void>;
|
|
854
|
+
getByName<T extends IModelGetOptions<EntityUser,ModelUserStatsGroup>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T> | undefined>;
|
|
855
|
+
getByNameEqI<T extends IModelGetOptions<EntityUser,ModelUserStatsGroup>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T> | undefined>;
|
|
856
|
+
selectByName<T extends IModelSelectParams<EntityUser,ModelUserStatsGroup,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T>[]>;
|
|
857
|
+
selectByNameEqI<T extends IModelSelectParams<EntityUser,ModelUserStatsGroup,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityUser, ModelUserStatsGroup, T>[]>;
|
|
788
858
|
}
|
|
789
859
|
}
|
|
790
860
|
declare module 'vona-module-a-orm' {
|
package/src/controller/order.ts
CHANGED
|
@@ -33,10 +33,7 @@ export class ControllerOrder extends BeanBase {
|
|
|
33
33
|
|
|
34
34
|
@Web.post('update/:id')
|
|
35
35
|
async update(@Arg.param('id') id: TableIdentity, @Arg.body() data: DtoOrderUpdate) {
|
|
36
|
-
return await this.scope.model.order.
|
|
37
|
-
...data,
|
|
38
|
-
id,
|
|
39
|
-
});
|
|
36
|
+
return await this.scope.model.order.updateById(id, data);
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
@Web.get('findAll')
|
package/src/service/post.ts
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import assert from 'node:assert';
|
|
2
|
+
import { describe, it } from 'node:test';
|
|
3
|
+
import { app } from 'vona-mock';
|
|
4
|
+
|
|
5
|
+
describe('modelMagic.test.ts', () => {
|
|
6
|
+
it('action:modelMagic', async () => {
|
|
7
|
+
await app.bean.executor.mockCtx(async () => {
|
|
8
|
+
const name = 'modelMagic:001';
|
|
9
|
+
// scope
|
|
10
|
+
const scopeTest = app.bean.scope('test-vona');
|
|
11
|
+
// create
|
|
12
|
+
const item = await scopeTest.model.user.insert({ name });
|
|
13
|
+
assert.equal(item.name, name);
|
|
14
|
+
// getById
|
|
15
|
+
let user = await scopeTest.model.user.getById(item.id);
|
|
16
|
+
assert.equal(user?.name, name);
|
|
17
|
+
// getByName
|
|
18
|
+
user = await scopeTest.model.user.getByName(name);
|
|
19
|
+
assert.equal(user?.name, name);
|
|
20
|
+
user = await scopeTest.model.user.getByNameEqI(name.toUpperCase());
|
|
21
|
+
assert.equal(user?.name, name);
|
|
22
|
+
const users = await scopeTest.model.user.selectByName(name);
|
|
23
|
+
assert.equal(users[0].name, name);
|
|
24
|
+
const users2 = await scopeTest.model.user.selectByName(name, {
|
|
25
|
+
where: { id: item.id },
|
|
26
|
+
columns: ['age', 'name'],
|
|
27
|
+
});
|
|
28
|
+
assert.equal(users2[0].name, name);
|
|
29
|
+
// updateById
|
|
30
|
+
await scopeTest.model.user.updateById(item.id, { age: 18 });
|
|
31
|
+
user = await scopeTest.model.user.getById(item.id);
|
|
32
|
+
assert.equal(user?.age, 18);
|
|
33
|
+
// deleteById
|
|
34
|
+
await scopeTest.model.user.deleteById(item.id);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -39,7 +39,7 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
39
39
|
});
|
|
40
40
|
assert.equal(users.length, 1);
|
|
41
41
|
// check
|
|
42
|
-
const post = await scopeTest.model.post.get({ id: users[0].posts[0].id }, { include: { postContent: true } });
|
|
42
|
+
const post = await scopeTest.model.post.get({ id: users[0].posts?.[0].id }, { include: { postContent: true } });
|
|
43
43
|
assert.equal(post?.postContent?.content, `${prefix}:postContentApple`);
|
|
44
44
|
// update: users
|
|
45
45
|
const _usersUpdate = await scopeTest.model.user.update({
|
|
@@ -47,7 +47,7 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
47
47
|
posts: [
|
|
48
48
|
// update
|
|
49
49
|
{
|
|
50
|
-
id: users[0].posts[0].id,
|
|
50
|
+
id: users[0].posts?.[0].id,
|
|
51
51
|
title: `${prefix}:postApple-update`,
|
|
52
52
|
// update
|
|
53
53
|
postContent: {
|
|
@@ -64,7 +64,7 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
64
64
|
],
|
|
65
65
|
roles: [
|
|
66
66
|
// delete
|
|
67
|
-
{ id: users[0].roles[0].id, deleted: true },
|
|
67
|
+
{ id: users[0].roles![0].id, deleted: true },
|
|
68
68
|
// insert
|
|
69
69
|
{ id: roles[1].id },
|
|
70
70
|
],
|
|
@@ -94,11 +94,11 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
94
94
|
posts: [
|
|
95
95
|
// update
|
|
96
96
|
{
|
|
97
|
-
id: users[0].posts[0].id,
|
|
97
|
+
id: users[0].posts![0].id,
|
|
98
98
|
title: `${prefix}:postApple-mutate`,
|
|
99
99
|
// update
|
|
100
100
|
postContent: {
|
|
101
|
-
id: users[0].posts[0].postContent?.id,
|
|
101
|
+
id: users[0].posts![0].postContent?.id,
|
|
102
102
|
content: `${prefix}:postContentApple-mutate`,
|
|
103
103
|
},
|
|
104
104
|
},
|
|
@@ -184,7 +184,7 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
184
184
|
});
|
|
185
185
|
assert.equal(users.length, 1);
|
|
186
186
|
// check
|
|
187
|
-
const post = await scopeTest.model.post.get({ id: users[0].posts[0].id }, { include: { postContent: true } });
|
|
187
|
+
const post = await scopeTest.model.post.get({ id: users[0].posts![0].id }, { include: { postContent: true } });
|
|
188
188
|
assert.equal(post?.postContent?.content, `${prefix}:postContentApple`);
|
|
189
189
|
// update: users
|
|
190
190
|
const _usersUpdate = await scopeTest.model.user.update({
|
|
@@ -192,7 +192,7 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
192
192
|
posts: [
|
|
193
193
|
// update
|
|
194
194
|
{
|
|
195
|
-
id: users[0].posts[0].id,
|
|
195
|
+
id: users[0].posts![0].id,
|
|
196
196
|
title: `${prefix}:postApple-update`,
|
|
197
197
|
// update
|
|
198
198
|
postContent: {
|
|
@@ -209,7 +209,7 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
209
209
|
],
|
|
210
210
|
roles: [
|
|
211
211
|
// delete
|
|
212
|
-
{ id: users[0].roles[0].id, deleted: true },
|
|
212
|
+
{ id: users[0].roles![0].id, deleted: true },
|
|
213
213
|
// insert
|
|
214
214
|
{ id: roles[1].id },
|
|
215
215
|
],
|
|
@@ -241,11 +241,11 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
241
241
|
posts: [
|
|
242
242
|
// update
|
|
243
243
|
{
|
|
244
|
-
id: users[0].posts[0].id,
|
|
244
|
+
id: users[0].posts![0].id,
|
|
245
245
|
title: `${prefix}:postApple-mutate`,
|
|
246
246
|
// update
|
|
247
247
|
postContent: {
|
|
248
|
-
id: users[0].posts[0].postContent?.id,
|
|
248
|
+
id: users[0].posts![0].postContent?.id,
|
|
249
249
|
content: `${prefix}:postContentApple-mutate`,
|
|
250
250
|
},
|
|
251
251
|
},
|
|
@@ -320,7 +320,7 @@ describe('modelRelationsMutate.test.ts', () => {
|
|
|
320
320
|
});
|
|
321
321
|
const categoryTreeCheck = await scopeTest.model.category.get({ id: categoryTree.id });
|
|
322
322
|
assert.equal(categoryTree.id, categoryTreeCheck?.id);
|
|
323
|
-
const children = categoryTree.children
|
|
323
|
+
const children = categoryTree.children!.sort((a, b) => Number(a.id) - Number(b.id));
|
|
324
324
|
const childrenCheck = categoryTreeCheck!.children.sort((a, b) => Number(a.id) - Number(b.id));
|
|
325
325
|
assert.equal(children[0].name, childrenCheck[0].name);
|
|
326
326
|
assert.equal(children[0].name, `${prefix}:1-1`);
|