oak-domain 1.0.4 → 1.1.2

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.
Files changed (95) hide show
  1. package/lib/actions/action.d.ts +9 -1
  2. package/lib/actions/action.js +6 -2
  3. package/lib/base-app-domain/ActionDefDict.d.ts +5 -0
  4. package/lib/base-app-domain/ActionDefDict.js +7 -0
  5. package/lib/base-app-domain/EntityDict.d.ts +12 -0
  6. package/lib/base-app-domain/EntityDict.js +2 -0
  7. package/lib/base-app-domain/Modi/Action.d.ts +10 -0
  8. package/lib/base-app-domain/Modi/Action.js +14 -0
  9. package/lib/base-app-domain/Modi/Schema.d.ts +164 -0
  10. package/lib/base-app-domain/Modi/Schema.js +2 -0
  11. package/lib/base-app-domain/Modi/Storage.d.ts +3 -0
  12. package/lib/base-app-domain/Modi/Storage.js +60 -0
  13. package/lib/base-app-domain/ModiEntity/Schema.d.ts +179 -0
  14. package/lib/base-app-domain/ModiEntity/Schema.js +2 -0
  15. package/lib/base-app-domain/ModiEntity/Storage.d.ts +3 -0
  16. package/lib/base-app-domain/ModiEntity/Storage.js +26 -0
  17. package/lib/base-app-domain/Oper/Schema.d.ts +161 -0
  18. package/lib/base-app-domain/Oper/Schema.js +2 -0
  19. package/lib/base-app-domain/Oper/Storage.d.ts +3 -0
  20. package/lib/base-app-domain/Oper/Storage.js +29 -0
  21. package/lib/base-app-domain/OperEntity/Schema.d.ts +196 -0
  22. package/lib/base-app-domain/OperEntity/Schema.js +2 -0
  23. package/lib/base-app-domain/OperEntity/Storage.d.ts +3 -0
  24. package/lib/base-app-domain/OperEntity/Storage.js +26 -0
  25. package/lib/base-app-domain/Storage.d.ts +3 -0
  26. package/lib/base-app-domain/Storage.js +15 -0
  27. package/lib/base-app-domain/User/Schema.d.ts +140 -0
  28. package/lib/base-app-domain/User/Schema.js +2 -0
  29. package/lib/base-app-domain/User/Storage.d.ts +3 -0
  30. package/lib/base-app-domain/User/Storage.js +25 -0
  31. package/lib/base-app-domain/_SubQuery.d.ts +36 -0
  32. package/lib/base-app-domain/_SubQuery.js +2 -0
  33. package/lib/base-app-domain/index.d.ts +3 -0
  34. package/lib/base-app-domain/index.js +6 -0
  35. package/lib/checkers/index.d.ts +3 -0
  36. package/lib/checkers/index.js +8 -0
  37. package/lib/compiler/env.d.ts +4 -3
  38. package/lib/compiler/env.js +22 -9
  39. package/lib/compiler/schemalBuilder.js +631 -230
  40. package/lib/entities/Action.d.ts +12 -0
  41. package/lib/entities/Action.js +17 -0
  42. package/lib/entities/Modi.d.ts +11 -0
  43. package/lib/entities/Modi.js +46 -0
  44. package/lib/entities/ModiEntity.d.ts +8 -0
  45. package/lib/entities/ModiEntity.js +15 -0
  46. package/lib/entities/Ooperation.d.ts +12 -0
  47. package/lib/entities/Ooperation.js +17 -0
  48. package/lib/entities/Oper.d.ts +10 -0
  49. package/lib/entities/Oper.js +17 -0
  50. package/lib/entities/OperEntity.d.ts +8 -0
  51. package/lib/entities/OperEntity.js +15 -0
  52. package/lib/entities/Update.d.ts +9 -0
  53. package/lib/entities/Update.js +44 -0
  54. package/lib/entities/User.d.ts +7 -0
  55. package/lib/entities/User.js +12 -0
  56. package/lib/entities/Uupdate.d.ts +9 -0
  57. package/lib/entities/Uupdate.js +44 -0
  58. package/lib/store/CascadeStore.d.ts +31 -6
  59. package/lib/store/CascadeStore.js +1043 -151
  60. package/lib/store/TriggerExecutor.d.ts +4 -3
  61. package/lib/store/TriggerExecutor.js +7 -4
  62. package/lib/store/UniversalContext.d.ts +1 -0
  63. package/lib/store/action.d.ts +6 -0
  64. package/lib/store/action.js +14 -0
  65. package/lib/store/actionDef.js +23 -5
  66. package/lib/store/filter.d.ts +6 -0
  67. package/lib/store/filter.js +56 -1
  68. package/lib/store/modi.d.ts +12 -0
  69. package/lib/store/modi.js +190 -0
  70. package/lib/store/projection.d.ts +7 -0
  71. package/lib/store/projection.js +211 -0
  72. package/lib/store/selection.d.ts +7 -0
  73. package/lib/store/selection.js +227 -0
  74. package/lib/triggers/index.d.ts +5 -0
  75. package/lib/triggers/index.js +11 -0
  76. package/lib/triggers/modi.d.ts +5 -0
  77. package/lib/triggers/modi.js +72 -0
  78. package/lib/types/Context.d.ts +1 -0
  79. package/lib/types/DataType.d.ts +1 -1
  80. package/lib/types/Entity.d.ts +29 -16
  81. package/lib/types/Exception.d.ts +28 -0
  82. package/lib/types/Exception.js +67 -1
  83. package/lib/types/Expression.d.ts +9 -0
  84. package/lib/types/Expression.js +39 -1
  85. package/lib/types/RowStore.d.ts +3 -3
  86. package/lib/types/Storage.d.ts +6 -0
  87. package/lib/types/Trigger.d.ts +5 -5
  88. package/lib/utils/lodash.d.ts +4 -1
  89. package/lib/utils/lodash.js +7 -1
  90. package/package.json +7 -3
  91. package/src/entities/Modi.ts +68 -0
  92. package/src/entities/ModiEntity.ts +24 -0
  93. package/src/entities/Oper.ts +28 -0
  94. package/src/entities/OperEntity.ts +24 -0
  95. package/src/entities/User.ts +20 -0
@@ -1,5 +1,13 @@
1
1
  import { ActionDef } from '../types/Action';
2
- export declare type GenericAction = 'create' | 'update' | 'remove' | 'select' | 'count' | 'stat' | 'download';
2
+ export declare type ReadOnlyAction = 'select' | 'count' | 'stat' | 'download';
3
+ export declare type AppendOnlyAction = ReadOnlyAction | 'create';
4
+ export declare type ExcludeUpdateAction = AppendOnlyAction | 'remove';
5
+ export declare type ExcludeRemoveAction = AppendOnlyAction | 'update';
6
+ export declare type GenericAction = 'update' | ExcludeUpdateAction;
7
+ export declare const readOnlyActions: string[];
8
+ export declare const appendOnlyActions: string[];
9
+ export declare const excludeUpdateActions: string[];
10
+ export declare const exludeRemoveActions: string[];
3
11
  export declare const genericActions: string[];
4
12
  export declare type AbleAction = 'enable' | 'disable';
5
13
  export declare type AbleState = 'enabled' | 'disabled';
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeAbleActionDef = exports.genericActions = void 0;
4
- exports.genericActions = ['create', 'update', 'remove', 'count', 'stat', 'download', 'select'];
3
+ exports.makeAbleActionDef = exports.genericActions = exports.exludeRemoveActions = exports.excludeUpdateActions = exports.appendOnlyActions = exports.readOnlyActions = void 0;
4
+ exports.readOnlyActions = ['count', 'stat', 'download', 'select'];
5
+ exports.appendOnlyActions = exports.readOnlyActions.concat('create');
6
+ exports.excludeUpdateActions = exports.appendOnlyActions.concat('remove');
7
+ exports.exludeRemoveActions = exports.appendOnlyActions.concat('update');
8
+ exports.genericActions = exports.excludeUpdateActions.concat('update');
5
9
  var makeAbleActionDef = function (initialState) { return ({
6
10
  stm: {
7
11
  enable: ['disabled', 'enabled'],
@@ -0,0 +1,5 @@
1
+ export declare const ActionDefDict: {
2
+ modi: {
3
+ iState: import("../types").ActionDef<import("./Modi/Action").IAction, import("./Modi/Action").IState>;
4
+ };
5
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionDefDict = void 0;
4
+ var Action_1 = require("./Modi/Action");
5
+ exports.ActionDefDict = {
6
+ modi: Action_1.ActionDefDict
7
+ };
@@ -0,0 +1,12 @@
1
+ import { EntityDef as Modi } from "./Modi/Schema";
2
+ import { EntityDef as ModiEntity } from "./ModiEntity/Schema";
3
+ import { EntityDef as Oper } from "./Oper/Schema";
4
+ import { EntityDef as OperEntity } from "./OperEntity/Schema";
5
+ import { EntityDef as User } from "./User/Schema";
6
+ export declare type EntityDict = {
7
+ modi: Modi;
8
+ modiEntity: ModiEntity;
9
+ oper: Oper;
10
+ operEntity: OperEntity;
11
+ user: User;
12
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { ActionDef } from "../../types/Action";
2
+ import { GenericAction } from "../../actions/action";
3
+ export declare type IState = 'active' | 'applied' | 'abandoned';
4
+ export declare type IAction = 'apply' | 'abandon';
5
+ export declare type ParticularAction = IAction;
6
+ export declare type Action = GenericAction | ParticularAction;
7
+ export declare const actions: string[];
8
+ export declare const ActionDefDict: {
9
+ iState: ActionDef<IAction, IState>;
10
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionDefDict = exports.actions = void 0;
4
+ var IActionDef = {
5
+ stm: {
6
+ apply: ['active', 'applied'],
7
+ abandon: ['active', 'abandoned']
8
+ },
9
+ is: 'active'
10
+ };
11
+ exports.actions = ["count", "stat", "download", "select", "create", "remove", "update", "apply", "abandon"];
12
+ exports.ActionDefDict = {
13
+ iState: IActionDef
14
+ };
@@ -0,0 +1,164 @@
1
+ import { String, Datetime, PrimaryKey } from "../../types/DataType";
2
+ import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "../../types/Demand";
3
+ import { OneOf } from "../../types/Polyfill";
4
+ import * as SubQuery from "../_SubQuery";
5
+ import { FormCreateData, FormUpdateData, Operation as OakOperation, MakeAction as OakMakeAction } from "../../types/Entity";
6
+ import { Action, ParticularAction, IState } from "./Action";
7
+ import * as ModiEntity from "../ModiEntity/Schema";
8
+ import * as OperEntity from "../OperEntity/Schema";
9
+ export declare type OpSchema = {
10
+ id: PrimaryKey;
11
+ $$createAt$$: Datetime;
12
+ $$updateAt$$: Datetime;
13
+ $$deleteAt$$?: Datetime | null;
14
+ targetEntity: String<32>;
15
+ entity: String<32>;
16
+ entityId: String<64>;
17
+ action: String<16>;
18
+ data: Object;
19
+ filter?: Object | null;
20
+ extra?: Object | null;
21
+ iState?: IState | null;
22
+ };
23
+ export declare type OpAttr = keyof OpSchema;
24
+ export declare type Schema = {
25
+ id: PrimaryKey;
26
+ $$createAt$$: Datetime;
27
+ $$updateAt$$: Datetime;
28
+ $$deleteAt$$?: Datetime | null;
29
+ targetEntity: String<32>;
30
+ entity: String<32>;
31
+ entityId: String<64>;
32
+ action: String<16>;
33
+ data: Object;
34
+ filter?: Object | null;
35
+ extra?: Object | null;
36
+ iState?: IState | null;
37
+ modiEntity$modi?: Array<ModiEntity.Schema>;
38
+ operEntity$entity?: Array<OperEntity.Schema>;
39
+ } & {
40
+ [A in ExpressionKey]?: any;
41
+ };
42
+ declare type AttrFilter = {
43
+ id: Q_StringValue | SubQuery.ModiIdSubQuery;
44
+ $$createAt$$: Q_DateValue;
45
+ $$updateAt$$: Q_DateValue;
46
+ targetEntity: Q_StringValue;
47
+ entity: Q_StringValue;
48
+ entityId: Q_StringValue;
49
+ action: Q_StringValue;
50
+ data: Object;
51
+ filter: Object;
52
+ extra: Object;
53
+ iState: Q_EnumValue<IState>;
54
+ };
55
+ export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
56
+ export declare type Projection = {
57
+ "#id"?: NodeId;
58
+ [k: string]: any;
59
+ id: 1;
60
+ $$createAt$$?: 1;
61
+ $$updateAt$$?: 1;
62
+ targetEntity?: 1;
63
+ entity?: 1;
64
+ entityId?: 1;
65
+ action?: 1;
66
+ data?: 1;
67
+ filter?: 1;
68
+ extra?: 1;
69
+ iState?: 1;
70
+ modiEntity$modi?: ModiEntity.Selection & {
71
+ $entity: "modiEntity";
72
+ };
73
+ operEntity$entity?: OperEntity.Selection & {
74
+ $entity: "operEntity";
75
+ };
76
+ } & Partial<ExprOp<OpAttr | string>>;
77
+ export declare type ExportProjection = {
78
+ "#id"?: NodeId;
79
+ [k: string]: any;
80
+ id?: string;
81
+ $$createAt$$?: string;
82
+ $$updateAt$$?: string;
83
+ targetEntity?: string;
84
+ entity?: string;
85
+ entityId?: string;
86
+ action?: string;
87
+ data?: string;
88
+ filter?: string;
89
+ extra?: string;
90
+ iState?: string;
91
+ modiEntity$modi?: ModiEntity.Exportation & {
92
+ $entity: "modiEntity";
93
+ };
94
+ operEntity$entity?: OperEntity.Exportation & {
95
+ $entity: "operEntity";
96
+ };
97
+ } & Partial<ExprOp<OpAttr | string>>;
98
+ declare type ModiIdProjection = OneOf<{
99
+ id: 1;
100
+ }>;
101
+ export declare type SortAttr = {
102
+ id: 1;
103
+ } | {
104
+ $$createAt$$: 1;
105
+ } | {
106
+ $$updateAt$$: 1;
107
+ } | {
108
+ targetEntity: 1;
109
+ } | {
110
+ entity: 1;
111
+ } | {
112
+ entityId: 1;
113
+ } | {
114
+ action: 1;
115
+ } | {
116
+ iState: 1;
117
+ } | {
118
+ [k: string]: any;
119
+ } | OneOf<ExprOp<OpAttr | string>>;
120
+ export declare type SortNode = {
121
+ $attr: SortAttr;
122
+ $direction?: "asc" | "desc";
123
+ };
124
+ export declare type Sorter = SortNode[];
125
+ export declare type SelectOperation<P extends Object = Projection> = Omit<OakOperation<"select", P, Filter, Sorter>, "id">;
126
+ export declare type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
127
+ export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
128
+ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
129
+ entity?: string;
130
+ entityId?: string;
131
+ [K: string]: any;
132
+ }) & {
133
+ modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
134
+ operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
135
+ };
136
+ export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
137
+ export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
138
+ export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
139
+ export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
140
+ [k: string]: any;
141
+ modiEntitys$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
142
+ operEntitys$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
143
+ };
144
+ export declare type UpdateOperation = OakOperation<ParticularAction | "update" | string, UpdateOperationData, Filter, Sorter>;
145
+ export declare type RemoveOperationData = {};
146
+ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
147
+ export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
148
+ export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
149
+ export declare type NativeAttr = OpAttr;
150
+ export declare type FullAttr = NativeAttr | `modiEntitys$${number}.${ModiEntity.NativeAttr}` | `operEntitys$${number}.${OperEntity.NativeAttr}`;
151
+ export declare type EntityDef = {
152
+ Schema: Schema;
153
+ OpSchema: OpSchema;
154
+ Action: OakMakeAction<Action> | string;
155
+ Selection: Selection;
156
+ Operation: Operation;
157
+ Create: CreateOperation;
158
+ Update: UpdateOperation;
159
+ Remove: RemoveOperation;
160
+ CreateSingle: CreateSingleOperation;
161
+ CreateMulti: CreateMultipleOperation;
162
+ ParticularAction: ParticularAction;
163
+ };
164
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { StorageDesc } from "../../types/Storage";
2
+ import { OpSchema } from "./Schema";
3
+ export declare const desc: StorageDesc<OpSchema>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.desc = void 0;
4
+ var Action_1 = require("./Action");
5
+ exports.desc = {
6
+ attributes: {
7
+ targetEntity: {
8
+ type: "varchar",
9
+ params: {
10
+ length: 32
11
+ }
12
+ },
13
+ entity: {
14
+ type: "varchar",
15
+ params: {
16
+ length: 32
17
+ }
18
+ },
19
+ entityId: {
20
+ type: "varchar",
21
+ params: {
22
+ length: 64
23
+ }
24
+ },
25
+ action: {
26
+ type: "varchar",
27
+ params: {
28
+ length: 16
29
+ }
30
+ },
31
+ data: {
32
+ type: "object"
33
+ },
34
+ filter: {
35
+ type: "object"
36
+ },
37
+ extra: {
38
+ type: "object"
39
+ },
40
+ iState: {
41
+ type: "varchar",
42
+ params: {
43
+ length: 16
44
+ }
45
+ }
46
+ },
47
+ actionType: "crud",
48
+ actions: Action_1.actions,
49
+ indexes: [
50
+ {
51
+ name: 'index_state',
52
+ attributes: [
53
+ {
54
+ name: 'iState',
55
+ direction: 'ASC'
56
+ }
57
+ ]
58
+ }
59
+ ]
60
+ };
@@ -0,0 +1,179 @@
1
+ import { String, Datetime, PrimaryKey, ForeignKey } from "../../types/DataType";
2
+ import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "../../types/Demand";
3
+ import { OneOf } from "../../types/Polyfill";
4
+ import * as SubQuery from "../_SubQuery";
5
+ import { FormCreateData, FormUpdateData, Operation as OakOperation, MakeAction as OakMakeAction } from "../../types/Entity";
6
+ import { AppendOnlyAction } from "../../actions/action";
7
+ import * as Modi from "../Modi/Schema";
8
+ import * as User from "../User/Schema";
9
+ export declare type OpSchema = {
10
+ id: PrimaryKey;
11
+ $$createAt$$: Datetime;
12
+ $$updateAt$$: Datetime;
13
+ $$deleteAt$$?: Datetime | null;
14
+ modiId: ForeignKey<"modi">;
15
+ entity: "user" | string;
16
+ entityId: String<64>;
17
+ };
18
+ export declare type OpAttr = keyof OpSchema;
19
+ export declare type Schema = {
20
+ id: PrimaryKey;
21
+ $$createAt$$: Datetime;
22
+ $$updateAt$$: Datetime;
23
+ $$deleteAt$$?: Datetime | null;
24
+ modiId: ForeignKey<"modi">;
25
+ entity: "user" | string;
26
+ entityId: String<64>;
27
+ modi: Modi.Schema;
28
+ user?: User.Schema;
29
+ } & {
30
+ [A in ExpressionKey]?: any;
31
+ };
32
+ declare type AttrFilter<E> = {
33
+ id: Q_StringValue | SubQuery.ModiEntityIdSubQuery;
34
+ $$createAt$$: Q_DateValue;
35
+ $$updateAt$$: Q_DateValue;
36
+ modiId: Q_StringValue | SubQuery.ModiIdSubQuery;
37
+ modi: Modi.Filter;
38
+ entity: E;
39
+ entityId: Q_StringValue;
40
+ user: User.Filter;
41
+ };
42
+ export declare type Filter<E = Q_EnumValue<"user" | string>> = MakeFilter<AttrFilter<E> & ExprOp<OpAttr | string>>;
43
+ export declare type Projection = {
44
+ "#id"?: NodeId;
45
+ [k: string]: any;
46
+ id: 1;
47
+ $$createAt$$?: 1;
48
+ $$updateAt$$?: 1;
49
+ modiId?: 1;
50
+ modi?: Modi.Projection;
51
+ entity?: 1;
52
+ entityId?: 1;
53
+ user?: User.Projection;
54
+ } & Partial<ExprOp<OpAttr | string>>;
55
+ export declare type ExportProjection = {
56
+ "#id"?: NodeId;
57
+ [k: string]: any;
58
+ id?: string;
59
+ $$createAt$$?: string;
60
+ $$updateAt$$?: string;
61
+ modiId?: string;
62
+ modi?: Modi.ExportProjection;
63
+ entity?: string;
64
+ entityId?: string;
65
+ user?: User.ExportProjection;
66
+ } & Partial<ExprOp<OpAttr | string>>;
67
+ declare type ModiEntityIdProjection = OneOf<{
68
+ id: 1;
69
+ }>;
70
+ declare type ModiIdProjection = OneOf<{
71
+ modiId: 1;
72
+ }>;
73
+ declare type UserIdProjection = OneOf<{
74
+ entityId: 1;
75
+ }>;
76
+ export declare type SortAttr = {
77
+ id: 1;
78
+ } | {
79
+ $$createAt$$: 1;
80
+ } | {
81
+ $$updateAt$$: 1;
82
+ } | {
83
+ modiId: 1;
84
+ } | {
85
+ modi: Modi.SortAttr;
86
+ } | {
87
+ entity: 1;
88
+ } | {
89
+ entityId: 1;
90
+ } | {
91
+ user: User.SortAttr;
92
+ } | {
93
+ [k: string]: any;
94
+ } | OneOf<ExprOp<OpAttr | string>>;
95
+ export declare type SortNode = {
96
+ $attr: SortAttr;
97
+ $direction?: "asc" | "desc";
98
+ };
99
+ export declare type Sorter = SortNode[];
100
+ export declare type SelectOperation<P extends Object = Projection> = Omit<OakOperation<"select", P, Filter, Sorter>, "id">;
101
+ export declare type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
102
+ export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
103
+ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
104
+ modiId?: never;
105
+ modi: Modi.CreateSingleOperation;
106
+ } | {
107
+ modiId: String<64>;
108
+ modi?: Modi.UpdateOperation;
109
+ } | {
110
+ modiId: String<64>;
111
+ })) & ({
112
+ entity?: never;
113
+ entityId?: never;
114
+ user: User.CreateSingleOperation;
115
+ } | {
116
+ entity: "user";
117
+ entityId: String<64>;
118
+ user: User.UpdateOperation;
119
+ } | {
120
+ entity: "user";
121
+ entityId: String<64>;
122
+ } | {
123
+ entity?: string;
124
+ entityId?: string;
125
+ [K: string]: any;
126
+ });
127
+ export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
128
+ export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
129
+ export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
130
+ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
131
+ modi: Modi.CreateSingleOperation;
132
+ modiId?: never;
133
+ } | {
134
+ modi: Modi.UpdateOperation;
135
+ modiId?: never;
136
+ } | {
137
+ modi: Modi.RemoveOperation;
138
+ modiId?: never;
139
+ } | {
140
+ modi?: never;
141
+ modiId?: String<64> | null;
142
+ })) & ({
143
+ user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
144
+ entityId?: never;
145
+ entity?: never;
146
+ } | {
147
+ entity?: ("user" | string) | null;
148
+ entityId?: String<64> | null;
149
+ }) & {
150
+ [k: string]: any;
151
+ };
152
+ export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
153
+ export declare type RemoveOperationData = {} & (({
154
+ modi?: Modi.UpdateOperation | Modi.RemoveOperation;
155
+ })) & ({
156
+ user?: User.UpdateOperation | User.RemoveOperation;
157
+ } | {
158
+ [k: string]: any;
159
+ });
160
+ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
161
+ export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
162
+ export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
163
+ export declare type UserIdSubQuery = Selection<UserIdProjection>;
164
+ export declare type ModiEntityIdSubQuery = Selection<ModiEntityIdProjection>;
165
+ export declare type NativeAttr = OpAttr | `modi.${Modi.NativeAttr}` | `entity.${User.NativeAttr}`;
166
+ export declare type FullAttr = NativeAttr;
167
+ export declare type EntityDef = {
168
+ Schema: Schema;
169
+ OpSchema: OpSchema;
170
+ Action: OakMakeAction<AppendOnlyAction> | string;
171
+ Selection: Selection;
172
+ Operation: Operation;
173
+ Create: CreateOperation;
174
+ Update: UpdateOperation;
175
+ Remove: RemoveOperation;
176
+ CreateSingle: CreateSingleOperation;
177
+ CreateMulti: CreateMultipleOperation;
178
+ };
179
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { StorageDesc } from "../../types/Storage";
2
+ import { OpSchema } from "./Schema";
3
+ export declare const desc: StorageDesc<OpSchema>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.desc = void 0;
4
+ var action_1 = require("../../actions/action");
5
+ exports.desc = {
6
+ attributes: {
7
+ modiId: {
8
+ type: "ref",
9
+ ref: "modi"
10
+ },
11
+ entity: {
12
+ type: "varchar",
13
+ params: {
14
+ length: 32
15
+ }
16
+ },
17
+ entityId: {
18
+ type: "varchar",
19
+ params: {
20
+ length: 64
21
+ }
22
+ }
23
+ },
24
+ actionType: "appendOnly",
25
+ actions: action_1.appendOnlyActions
26
+ };