oak-domain 1.1.0 → 1.1.1
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/compiler/schemalBuilder.js +1 -0
- package/lib/store/actionDef.js +20 -4
- package/lib/store/modi.d.ts +3 -3
- package/lib/store/modi.js +8 -10
- package/package.json +1 -1
|
@@ -3027,6 +3027,7 @@ function analyzeInModi() {
|
|
|
3027
3027
|
if (schema.toModi || schema.inModi || schema.actionType === 'readOnly' || schema.static) {
|
|
3028
3028
|
return;
|
|
3029
3029
|
}
|
|
3030
|
+
console.log('setInModi', entity);
|
|
3030
3031
|
schema.inModi = true;
|
|
3031
3032
|
var related = getRelateEntities(entity);
|
|
3032
3033
|
related.forEach(function (ele) { return setInModi(ele); });
|
package/lib/store/actionDef.js
CHANGED
|
@@ -182,10 +182,26 @@ function analyzeActionDefDict(schema, actionDefDict) {
|
|
|
182
182
|
var _b;
|
|
183
183
|
return tslib_1.__generator(this, function (_c) {
|
|
184
184
|
data = operation.data;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
185
|
+
if (data instanceof Array) {
|
|
186
|
+
data.forEach(function (ele) {
|
|
187
|
+
var _a;
|
|
188
|
+
if (!ele[attr]) {
|
|
189
|
+
Object.assign(ele, (_a = {},
|
|
190
|
+
_a[attr] = is,
|
|
191
|
+
_a));
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
return [2 /*return*/, data.length];
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
if (!data[attr]) {
|
|
198
|
+
Object.assign(data, (_b = {},
|
|
199
|
+
_b[attr] = is,
|
|
200
|
+
_b));
|
|
201
|
+
}
|
|
202
|
+
return [2 /*return*/, 1];
|
|
203
|
+
}
|
|
204
|
+
return [2 /*return*/];
|
|
189
205
|
});
|
|
190
206
|
});
|
|
191
207
|
}
|
package/lib/store/modi.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EntityDict as BaseEntityDict } from '../base-app-domain';
|
|
2
2
|
import { UniversalContext } from '../store/UniversalContext';
|
|
3
3
|
import { OpSchema as Modi } from '../base-app-domain/Modi/Schema';
|
|
4
|
-
import { Checker, Operation, StorageSchema, EntityDict, Context } from '../types';
|
|
4
|
+
import { Checker, Operation, StorageSchema, EntityDict, Context, OperateOption } from '../types';
|
|
5
5
|
export declare function createOperationsFromModies(modies: Modi[]): Array<{
|
|
6
6
|
operation: Operation<string, Object, Object>;
|
|
7
7
|
entity: string;
|
|
8
8
|
}>;
|
|
9
|
-
export declare function applyModis<ED extends EntityDict & BaseEntityDict, Cxt extends UniversalContext<ED
|
|
10
|
-
export declare function abandonModis<ED extends EntityDict & BaseEntityDict, Cxt extends UniversalContext<ED
|
|
9
|
+
export declare function applyModis<ED extends EntityDict & BaseEntityDict, Cxt extends UniversalContext<ED>, Op extends OperateOption>(filter: ED['modi']['Selection']['filter'], context: Cxt, option: Op): Promise<import("../types").OperationResult<ED>>;
|
|
10
|
+
export declare function abandonModis<ED extends EntityDict & BaseEntityDict, Cxt extends UniversalContext<ED>, Op extends OperateOption>(filter: ED['modi']['Selection']['filter'], context: Cxt, option: Op): Promise<import("../types").OperationResult<ED>>;
|
|
11
11
|
export declare function createModiRelatedCheckers<ED extends EntityDict & BaseEntityDict, Cxt extends Context<ED>>(schema: StorageSchema<ED>): Checker<ED, keyof ED, Cxt>[];
|
package/lib/store/modi.js
CHANGED
|
@@ -19,7 +19,7 @@ function createOperationsFromModies(modies) {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
exports.createOperationsFromModies = createOperationsFromModies;
|
|
22
|
-
function applyModis(filter, context) {
|
|
22
|
+
function applyModis(filter, context, option) {
|
|
23
23
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
24
24
|
var _a, _b, _c;
|
|
25
25
|
var _d;
|
|
@@ -42,16 +42,15 @@ function applyModis(filter, context) {
|
|
|
42
42
|
$direction: 'asc',
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
|
-
_d), context, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}]))];
|
|
45
|
+
_d), context, Object.assign({}, option, {
|
|
46
|
+
blockTrigger: false,
|
|
47
|
+
})]))];
|
|
49
48
|
}
|
|
50
49
|
});
|
|
51
50
|
});
|
|
52
51
|
}
|
|
53
52
|
exports.applyModis = applyModis;
|
|
54
|
-
function abandonModis(filter, context) {
|
|
53
|
+
function abandonModis(filter, context, option) {
|
|
55
54
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
56
55
|
var _a, _b, _c;
|
|
57
56
|
var _d;
|
|
@@ -74,10 +73,9 @@ function abandonModis(filter, context) {
|
|
|
74
73
|
$direction: 'asc',
|
|
75
74
|
}
|
|
76
75
|
],
|
|
77
|
-
_d), context, {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}]))];
|
|
76
|
+
_d), context, Object.assign({}, option, {
|
|
77
|
+
blockTrigger: false,
|
|
78
|
+
})]))];
|
|
81
79
|
}
|
|
82
80
|
});
|
|
83
81
|
});
|