oak-domain 3.0.3 → 3.0.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/actions/action.d.ts +8 -8
- package/lib/actions/action.js +2 -2
- package/lib/actions/relation.d.ts +1 -1
- package/lib/actions/relation.js +9 -22
- package/lib/base-app-domain/ActionAuth/Schema.d.ts +68 -42
- package/lib/base-app-domain/ActionAuth/Storage.js +12 -15
- package/lib/base-app-domain/ActionDefDict.d.ts +2 -3
- package/lib/base-app-domain/ActionDefDict.js +3 -5
- package/lib/base-app-domain/EntityDict.d.ts +5 -1
- package/lib/base-app-domain/I18n/Schema.d.ts +24 -24
- package/lib/base-app-domain/I18n/Storage.js +5 -5
- package/lib/base-app-domain/Modi/Action.d.ts +4 -4
- package/lib/base-app-domain/Modi/Action.js +3 -3
- package/lib/base-app-domain/Modi/Schema.d.ts +24 -24
- package/lib/base-app-domain/Modi/Storage.js +3 -3
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +128 -55
- package/lib/base-app-domain/ModiEntity/Storage.js +2 -2
- package/lib/base-app-domain/Oper/Schema.d.ts +30 -29
- package/lib/base-app-domain/Oper/Storage.js +1 -1
- package/lib/base-app-domain/OperEntity/Schema.d.ts +126 -53
- package/lib/base-app-domain/OperEntity/Storage.js +2 -2
- package/lib/base-app-domain/Path/Schema.d.ts +149 -0
- package/lib/base-app-domain/Path/Schema.js +2 -0
- package/lib/base-app-domain/Path/Storage.d.ts +3 -0
- package/lib/base-app-domain/Path/Storage.js +54 -0
- package/lib/base-app-domain/Relation/Schema.d.ts +34 -34
- package/lib/base-app-domain/Relation/Storage.js +6 -6
- package/lib/base-app-domain/Relation.d.ts +0 -8
- package/lib/base-app-domain/Relation.js +1 -7
- package/lib/base-app-domain/RelationAuth/Schema.d.ts +74 -40
- package/lib/base-app-domain/RelationAuth/Storage.js +9 -11
- package/lib/base-app-domain/Storage.js +20 -16
- package/lib/base-app-domain/User/Action.d.ts +4 -4
- package/lib/base-app-domain/User/Action.js +3 -3
- package/lib/base-app-domain/User/Schema.d.ts +40 -27
- package/lib/base-app-domain/User/Storage.js +1 -1
- package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +264 -0
- package/lib/base-app-domain/UserEntityClaim/Schema.js +2 -0
- package/lib/base-app-domain/UserEntityClaim/Storage.d.ts +3 -0
- package/lib/base-app-domain/UserEntityClaim/Storage.js +37 -0
- package/lib/base-app-domain/UserEntityGrant/Action.d.ts +2 -2
- package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +55 -81
- package/lib/base-app-domain/UserEntityGrant/Storage.js +7 -11
- package/lib/base-app-domain/UserRelation/Schema.d.ts +50 -36
- package/lib/base-app-domain/UserRelation/Storage.js +7 -7
- package/lib/base-app-domain/_SubQuery.d.ts +45 -15
- package/lib/base-app-domain/index.js +1 -1
- package/lib/checkers/index.js +6 -7
- package/lib/compiler/env.js +16 -18
- package/lib/compiler/localeBuilder.js +83 -79
- package/lib/compiler/schemalBuilder.d.ts +16 -0
- package/lib/compiler/schemalBuilder.js +1160 -1378
- package/lib/entities/ActionAuth.d.ts +3 -5
- package/lib/entities/ActionAuth.js +9 -7
- package/lib/entities/I18n.js +1 -1
- package/lib/entities/Modi.js +2 -2
- package/lib/entities/ModiEntity.js +1 -1
- package/lib/entities/Oper.js +1 -1
- package/lib/entities/OperEntity.js +1 -1
- package/lib/entities/Path.d.ts +8 -0
- package/lib/entities/Path.js +35 -0
- package/lib/entities/Relation.js +1 -1
- package/lib/entities/RelationAuth.d.ts +2 -2
- package/lib/entities/RelationAuth.js +1 -1
- package/lib/entities/User.js +2 -2
- package/lib/entities/UserEntityClaim.d.ts +13 -0
- package/lib/entities/UserEntityClaim.js +17 -0
- package/lib/entities/UserEntityGrant.d.ts +5 -4
- package/lib/entities/UserEntityGrant.js +4 -7
- package/lib/entities/UserRelation.js +1 -1
- package/lib/index.d.ts +23 -0
- package/lib/index.js +37 -0
- package/lib/store/AsyncRowStore.d.ts +2 -1
- package/lib/store/AsyncRowStore.js +75 -149
- package/lib/store/CascadeStore.js +917 -1291
- package/lib/store/RelationAuth.d.ts +9 -16
- package/lib/store/RelationAuth.js +750 -908
- package/lib/store/SyncRowStore.d.ts +1 -1
- package/lib/store/SyncRowStore.js +27 -26
- package/lib/store/TriggerExecutor.d.ts +17 -10
- package/lib/store/TriggerExecutor.js +350 -423
- package/lib/store/actionAuth.js +13 -28
- package/lib/store/actionDef.js +118 -193
- package/lib/store/checker.js +225 -361
- package/lib/store/filter.d.ts +2 -3
- package/lib/store/filter.js +451 -589
- package/lib/store/modi.js +116 -177
- package/lib/store/relation.js +17 -17
- package/lib/timers/oper.d.ts +1 -1
- package/lib/timers/oper.js +44 -47
- package/lib/timers/vaccum.d.ts +2 -2
- package/lib/timers/vaccum.js +100 -165
- package/lib/triggers/index.js +1 -1
- package/lib/types/Action.d.ts +7 -7
- package/lib/types/AppLoader.d.ts +8 -2
- package/lib/types/AppLoader.js +4 -4
- package/lib/types/Aspect.d.ts +1 -3
- package/lib/types/Auth.d.ts +15 -19
- package/lib/types/Connector.d.ts +19 -15
- package/lib/types/Connector.js +0 -7
- package/lib/types/DataType.d.ts +19 -18
- package/lib/types/DataType.js +1 -1
- package/lib/types/Demand.d.ts +25 -25
- package/lib/types/Endpoint.d.ts +1 -1
- package/lib/types/Entity.d.ts +57 -53
- package/lib/types/Entity.js +3 -3
- package/lib/types/EntityDesc.d.ts +2 -1
- package/lib/types/Environment.d.ts +4 -4
- package/lib/types/Exception.d.ts +29 -2
- package/lib/types/Exception.js +205 -205
- package/lib/types/Expression.d.ts +14 -14
- package/lib/types/Expression.js +54 -87
- package/lib/types/Geo.d.ts +6 -6
- package/lib/types/Locale.d.ts +5 -5
- package/lib/types/Polyfill.d.ts +9 -9
- package/lib/types/Port.d.ts +4 -4
- package/lib/types/RowStore.d.ts +3 -3
- package/lib/types/RowStore.js +18 -19
- package/lib/types/Storage.d.ts +5 -4
- package/lib/types/Style.d.ts +2 -2
- package/lib/types/Timer.d.ts +3 -3
- package/lib/types/Trigger.d.ts +30 -14
- package/lib/types/Trigger.js +6 -2
- package/lib/types/Watcher.d.ts +2 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +2 -1
- package/lib/types/schema/DataTypes.d.ts +7 -7
- package/lib/utils/SimpleConnector.d.ts +24 -10
- package/lib/utils/SimpleConnector.js +166 -144
- package/lib/utils/assert.js +2 -2
- package/lib/utils/concurrent.d.ts +1 -1
- package/lib/utils/concurrent.js +31 -57
- package/lib/utils/date.js +2 -2
- package/lib/utils/geo.js +8 -8
- package/lib/utils/lodash.d.ts +3 -1
- package/lib/utils/lodash.js +21 -34
- package/lib/utils/mask.js +12 -13
- package/lib/utils/money.d.ts +1 -1
- package/lib/utils/money.js +22 -11
- package/lib/utils/projection.d.ts +4 -0
- package/lib/utils/projection.js +15 -0
- package/lib/utils/random/random.js +11 -16
- package/lib/utils/random/random.mp.js +7 -18
- package/lib/utils/random/random.web.js +6 -12
- package/lib/utils/string.d.ts +4 -4
- package/lib/utils/string.js +19 -32
- package/lib/utils/url.js +5 -4
- package/lib/utils/uuid.d.ts +1 -1
- package/lib/utils/uuid.js +46 -85
- package/lib/utils/validator.d.ts +4 -3
- package/lib/utils/validator.js +35 -32
- package/lib/utils/version.js +6 -6
- package/package.json +7 -7
- package/src/entities/ActionAuth.ts +10 -10
- package/src/entities/Path.ts +43 -0
- package/src/entities/RelationAuth.ts +2 -1
- package/src/entities/UserEntityClaim.ts +30 -0
- package/src/entities/UserEntityGrant.ts +9 -12
package/lib/actions/action.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ActionDef } from '../types/Action';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
2
|
+
export type ReadOnlyAction = 'select' | 'count' | 'stat' | 'download' | 'aggregate';
|
|
3
|
+
export type AppendOnlyAction = ReadOnlyAction | 'create';
|
|
4
|
+
export type ExcludeUpdateAction = AppendOnlyAction | 'remove';
|
|
5
|
+
export type ExcludeRemoveAction = AppendOnlyAction | 'update';
|
|
6
|
+
export type GenericAction = 'update' | ExcludeUpdateAction;
|
|
7
|
+
export type RelationAction = 'grant' | 'revoke';
|
|
8
8
|
export declare const readOnlyActions: string[];
|
|
9
9
|
export declare const appendOnlyActions: string[];
|
|
10
10
|
export declare const excludeUpdateActions: string[];
|
|
11
11
|
export declare const excludeRemoveActions: string[];
|
|
12
12
|
export declare const genericActions: string[];
|
|
13
13
|
export declare const relationActions: string[];
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type AbleAction = 'enable' | 'disable';
|
|
15
|
+
export type AbleState = 'enabled' | 'disabled';
|
|
16
16
|
export declare const makeAbleActionDef: (initialState?: AbleState) => ActionDef<AbleAction, AbleState>;
|
package/lib/actions/action.js
CHANGED
|
@@ -7,11 +7,11 @@ exports.excludeUpdateActions = exports.appendOnlyActions.concat('remove');
|
|
|
7
7
|
exports.excludeRemoveActions = exports.appendOnlyActions.concat('update');
|
|
8
8
|
exports.genericActions = exports.excludeUpdateActions.concat('update');
|
|
9
9
|
exports.relationActions = ['grant', 'revoke'];
|
|
10
|
-
|
|
10
|
+
const makeAbleActionDef = (initialState) => ({
|
|
11
11
|
stm: {
|
|
12
12
|
enable: ['disabled', 'enabled'],
|
|
13
13
|
disable: ['enabled', 'disabled'],
|
|
14
14
|
},
|
|
15
15
|
is: initialState,
|
|
16
|
-
});
|
|
16
|
+
});
|
|
17
17
|
exports.makeAbleActionDef = makeAbleActionDef;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CascadeRelationItem, RelationHierarchy, EntityDict } from "../types/Entity";
|
|
2
|
-
export
|
|
2
|
+
export type GenericRelation = 'owner';
|
|
3
3
|
export declare function convertHierarchyToAuth<ED extends EntityDict, T extends keyof ED>(entity: T, hierarchy: RelationHierarchy<NonNullable<ED[T]['Relation']>>): {
|
|
4
4
|
[K in NonNullable<ED[T]['Relation']>]?: CascadeRelationItem;
|
|
5
5
|
};
|
package/lib/actions/relation.js
CHANGED
|
@@ -1,33 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertHierarchyToAuth = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
4
|
function convertHierarchyToAuth(entity, hierarchy) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (var _c = (e_1 = void 0, tslib_1.__values(hierarchy[r])), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
12
|
-
var r2 = _d.value;
|
|
13
|
-
if (reverseHierarchy[r2]) {
|
|
14
|
-
(_b = reverseHierarchy[r2]) === null || _b === void 0 ? void 0 : _b.push(r);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
reverseHierarchy[r2] = [r];
|
|
18
|
-
}
|
|
5
|
+
const reverseHierarchy = {};
|
|
6
|
+
for (const r in hierarchy) {
|
|
7
|
+
for (const r2 of hierarchy[r]) {
|
|
8
|
+
if (reverseHierarchy[r2]) {
|
|
9
|
+
reverseHierarchy[r2]?.push(r);
|
|
19
10
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
finally {
|
|
23
|
-
try {
|
|
24
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
11
|
+
else {
|
|
12
|
+
reverseHierarchy[r2] = [r];
|
|
25
13
|
}
|
|
26
|
-
finally { if (e_1) throw e_1.error; }
|
|
27
14
|
}
|
|
28
15
|
}
|
|
29
|
-
|
|
30
|
-
for (
|
|
16
|
+
const result = {};
|
|
17
|
+
for (const r in reverseHierarchy) {
|
|
31
18
|
result[r] = {
|
|
32
19
|
cascadePath: '',
|
|
33
20
|
relations: reverseHierarchy[r],
|
|
@@ -3,26 +3,24 @@ import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey,
|
|
|
3
3
|
import { OneOf } from "../../types/Polyfill";
|
|
4
4
|
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "../../types/Entity";
|
|
5
5
|
import { GenericAction } from "../../actions/action";
|
|
6
|
-
import { String } from "../../types/DataType";
|
|
7
6
|
import { EntityShape } from "../../types/Entity";
|
|
8
7
|
import * as Relation from "../Relation/Schema";
|
|
8
|
+
import * as Path from "../Path/Schema";
|
|
9
9
|
import * as ModiEntity from "../ModiEntity/Schema";
|
|
10
10
|
import * as OperEntity from "../OperEntity/Schema";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare type OpSchema = EntityShape & {
|
|
11
|
+
type Actions = string[];
|
|
12
|
+
export type OpSchema = EntityShape & {
|
|
14
13
|
relationId?: ForeignKey<"relation"> | null;
|
|
15
|
-
|
|
16
|
-
destEntity: String<32>;
|
|
14
|
+
pathId: ForeignKey<"path">;
|
|
17
15
|
deActions: Actions;
|
|
18
16
|
};
|
|
19
|
-
export
|
|
20
|
-
export
|
|
17
|
+
export type OpAttr = keyof OpSchema;
|
|
18
|
+
export type Schema = EntityShape & {
|
|
21
19
|
relationId?: ForeignKey<"relation"> | null;
|
|
22
|
-
|
|
23
|
-
destEntity: String<32>;
|
|
20
|
+
pathId: ForeignKey<"path">;
|
|
24
21
|
deActions: Actions;
|
|
25
22
|
relation?: Relation.Schema | null;
|
|
23
|
+
path: Path.Schema;
|
|
26
24
|
modiEntity$entity?: Array<ModiEntity.Schema>;
|
|
27
25
|
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
|
|
28
26
|
operEntity$entity?: Array<OperEntity.Schema>;
|
|
@@ -30,21 +28,21 @@ export declare type Schema = EntityShape & {
|
|
|
30
28
|
} & {
|
|
31
29
|
[A in ExpressionKey]?: any;
|
|
32
30
|
};
|
|
33
|
-
|
|
31
|
+
type AttrFilter = {
|
|
34
32
|
id: Q_StringValue;
|
|
35
33
|
$$createAt$$: Q_DateValue;
|
|
36
34
|
$$seq$$: Q_StringValue;
|
|
37
35
|
$$updateAt$$: Q_DateValue;
|
|
38
36
|
relationId: Q_StringValue;
|
|
39
37
|
relation: Relation.Filter;
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
pathId: Q_StringValue;
|
|
39
|
+
path: Path.Filter;
|
|
42
40
|
deActions: JsonFilter<Actions>;
|
|
43
41
|
modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
|
|
44
42
|
operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
|
|
45
43
|
};
|
|
46
|
-
export
|
|
47
|
-
export
|
|
44
|
+
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
45
|
+
export type Projection = {
|
|
48
46
|
"#id"?: NodeId;
|
|
49
47
|
[k: string]: any;
|
|
50
48
|
id?: number;
|
|
@@ -53,8 +51,8 @@ export declare type Projection = {
|
|
|
53
51
|
$$seq$$?: number;
|
|
54
52
|
relationId?: number;
|
|
55
53
|
relation?: Relation.Projection;
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
pathId?: number;
|
|
55
|
+
path?: Path.Projection;
|
|
58
56
|
deActions?: number | JsonProjection<Actions>;
|
|
59
57
|
modiEntity$entity?: ModiEntity.Selection & {
|
|
60
58
|
$entity: "modiEntity";
|
|
@@ -69,13 +67,16 @@ export declare type Projection = {
|
|
|
69
67
|
$entity: "operEntity";
|
|
70
68
|
};
|
|
71
69
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
72
|
-
|
|
70
|
+
type ActionAuthIdProjection = OneOf<{
|
|
73
71
|
id: number;
|
|
74
72
|
}>;
|
|
75
|
-
|
|
73
|
+
type RelationIdProjection = OneOf<{
|
|
76
74
|
relationId: number;
|
|
77
75
|
}>;
|
|
78
|
-
|
|
76
|
+
type PathIdProjection = OneOf<{
|
|
77
|
+
pathId: number;
|
|
78
|
+
}>;
|
|
79
|
+
export type SortAttr = {
|
|
79
80
|
id: number;
|
|
80
81
|
} | {
|
|
81
82
|
$$createAt$$: number;
|
|
@@ -88,63 +89,88 @@ export declare type SortAttr = {
|
|
|
88
89
|
} | {
|
|
89
90
|
relation: Relation.SortAttr;
|
|
90
91
|
} | {
|
|
91
|
-
|
|
92
|
+
pathId: number;
|
|
92
93
|
} | {
|
|
93
|
-
|
|
94
|
+
path: Path.SortAttr;
|
|
94
95
|
} | {
|
|
95
96
|
deActions: number;
|
|
96
97
|
} | {
|
|
97
98
|
[k: string]: any;
|
|
98
99
|
} | OneOf<ExprOp<OpAttr | string>>;
|
|
99
|
-
export
|
|
100
|
+
export type SortNode = {
|
|
100
101
|
$attr: SortAttr;
|
|
101
102
|
$direction?: "asc" | "desc";
|
|
102
103
|
};
|
|
103
|
-
export
|
|
104
|
-
export
|
|
105
|
-
export
|
|
106
|
-
export
|
|
107
|
-
export
|
|
104
|
+
export type Sorter = SortNode[];
|
|
105
|
+
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
106
|
+
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
107
|
+
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
108
|
+
export type CreateOperationData = FormCreateData<Omit<OpSchema, "relationId" | "pathId">> & (({
|
|
108
109
|
relationId?: never;
|
|
109
110
|
relation?: Relation.CreateSingleOperation;
|
|
110
111
|
} | {
|
|
111
112
|
relationId: ForeignKey<"relation">;
|
|
112
113
|
relation?: Relation.UpdateOperation;
|
|
113
114
|
} | {
|
|
115
|
+
relation?: never;
|
|
114
116
|
relationId?: ForeignKey<"relation">;
|
|
117
|
+
}) & ({
|
|
118
|
+
pathId?: never;
|
|
119
|
+
path: Path.CreateSingleOperation;
|
|
120
|
+
} | {
|
|
121
|
+
pathId: ForeignKey<"path">;
|
|
122
|
+
path?: Path.UpdateOperation;
|
|
123
|
+
} | {
|
|
124
|
+
path?: never;
|
|
125
|
+
pathId: ForeignKey<"path">;
|
|
115
126
|
})) & {
|
|
116
127
|
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
117
128
|
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
118
129
|
};
|
|
119
|
-
export
|
|
120
|
-
export
|
|
121
|
-
export
|
|
122
|
-
export
|
|
123
|
-
relation
|
|
130
|
+
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
|
131
|
+
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
|
132
|
+
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
133
|
+
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relationId" | "pathId">> & (({
|
|
134
|
+
relation?: Relation.CreateSingleOperation;
|
|
124
135
|
relationId?: never;
|
|
125
136
|
} | {
|
|
126
|
-
relation
|
|
137
|
+
relation?: Relation.UpdateOperation;
|
|
127
138
|
relationId?: never;
|
|
128
139
|
} | {
|
|
129
|
-
relation
|
|
140
|
+
relation?: Relation.RemoveOperation;
|
|
130
141
|
relationId?: never;
|
|
131
142
|
} | {
|
|
132
143
|
relation?: never;
|
|
133
144
|
relationId?: ForeignKey<"relation"> | null;
|
|
145
|
+
}) & ({
|
|
146
|
+
path?: Path.CreateSingleOperation;
|
|
147
|
+
pathId?: never;
|
|
148
|
+
} | {
|
|
149
|
+
path?: Path.UpdateOperation;
|
|
150
|
+
pathId?: never;
|
|
151
|
+
} | {
|
|
152
|
+
path?: Path.RemoveOperation;
|
|
153
|
+
pathId?: never;
|
|
154
|
+
} | {
|
|
155
|
+
path?: never;
|
|
156
|
+
pathId?: ForeignKey<"path">;
|
|
134
157
|
})) & {
|
|
135
158
|
[k: string]: any;
|
|
136
159
|
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
137
160
|
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
138
161
|
};
|
|
139
|
-
export
|
|
140
|
-
export
|
|
162
|
+
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
|
163
|
+
export type RemoveOperationData = {} & (({
|
|
141
164
|
relation?: Relation.UpdateOperation | Relation.RemoveOperation;
|
|
165
|
+
}) & ({
|
|
166
|
+
path?: Path.UpdateOperation | Path.RemoveOperation;
|
|
142
167
|
}));
|
|
143
|
-
export
|
|
144
|
-
export
|
|
145
|
-
export
|
|
146
|
-
export
|
|
147
|
-
export
|
|
168
|
+
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
|
169
|
+
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
170
|
+
export type RelationIdSubQuery = Selection<RelationIdProjection>;
|
|
171
|
+
export type PathIdSubQuery = Selection<PathIdProjection>;
|
|
172
|
+
export type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
|
|
173
|
+
export type EntityDef = {
|
|
148
174
|
Schema: Schema;
|
|
149
175
|
OpSchema: OpSchema;
|
|
150
176
|
Action: OakMakeAction<GenericAction> | string;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.desc = void 0;
|
|
4
|
-
|
|
4
|
+
const action_1 = require("../../actions/action");
|
|
5
5
|
exports.desc = {
|
|
6
6
|
attributes: {
|
|
7
7
|
relationId: {
|
|
8
8
|
type: "ref",
|
|
9
9
|
ref: "relation"
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
pathId: {
|
|
12
12
|
notNull: true,
|
|
13
|
-
type: "
|
|
14
|
-
|
|
15
|
-
destEntity: {
|
|
16
|
-
notNull: true,
|
|
17
|
-
type: "varchar",
|
|
18
|
-
params: {
|
|
19
|
-
length: 32
|
|
20
|
-
}
|
|
13
|
+
type: "ref",
|
|
14
|
+
ref: "path"
|
|
21
15
|
},
|
|
22
16
|
deActions: {
|
|
23
17
|
notNull: true,
|
|
@@ -28,15 +22,18 @@ exports.desc = {
|
|
|
28
22
|
actions: action_1.genericActions,
|
|
29
23
|
indexes: [
|
|
30
24
|
{
|
|
31
|
-
name: '
|
|
25
|
+
name: 'index_relation_path',
|
|
32
26
|
attributes: [
|
|
33
27
|
{
|
|
34
|
-
name:
|
|
28
|
+
name: "relationId",
|
|
35
29
|
},
|
|
36
30
|
{
|
|
37
|
-
name: "
|
|
38
|
-
}
|
|
39
|
-
]
|
|
31
|
+
name: "pathId",
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
config: {
|
|
35
|
+
unique: true,
|
|
36
|
+
},
|
|
40
37
|
}
|
|
41
38
|
]
|
|
42
39
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export declare const ActionDefDict: {
|
|
2
2
|
modi: {
|
|
3
|
-
iState: import("
|
|
3
|
+
iState: import("..").ActionDef<string, string>;
|
|
4
4
|
};
|
|
5
5
|
user: {
|
|
6
|
-
userState: import("
|
|
6
|
+
userState: import("..").ActionDef<string, string>;
|
|
7
7
|
};
|
|
8
|
-
userEntityGrant: {};
|
|
9
8
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActionDefDict = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var Action_3 = require("./UserEntityGrant/Action");
|
|
4
|
+
const Action_1 = require("./Modi/Action");
|
|
5
|
+
const Action_2 = require("./User/Action");
|
|
7
6
|
exports.ActionDefDict = {
|
|
8
7
|
modi: Action_1.ActionDefDict,
|
|
9
|
-
user: Action_2.ActionDefDict
|
|
10
|
-
userEntityGrant: Action_3.ActionDefDict
|
|
8
|
+
user: Action_2.ActionDefDict
|
|
11
9
|
};
|
|
@@ -4,21 +4,25 @@ import { EntityDef as Modi } from "./Modi/Schema";
|
|
|
4
4
|
import { EntityDef as ModiEntity } from "./ModiEntity/Schema";
|
|
5
5
|
import { EntityDef as Oper } from "./Oper/Schema";
|
|
6
6
|
import { EntityDef as OperEntity } from "./OperEntity/Schema";
|
|
7
|
+
import { EntityDef as Path } from "./Path/Schema";
|
|
7
8
|
import { EntityDef as Relation } from "./Relation/Schema";
|
|
8
9
|
import { EntityDef as RelationAuth } from "./RelationAuth/Schema";
|
|
9
10
|
import { EntityDef as User } from "./User/Schema";
|
|
11
|
+
import { EntityDef as UserEntityClaim } from "./UserEntityClaim/Schema";
|
|
10
12
|
import { EntityDef as UserEntityGrant } from "./UserEntityGrant/Schema";
|
|
11
13
|
import { EntityDef as UserRelation } from "./UserRelation/Schema";
|
|
12
|
-
export
|
|
14
|
+
export type EntityDict = {
|
|
13
15
|
actionAuth: ActionAuth;
|
|
14
16
|
i18n: I18n;
|
|
15
17
|
modi: Modi;
|
|
16
18
|
modiEntity: ModiEntity;
|
|
17
19
|
oper: Oper;
|
|
18
20
|
operEntity: OperEntity;
|
|
21
|
+
path: Path;
|
|
19
22
|
relation: Relation;
|
|
20
23
|
relationAuth: RelationAuth;
|
|
21
24
|
user: User;
|
|
25
|
+
userEntityClaim: UserEntityClaim;
|
|
22
26
|
userEntityGrant: UserEntityGrant;
|
|
23
27
|
userRelation: UserRelation;
|
|
24
28
|
};
|
|
@@ -6,15 +6,15 @@ import { String } from "../../types/DataType";
|
|
|
6
6
|
import { EntityShape } from "../../types/Entity";
|
|
7
7
|
import * as ModiEntity from "../ModiEntity/Schema";
|
|
8
8
|
import * as OperEntity from "../OperEntity/Schema";
|
|
9
|
-
export
|
|
9
|
+
export type OpSchema = EntityShape & {
|
|
10
10
|
module: String<64>;
|
|
11
11
|
position: String<188>;
|
|
12
12
|
namespace: String<256>;
|
|
13
13
|
language: String<32>;
|
|
14
14
|
data: Object;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type OpAttr = keyof OpSchema;
|
|
17
|
+
export type Schema = EntityShape & {
|
|
18
18
|
module: String<64>;
|
|
19
19
|
position: String<188>;
|
|
20
20
|
namespace: String<256>;
|
|
@@ -27,7 +27,7 @@ export declare type Schema = EntityShape & {
|
|
|
27
27
|
} & {
|
|
28
28
|
[A in ExpressionKey]?: any;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
type AttrFilter = {
|
|
31
31
|
id: Q_StringValue;
|
|
32
32
|
$$createAt$$: Q_DateValue;
|
|
33
33
|
$$seq$$: Q_StringValue;
|
|
@@ -40,8 +40,8 @@ declare type AttrFilter = {
|
|
|
40
40
|
modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
|
|
41
41
|
operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
|
|
42
42
|
};
|
|
43
|
-
export
|
|
44
|
-
export
|
|
43
|
+
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
44
|
+
export type Projection = {
|
|
45
45
|
"#id"?: NodeId;
|
|
46
46
|
[k: string]: any;
|
|
47
47
|
id?: number;
|
|
@@ -66,10 +66,10 @@ export declare type Projection = {
|
|
|
66
66
|
$entity: "operEntity";
|
|
67
67
|
};
|
|
68
68
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
69
|
-
|
|
69
|
+
type I18nIdProjection = OneOf<{
|
|
70
70
|
id: number;
|
|
71
71
|
}>;
|
|
72
|
-
export
|
|
72
|
+
export type SortAttr = {
|
|
73
73
|
id: number;
|
|
74
74
|
} | {
|
|
75
75
|
$$createAt$$: number;
|
|
@@ -88,32 +88,32 @@ export declare type SortAttr = {
|
|
|
88
88
|
} | {
|
|
89
89
|
[k: string]: any;
|
|
90
90
|
} | OneOf<ExprOp<OpAttr | string>>;
|
|
91
|
-
export
|
|
91
|
+
export type SortNode = {
|
|
92
92
|
$attr: SortAttr;
|
|
93
93
|
$direction?: "asc" | "desc";
|
|
94
94
|
};
|
|
95
|
-
export
|
|
96
|
-
export
|
|
97
|
-
export
|
|
98
|
-
export
|
|
99
|
-
export
|
|
95
|
+
export type Sorter = SortNode[];
|
|
96
|
+
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
97
|
+
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
98
|
+
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
99
|
+
export type CreateOperationData = FormCreateData<OpSchema> & {
|
|
100
100
|
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
101
101
|
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
102
102
|
};
|
|
103
|
-
export
|
|
104
|
-
export
|
|
105
|
-
export
|
|
106
|
-
export
|
|
103
|
+
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
|
104
|
+
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
|
105
|
+
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
106
|
+
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
|
107
107
|
[k: string]: any;
|
|
108
108
|
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
109
109
|
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
110
110
|
};
|
|
111
|
-
export
|
|
112
|
-
export
|
|
113
|
-
export
|
|
114
|
-
export
|
|
115
|
-
export
|
|
116
|
-
export
|
|
111
|
+
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
|
112
|
+
export type RemoveOperationData = {};
|
|
113
|
+
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
|
114
|
+
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
115
|
+
export type I18nIdSubQuery = Selection<I18nIdProjection>;
|
|
116
|
+
export type EntityDef = {
|
|
117
117
|
Schema: Schema;
|
|
118
118
|
OpSchema: OpSchema;
|
|
119
119
|
Action: OakMakeAction<ReadOnlyAction> | string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.desc = void 0;
|
|
4
|
-
|
|
4
|
+
const action_1 = require("../../actions/action");
|
|
5
5
|
exports.desc = {
|
|
6
6
|
attributes: {
|
|
7
7
|
module: {
|
|
@@ -45,15 +45,15 @@ exports.desc = {
|
|
|
45
45
|
name: 'namespace_language',
|
|
46
46
|
attributes: [
|
|
47
47
|
{
|
|
48
|
-
name: 'namespace'
|
|
48
|
+
name: 'namespace',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
name: 'language'
|
|
51
|
+
name: 'language',
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
config: {
|
|
55
|
-
unique: true
|
|
56
|
-
}
|
|
55
|
+
unique: true,
|
|
56
|
+
},
|
|
57
57
|
}
|
|
58
58
|
]
|
|
59
59
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ActionDef } from "../../types/Action";
|
|
2
2
|
import { GenericAction } from "../../actions/action";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type IState = 'active' | 'applied' | 'abandoned' | string;
|
|
4
|
+
export type IAction = 'apply' | 'abandon' | string;
|
|
5
|
+
export type ParticularAction = IAction;
|
|
6
6
|
export declare const actions: string[];
|
|
7
|
-
export
|
|
7
|
+
export type Action = GenericAction | ParticularAction | string;
|
|
8
8
|
export declare const ActionDefDict: {
|
|
9
9
|
iState: ActionDef<string, string>;
|
|
10
10
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActionDefDict = exports.actions = void 0;
|
|
4
|
-
|
|
4
|
+
const IActionDef = {
|
|
5
5
|
stm: {
|
|
6
6
|
apply: ['active', 'applied'],
|
|
7
|
-
abandon: ['active', 'abandoned']
|
|
7
|
+
abandon: ['active', 'abandoned'],
|
|
8
8
|
},
|
|
9
|
-
is: 'active'
|
|
9
|
+
is: 'active',
|
|
10
10
|
};
|
|
11
11
|
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "apply", "abandon"];
|
|
12
12
|
exports.ActionDefDict = {
|