oak-domain 1.0.0
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/OakError.d.ts +7 -0
- package/lib/OakError.js +29 -0
- package/lib/actions/action.d.ts +6 -0
- package/lib/actions/action.js +12 -0
- package/lib/actions/relation.d.ts +1 -0
- package/lib/actions/relation.js +2 -0
- package/lib/compiler/env.d.ts +10 -0
- package/lib/compiler/env.js +26 -0
- package/lib/compiler/schemalBuilder.d.ts +2 -0
- package/lib/compiler/schemalBuilder.js +2738 -0
- package/lib/compiler/uiBuilder.d.ts +1 -0
- package/lib/compiler/uiBuilder.js +3 -0
- package/lib/compiler/utils.d.ts +2 -0
- package/lib/compiler/utils.js +11 -0
- package/lib/store/CascadeStore.d.ts +38 -0
- package/lib/store/CascadeStore.js +681 -0
- package/lib/store/TriggerExecutor.d.ts +30 -0
- package/lib/store/TriggerExecutor.js +549 -0
- package/lib/store/UniversalContext.d.ts +26 -0
- package/lib/store/UniversalContext.js +208 -0
- package/lib/store/actionDef.d.ts +8 -0
- package/lib/store/actionDef.js +241 -0
- package/lib/store/filter.d.ts +36 -0
- package/lib/store/filter.js +121 -0
- package/lib/store/relation.d.ts +13 -0
- package/lib/store/relation.js +64 -0
- package/lib/store/watchers.d.ts +2 -0
- package/lib/store/watchers.js +32 -0
- package/lib/types/Action.d.ts +14 -0
- package/lib/types/Action.js +2 -0
- package/lib/types/AppLoader.d.ts +11 -0
- package/lib/types/AppLoader.js +10 -0
- package/lib/types/Aspect.d.ts +12 -0
- package/lib/types/Aspect.js +4 -0
- package/lib/types/Auth.d.ts +28 -0
- package/lib/types/Auth.js +2 -0
- package/lib/types/Connector.d.ts +26 -0
- package/lib/types/Connector.js +9 -0
- package/lib/types/Context.d.ts +14 -0
- package/lib/types/Context.js +3 -0
- package/lib/types/DataType.d.ts +17 -0
- package/lib/types/DataType.js +5 -0
- package/lib/types/Demand.d.ts +77 -0
- package/lib/types/Demand.js +9 -0
- package/lib/types/Entity.d.ts +138 -0
- package/lib/types/Entity.js +8 -0
- package/lib/types/Exception.d.ts +48 -0
- package/lib/types/Exception.js +178 -0
- package/lib/types/Expression.d.ts +132 -0
- package/lib/types/Expression.js +378 -0
- package/lib/types/Geo.d.ts +18 -0
- package/lib/types/Geo.js +2 -0
- package/lib/types/Locale.d.ts +24 -0
- package/lib/types/Locale.js +2 -0
- package/lib/types/Logger.d.ts +5 -0
- package/lib/types/Logger.js +3 -0
- package/lib/types/Polyfill.d.ts +23 -0
- package/lib/types/Polyfill.js +2 -0
- package/lib/types/RowStore.d.ts +22 -0
- package/lib/types/RowStore.js +33 -0
- package/lib/types/Storage.d.ts +48 -0
- package/lib/types/Storage.js +2 -0
- package/lib/types/Trigger.d.ts +105 -0
- package/lib/types/Trigger.js +24 -0
- package/lib/types/Txn.d.ts +2 -0
- package/lib/types/Txn.js +3 -0
- package/lib/types/Watcher.d.ts +19 -0
- package/lib/types/Watcher.js +4 -0
- package/lib/types/index.d.ts +18 -0
- package/lib/types/index.js +30 -0
- package/lib/types/schema/DataTypes.d.ts +32 -0
- package/lib/types/schema/DataTypes.js +3 -0
- package/lib/utils/SimpleConnector.d.ts +29 -0
- package/lib/utils/SimpleConnector.js +145 -0
- package/lib/utils/assert.d.ts +5 -0
- package/lib/utils/assert.js +11 -0
- package/lib/utils/concurrent.d.ts +15 -0
- package/lib/utils/concurrent.js +138 -0
- package/lib/utils/geo.d.ts +4 -0
- package/lib/utils/geo.js +24 -0
- package/lib/utils/lodash.d.ts +16 -0
- package/lib/utils/lodash.js +32 -0
- package/lib/utils/string.d.ts +2 -0
- package/lib/utils/string.js +11 -0
- package/lib/utils/uuid.d.ts +2 -0
- package/lib/utils/uuid.js +11 -0
- package/lib/utils/validator.d.ts +23 -0
- package/lib/utils/validator.js +123 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare function outputElement(): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.firstLetterUpperCase = exports.firstLetterLowerCase = void 0;
|
|
4
|
+
function firstLetterLowerCase(s) {
|
|
5
|
+
return s.slice(0, 1).toLowerCase().concat(s.slice(1));
|
|
6
|
+
}
|
|
7
|
+
exports.firstLetterLowerCase = firstLetterLowerCase;
|
|
8
|
+
function firstLetterUpperCase(s) {
|
|
9
|
+
return s.slice(0, 1).toUpperCase().concat(s.slice(1));
|
|
10
|
+
}
|
|
11
|
+
exports.firstLetterUpperCase = firstLetterUpperCase;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Context } from '../types/Context';
|
|
2
|
+
import { DeduceCreateMultipleOperation, DeduceCreateOperation, DeduceCreateSingleOperation, DeduceRemoveOperation, DeduceUpdateOperation, EntityDict, OperateOption, SelectOption, OperationResult, SelectRowShape } from "../types/Entity";
|
|
3
|
+
import { RowStore } from '../types/RowStore';
|
|
4
|
+
import { StorageSchema } from '../types/Storage';
|
|
5
|
+
/**这个用来处理级联的select和update,对不同能力的 */
|
|
6
|
+
export declare abstract class CascadeStore<ED extends EntityDict, Cxt extends Context<ED>> extends RowStore<ED, Cxt> {
|
|
7
|
+
constructor(storageSchema: StorageSchema<ED>);
|
|
8
|
+
protected abstract supportManyToOneJoin(): boolean;
|
|
9
|
+
protected abstract supportMultipleCreate(): boolean;
|
|
10
|
+
protected abstract selectAbjointRow<T extends keyof ED, S extends ED[T]['Selection'], OP extends SelectOption>(entity: T, selection: S, context: Cxt, option?: OP): Promise<SelectRowShape<ED[T]['Schema'], S['data']>[]>;
|
|
11
|
+
protected abstract updateAbjointRow<T extends keyof ED, OP extends OperateOption>(entity: T, operation: DeduceCreateMultipleOperation<ED[T]['Schema']> | DeduceCreateSingleOperation<ED[T]['Schema']> | DeduceUpdateOperation<ED[T]['Schema']> | DeduceRemoveOperation<ED[T]['Schema']>, context: Cxt, option?: OP): Promise<number>;
|
|
12
|
+
protected cascadeSelect<T extends keyof ED, S extends ED[T]['Selection'], OP extends SelectOption>(entity: T, selection: S, context: Cxt, option?: OP): Promise<SelectRowShape<ED[T]['Schema'], S['data']>[]>;
|
|
13
|
+
/**
|
|
14
|
+
* 级联更新
|
|
15
|
+
* A --> B
|
|
16
|
+
多对一:A CREATE/B CREATE,B data的主键赋到A的data上
|
|
17
|
+
A CREATE/B UPDATE,B filter的主键来自A的data
|
|
18
|
+
A UPDATE/B CREATE,B data的主键赋到A的data上
|
|
19
|
+
A UPDATE/B UPDATE,B filter的主键来自A的row
|
|
20
|
+
A UPDATE/B REMOVE,B filter的主键来自A的row
|
|
21
|
+
A REMOVE/B UPDATE,B filter的主键来自A的row
|
|
22
|
+
A REMOVE/B REMOVE,B filter的主键来自A的row
|
|
23
|
+
|
|
24
|
+
一对多:A CREATE/B CREATE,A data上的主键赋到B的data上
|
|
25
|
+
A CREATE/B UPDATE,A data上的主键赋到B的data上
|
|
26
|
+
A UPDATE/B CREATE,A filter上的主键赋到B的data上(一定是带主键的filter)
|
|
27
|
+
A UPDATE/B UPDATE,A filter上的主键赋到B的filter上(一定是带主键的filter)
|
|
28
|
+
A UPDATE/B REMOVE,A filter上的主键赋到B的filter上(一定是带主键的filter)
|
|
29
|
+
A REMOVE/B UPDATE,A filter上的主键赋到B的filter上(且B关于A的外键清空)
|
|
30
|
+
A REMOVE/B REMOVE,A filter上的主键赋到B的filter上
|
|
31
|
+
* @param entity
|
|
32
|
+
* @param operation
|
|
33
|
+
* @param context
|
|
34
|
+
* @param option
|
|
35
|
+
*/
|
|
36
|
+
protected cascadeUpdate<T extends keyof ED, OP extends OperateOption>(entity: T, operation: DeduceCreateOperation<ED[T]['Schema']> | DeduceUpdateOperation<ED[T]['Schema']> | DeduceRemoveOperation<ED[T]['Schema']>, context: Cxt, option?: OP): Promise<OperationResult<ED>>;
|
|
37
|
+
judgeRelation(entity: keyof ED, attr: string): string | string[] | 1 | 0 | 2;
|
|
38
|
+
}
|