oak-domain 2.6.2 → 2.6.4
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/lib/base-app-domain/Modi/Storage.js +2 -4
- package/lib/base-app-domain/User/Storage.js +2 -4
- package/lib/compiler/schemalBuilder.js +92 -89
- package/lib/entities/Modi.js +1 -0
- package/lib/entities/ModiEntity.js +1 -0
- package/lib/entities/Oper.js +1 -0
- package/lib/entities/OperEntity.js +1 -0
- package/lib/entities/User.js +1 -0
- package/lib/entities/UserEntityGrant.js +1 -0
- package/lib/store/AsyncRowStore.js +40 -42
- package/lib/store/CascadeStore.js +39 -33
- package/lib/store/checker.d.ts +2 -2
- package/lib/store/checker.js +516 -136
- package/lib/store/filter.js +7 -15
- package/lib/types/Auth.d.ts +10 -10
- package/lib/types/DataType.d.ts +4 -1
- package/lib/types/DataType.js +2 -1
- package/lib/types/Exception.d.ts +6 -0
- package/lib/types/Exception.js +25 -1
- package/lib/types/Locale.d.ts +1 -0
- package/lib/types/Polyfill.d.ts +1 -0
- package/lib/types/Storage.d.ts +1 -0
- package/lib/types/Style.d.ts +11 -0
- package/lib/types/Style.js +2 -0
- package/lib/types/Timer.d.ts +3 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/schema/DataTypes.d.ts +2 -0
- package/lib/utils/SimpleConnector.js +6 -5
- package/lib/utils/mask.d.ts +5 -0
- package/lib/utils/mask.js +35 -0
- package/lib/utils/money.d.ts +5 -0
- package/lib/utils/money.js +24 -0
- package/lib/utils/validator.d.ts +4 -2
- package/lib/utils/validator.js +8 -3
- package/package.json +3 -2
- package/src/entities/Modi.ts +1 -0
- package/src/entities/ModiEntity.ts +1 -0
- package/src/entities/Oper.ts +1 -0
- package/src/entities/OperEntity.ts +1 -0
- package/src/entities/User.ts +1 -0
- package/src/entities/UserEntityGrant.ts +1 -0
- package/lib/utils/cron.d.ts +0 -1
- package/lib/utils/cron.js +0 -18
|
@@ -583,29 +583,32 @@ var CascadeStore = /** @class */ (function (_super) {
|
|
|
583
583
|
else {
|
|
584
584
|
// 这里优化一下,如果filter上有id,直接更新成根据entityId来过滤
|
|
585
585
|
// 除了性能原因之外,还因为会制造出user: { id: xxx }这样的查询,general中不允许这样查询的出现
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
586
|
+
// 暂时先封掉user上的相关更新条件,会制造出连接表上的update
|
|
587
|
+
if (entity !== 'user') {
|
|
588
|
+
if (filter) {
|
|
589
|
+
if (filter.id && Object.keys(filter).length === 1) {
|
|
590
|
+
Object.assign(otm, {
|
|
591
|
+
filter: (0, filter_1.addFilterSegment)({
|
|
592
|
+
entity: entity,
|
|
593
|
+
entityId: filter.id,
|
|
594
|
+
}, filterOtm),
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
Object.assign(otm, {
|
|
599
|
+
filter: (0, filter_1.addFilterSegment)((_a = {},
|
|
600
|
+
_a[entity] = filter,
|
|
601
|
+
_a), filterOtm),
|
|
602
|
+
});
|
|
603
|
+
}
|
|
594
604
|
}
|
|
595
|
-
|
|
596
|
-
Object.assign(
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
_a), filterOtm),
|
|
605
|
+
if (action === 'remove' && actionOtm === 'update') {
|
|
606
|
+
Object.assign(dataOtm, {
|
|
607
|
+
entity: null,
|
|
608
|
+
entityId: null,
|
|
600
609
|
});
|
|
601
610
|
}
|
|
602
611
|
}
|
|
603
|
-
if (action === 'remove' && actionOtm === 'update') {
|
|
604
|
-
Object.assign(dataOtm, {
|
|
605
|
-
entity: null,
|
|
606
|
-
entityId: null,
|
|
607
|
-
});
|
|
608
|
-
}
|
|
609
612
|
}
|
|
610
613
|
}
|
|
611
614
|
else {
|
|
@@ -649,20 +652,23 @@ var CascadeStore = /** @class */ (function (_super) {
|
|
|
649
652
|
// 这里优化一下,如果filter上有id,直接更新成根据entityId来过滤
|
|
650
653
|
// 除了性能原因之外,还因为会制造出user: { id: xxx }这样的查询,general中不允许这样查询的出现
|
|
651
654
|
// 绝大多数情况都是id,但也有可能update可能出现上层filter不是根据id的(userEntityGrant的过期触发的wechatQrCode的过期,见general中的userEntityGrant的trigger)
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
655
|
+
// 暂时先封掉user上的连接,以避免生成连接表更新
|
|
656
|
+
if (entity !== 'user') {
|
|
657
|
+
if (filter) {
|
|
658
|
+
if (filter.id && Object.keys(filter).length === 1) {
|
|
659
|
+
Object.assign(otm, {
|
|
660
|
+
filter: (0, filter_1.addFilterSegment)((_d = {},
|
|
661
|
+
_d[foreignKey_2] = filter.id,
|
|
662
|
+
_d), filterOtm),
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
Object.assign(otm, {
|
|
667
|
+
filter: (0, filter_1.addFilterSegment)((_e = {},
|
|
668
|
+
_e[foreignKey_2.slice(0, foreignKey_2.length - 2)] = filter,
|
|
669
|
+
_e), filterOtm),
|
|
670
|
+
});
|
|
671
|
+
}
|
|
666
672
|
}
|
|
667
673
|
}
|
|
668
674
|
if (action === 'remove' && actionOtm === 'update') {
|
package/lib/store/checker.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { AuthDefDict, Checker, EntityDict, OperateOption, SelectOption, StorageS
|
|
|
2
2
|
import { EntityDict as BaseEntityDict } from '../base-app-domain';
|
|
3
3
|
import { AsyncContext } from "./AsyncRowStore";
|
|
4
4
|
import { SyncContext } from './SyncRowStore';
|
|
5
|
-
export declare function translateCheckerInAsyncContext<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>>(checker: Checker<ED,
|
|
6
|
-
fn: Trigger<ED,
|
|
5
|
+
export declare function translateCheckerInAsyncContext<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>>(checker: Checker<ED, T, Cxt>): {
|
|
6
|
+
fn: Trigger<ED, T, Cxt>['fn'];
|
|
7
7
|
when: 'before' | 'after';
|
|
8
8
|
};
|
|
9
9
|
export declare function translateCheckerInSyncContext<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends SyncContext<ED>>(checker: Checker<ED, T, Cxt>): {
|