oak-domain 2.0.1 → 2.0.3
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 +16 -16
- package/lib/actions/action.js +17 -17
- package/lib/actions/relation.d.ts +1 -1
- package/lib/actions/relation.js +2 -2
- package/lib/base-app-domain/ActionDefDict.d.ts +5 -5
- package/lib/base-app-domain/ActionDefDict.js +7 -7
- package/lib/base-app-domain/EntityDict.d.ts +12 -12
- package/lib/base-app-domain/EntityDict.js +2 -2
- package/lib/base-app-domain/Modi/Action.d.ts +10 -10
- package/lib/base-app-domain/Modi/Action.js +14 -14
- package/lib/base-app-domain/Modi/Schema.d.ts +161 -161
- package/lib/base-app-domain/Modi/Schema.js +2 -2
- package/lib/base-app-domain/Modi/Storage.d.ts +3 -3
- package/lib/base-app-domain/Modi/Storage.js +60 -60
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +176 -176
- package/lib/base-app-domain/ModiEntity/Schema.js +2 -2
- package/lib/base-app-domain/ModiEntity/Storage.d.ts +3 -3
- package/lib/base-app-domain/ModiEntity/Storage.js +26 -26
- package/lib/base-app-domain/Oper/Schema.d.ts +158 -158
- package/lib/base-app-domain/Oper/Schema.js +2 -2
- package/lib/base-app-domain/Oper/Storage.d.ts +3 -3
- package/lib/base-app-domain/Oper/Storage.js +29 -29
- package/lib/base-app-domain/OperEntity/Schema.d.ts +193 -193
- package/lib/base-app-domain/OperEntity/Schema.js +2 -2
- package/lib/base-app-domain/OperEntity/Storage.d.ts +3 -3
- package/lib/base-app-domain/OperEntity/Storage.js +26 -26
- package/lib/base-app-domain/Storage.d.ts +3 -3
- package/lib/base-app-domain/Storage.js +15 -15
- package/lib/base-app-domain/User/Schema.d.ts +137 -137
- package/lib/base-app-domain/User/Schema.js +2 -2
- package/lib/base-app-domain/User/Storage.d.ts +3 -3
- package/lib/base-app-domain/User/Storage.js +25 -25
- package/lib/base-app-domain/_SubQuery.d.ts +36 -36
- package/lib/base-app-domain/_SubQuery.js +2 -2
- package/lib/base-app-domain/index.d.ts +3 -3
- package/lib/base-app-domain/index.js +6 -6
- package/lib/checkers/index.d.ts +5 -5
- package/lib/checkers/index.js +8 -8
- package/lib/compiler/env.d.ts +11 -11
- package/lib/compiler/env.js +39 -39
- package/lib/compiler/schemalBuilder.d.ts +2 -2
- package/lib/compiler/schemalBuilder.js +3137 -3137
- package/lib/compiler/uiBuilder.d.ts +1 -1
- package/lib/compiler/uiBuilder.js +3 -3
- package/lib/entities/Modi.d.ts +11 -11
- package/lib/entities/Modi.js +46 -46
- package/lib/entities/ModiEntity.d.ts +8 -8
- package/lib/entities/ModiEntity.js +15 -15
- package/lib/entities/Oper.d.ts +10 -10
- package/lib/entities/Oper.js +17 -17
- package/lib/entities/OperEntity.d.ts +8 -8
- package/lib/entities/OperEntity.js +15 -15
- package/lib/entities/User.d.ts +7 -7
- package/lib/entities/User.js +12 -12
- package/lib/store/AsyncRowStore.d.ts +45 -45
- package/lib/store/AsyncRowStore.js +180 -180
- package/lib/store/CascadeStore.d.ts +89 -89
- package/lib/store/CascadeStore.js +1515 -1511
- package/lib/store/SyncRowStore.d.ts +26 -26
- package/lib/store/SyncRowStore.js +45 -45
- package/lib/store/TriggerExecutor.d.ts +32 -32
- package/lib/store/TriggerExecutor.js +470 -470
- package/lib/store/actionDef.d.ts +9 -9
- package/lib/store/actionDef.js +135 -135
- package/lib/store/checker.d.ts +6 -6
- package/lib/store/checker.js +218 -165
- package/lib/store/filter.d.ts +99 -74
- package/lib/store/filter.js +855 -678
- package/lib/store/modi.d.ts +13 -13
- package/lib/store/modi.js +172 -172
- package/lib/store/relation.d.ts +13 -13
- package/lib/store/relation.js +64 -64
- package/lib/store/selection.d.ts +7 -7
- package/lib/store/selection.js +228 -228
- package/lib/triggers/index.d.ts +6 -6
- package/lib/triggers/index.js +11 -11
- package/lib/triggers/modi.d.ts +5 -5
- package/lib/triggers/modi.js +72 -72
- package/lib/types/Action.d.ts +14 -14
- package/lib/types/Action.js +2 -2
- package/lib/types/AppLoader.d.ts +11 -11
- package/lib/types/AppLoader.js +10 -10
- package/lib/types/Aspect.d.ts +12 -12
- package/lib/types/Aspect.js +4 -4
- package/lib/types/Auth.d.ts +57 -31
- package/lib/types/Auth.js +2 -2
- package/lib/types/Connector.d.ts +26 -26
- package/lib/types/Connector.js +9 -9
- package/lib/types/Context.d.ts +6 -6
- package/lib/types/Context.js +3 -3
- package/lib/types/DataType.d.ts +18 -18
- package/lib/types/DataType.js +5 -5
- package/lib/types/Demand.d.ts +77 -77
- package/lib/types/Demand.js +9 -9
- package/lib/types/Entity.d.ts +159 -159
- package/lib/types/Entity.js +15 -15
- package/lib/types/Exception.d.ts +83 -83
- package/lib/types/Exception.js +252 -252
- package/lib/types/Expression.d.ts +141 -141
- package/lib/types/Expression.js +387 -387
- package/lib/types/Geo.d.ts +18 -18
- package/lib/types/Geo.js +2 -2
- package/lib/types/Locale.d.ts +24 -24
- package/lib/types/Locale.js +2 -2
- package/lib/types/Logger.d.ts +5 -5
- package/lib/types/Logger.js +3 -3
- package/lib/types/Polyfill.d.ts +23 -23
- package/lib/types/Polyfill.js +2 -2
- package/lib/types/RowStore.d.ts +12 -12
- package/lib/types/RowStore.js +34 -34
- package/lib/types/Storage.d.ts +55 -55
- package/lib/types/Storage.js +2 -2
- package/lib/types/Trigger.d.ts +88 -89
- package/lib/types/Trigger.js +39 -39
- package/lib/types/Txn.d.ts +2 -2
- package/lib/types/Txn.js +3 -3
- package/lib/types/Watcher.d.ts +19 -19
- package/lib/types/Watcher.js +4 -4
- package/lib/types/index.d.ts +18 -18
- package/lib/types/index.js +21 -21
- package/lib/types/schema/DataTypes.d.ts +32 -32
- package/lib/types/schema/DataTypes.js +3 -3
- package/lib/utils/SimpleConnector.d.ts +30 -30
- package/lib/utils/SimpleConnector.js +102 -102
- package/lib/utils/assert.d.ts +5 -5
- package/lib/utils/assert.js +9 -9
- package/lib/utils/concurrent.d.ts +15 -15
- package/lib/utils/concurrent.js +89 -89
- package/lib/utils/geo.d.ts +4 -4
- package/lib/utils/geo.js +24 -24
- package/lib/utils/lodash.d.ts +5 -5
- package/lib/utils/lodash.js +38 -38
- package/lib/utils/random/random.d.ts +1 -1
- package/lib/utils/random/random.js +24 -24
- package/lib/utils/random/random.mp.d.ts +1 -1
- package/lib/utils/random/random.mp.js +25 -25
- package/lib/utils/random/random.web.d.ts +1 -1
- package/lib/utils/random/random.web.js +17 -17
- package/lib/utils/string.d.ts +22 -22
- package/lib/utils/string.js +70 -70
- package/lib/utils/uuid.d.ts +12 -12
- package/lib/utils/uuid.js +182 -182
- package/lib/utils/validator.d.ts +23 -23
- package/lib/utils/validator.js +123 -123
- package/package.json +47 -46
- package/src/entities/Modi.ts +68 -68
- package/src/entities/ModiEntity.ts +24 -24
- package/src/entities/Oper.ts +28 -28
- package/src/entities/OperEntity.ts +24 -24
- package/src/entities/User.ts +19 -19
package/lib/types/Action.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { EntityDict } from "./Entity";
|
|
2
|
-
export declare type Action = string;
|
|
3
|
-
export declare type State = string;
|
|
4
|
-
export declare type ActionDef<A extends Action, S extends State> = {
|
|
5
|
-
stm: {
|
|
6
|
-
[a in A]: [p: S | S[], n: S];
|
|
7
|
-
};
|
|
8
|
-
is?: S;
|
|
9
|
-
};
|
|
10
|
-
export declare type ActionDictOfEntityDict<E extends EntityDict> = {
|
|
11
|
-
[T in keyof E]?: {
|
|
12
|
-
[A in keyof E[T]['OpSchema']]?: ActionDef<string, string>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
1
|
+
import { EntityDict } from "./Entity";
|
|
2
|
+
export declare type Action = string;
|
|
3
|
+
export declare type State = string;
|
|
4
|
+
export declare type ActionDef<A extends Action, S extends State> = {
|
|
5
|
+
stm: {
|
|
6
|
+
[a in A]: [p: S | S[], n: S];
|
|
7
|
+
};
|
|
8
|
+
is?: S;
|
|
9
|
+
};
|
|
10
|
+
export declare type ActionDictOfEntityDict<E extends EntityDict> = {
|
|
11
|
+
[T in keyof E]?: {
|
|
12
|
+
[A in keyof E[T]['OpSchema']]?: ActionDef<string, string>;
|
|
13
|
+
};
|
|
14
|
+
};
|
package/lib/types/Action.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/types/AppLoader.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AsyncContext, AsyncRowStore } from "../store/AsyncRowStore";
|
|
2
|
-
import { EntityDict } from "./Entity";
|
|
3
|
-
export declare abstract class AppLoader<ED extends EntityDict, Cxt extends AsyncContext<ED>> {
|
|
4
|
-
protected path: string;
|
|
5
|
-
constructor(path: string);
|
|
6
|
-
abstract execAspect(name: string, context: Cxt, params?: any): Promise<any>;
|
|
7
|
-
abstract initialize(dropIfExists?: boolean): Promise<void>;
|
|
8
|
-
abstract mount(): Promise<void>;
|
|
9
|
-
abstract unmount(): Promise<void>;
|
|
10
|
-
abstract getStore(): AsyncRowStore<ED, Cxt>;
|
|
11
|
-
}
|
|
1
|
+
import { AsyncContext, AsyncRowStore } from "../store/AsyncRowStore";
|
|
2
|
+
import { EntityDict } from "./Entity";
|
|
3
|
+
export declare abstract class AppLoader<ED extends EntityDict, Cxt extends AsyncContext<ED>> {
|
|
4
|
+
protected path: string;
|
|
5
|
+
constructor(path: string);
|
|
6
|
+
abstract execAspect(name: string, context: Cxt, params?: any): Promise<any>;
|
|
7
|
+
abstract initialize(dropIfExists?: boolean): Promise<void>;
|
|
8
|
+
abstract mount(): Promise<void>;
|
|
9
|
+
abstract unmount(): Promise<void>;
|
|
10
|
+
abstract getStore(): AsyncRowStore<ED, Cxt>;
|
|
11
|
+
}
|
package/lib/types/AppLoader.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AppLoader = void 0;
|
|
4
|
-
var AppLoader = /** @class */ (function () {
|
|
5
|
-
function AppLoader(path) {
|
|
6
|
-
this.path = path;
|
|
7
|
-
}
|
|
8
|
-
return AppLoader;
|
|
9
|
-
}());
|
|
10
|
-
exports.AppLoader = AppLoader;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppLoader = void 0;
|
|
4
|
+
var AppLoader = /** @class */ (function () {
|
|
5
|
+
function AppLoader(path) {
|
|
6
|
+
this.path = path;
|
|
7
|
+
}
|
|
8
|
+
return AppLoader;
|
|
9
|
+
}());
|
|
10
|
+
exports.AppLoader = AppLoader;
|
package/lib/types/Aspect.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { EntityDict } from "./Entity";
|
|
2
|
-
import { OpRecord } from "./Entity";
|
|
3
|
-
import { AsyncContext } from "../store/AsyncRowStore";
|
|
4
|
-
export interface Aspect<ED extends EntityDict, Cxt extends AsyncContext<ED>> {
|
|
5
|
-
(params: any, context: Cxt): Promise<any>;
|
|
6
|
-
}
|
|
7
|
-
export interface AspectWrapper<ED extends EntityDict, Cxt extends AsyncContext<ED>, AD extends Record<string, Aspect<ED, Cxt>>> {
|
|
8
|
-
exec: <T extends keyof AD>(name: T, params: Parameters<AD[T]>[0]) => Promise<{
|
|
9
|
-
result: Awaited<ReturnType<AD[T]>>;
|
|
10
|
-
opRecords: OpRecord<ED>[];
|
|
11
|
-
}>;
|
|
12
|
-
}
|
|
1
|
+
import { EntityDict } from "./Entity";
|
|
2
|
+
import { OpRecord } from "./Entity";
|
|
3
|
+
import { AsyncContext } from "../store/AsyncRowStore";
|
|
4
|
+
export interface Aspect<ED extends EntityDict, Cxt extends AsyncContext<ED>> {
|
|
5
|
+
(params: any, context: Cxt): Promise<any>;
|
|
6
|
+
}
|
|
7
|
+
export interface AspectWrapper<ED extends EntityDict, Cxt extends AsyncContext<ED>, AD extends Record<string, Aspect<ED, Cxt>>> {
|
|
8
|
+
exec: <T extends keyof AD>(name: T, params: Parameters<AD[T]>[0]) => Promise<{
|
|
9
|
+
result: Awaited<ReturnType<AD[T]>>;
|
|
10
|
+
opRecords: OpRecord<ED>[];
|
|
11
|
+
}>;
|
|
12
|
+
}
|
package/lib/types/Aspect.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
;
|
|
4
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
;
|
|
4
|
+
;
|
package/lib/types/Auth.d.ts
CHANGED
|
@@ -1,31 +1,57 @@
|
|
|
1
|
-
import { AsyncContext } from "../store/AsyncRowStore";
|
|
2
|
-
import { SyncContext } from "../store/SyncRowStore";
|
|
3
|
-
import { EntityDict, OperateOption, SelectOption } from "../types/Entity";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { AsyncContext } from "../store/AsyncRowStore";
|
|
2
|
+
import { SyncContext } from "../store/SyncRowStore";
|
|
3
|
+
import { EntityDict, OperateOption, SelectOption } from "../types/Entity";
|
|
4
|
+
import { RefOrExpression } from "./Expression";
|
|
5
|
+
export declare type CheckerType = 'relation' | 'row' | 'data' | 'expression' | 'expressionRelation';
|
|
6
|
+
export declare type DataChecker<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = {
|
|
7
|
+
priority?: number;
|
|
8
|
+
type: 'data';
|
|
9
|
+
entity: T;
|
|
10
|
+
action: Omit<ED[T]['Action'], 'remove'>;
|
|
11
|
+
checker: (data: ED[T]['Create']['data'] | ED[T]['Update']['data'], context: Cxt) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare type RowChecker<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = {
|
|
14
|
+
priority?: number;
|
|
15
|
+
type: 'row';
|
|
16
|
+
entity: T;
|
|
17
|
+
action: Omit<ED[T]['Action'], 'create'> | Array<Omit<ED[T]['Action'], 'create'>>;
|
|
18
|
+
filter: ED[T]['Selection']['filter'] | ((operation: ED[T]['Operation'] | ED[T]['Selection'], context: Cxt, option: OperateOption | SelectOption) => ED[T]['Selection']['filter']);
|
|
19
|
+
errMsg?: string;
|
|
20
|
+
inconsistentRows?: {
|
|
21
|
+
entity: keyof ED;
|
|
22
|
+
selection: (filter?: ED[T]['Selection']['filter']) => ED[keyof ED]['Selection'];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare type RelationChecker<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = {
|
|
26
|
+
priority?: number;
|
|
27
|
+
type: 'relation';
|
|
28
|
+
entity: T;
|
|
29
|
+
action: Omit<ED[T]['Action'], 'create'> | Array<Omit<ED[T]['Action'], 'create'>>;
|
|
30
|
+
relationFilter: (operation: ED[T]['Operation'] | ED[T]['Selection'], context: Cxt, option: OperateOption | SelectOption) => ED[T]['Selection']['filter'];
|
|
31
|
+
errMsg: string;
|
|
32
|
+
};
|
|
33
|
+
export declare type ExpressionChecker<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = {
|
|
34
|
+
priority?: number;
|
|
35
|
+
type: 'expression';
|
|
36
|
+
entity: T;
|
|
37
|
+
action: ED[T]['Action'] | Array<ED[T]['Action']>;
|
|
38
|
+
expression: <T2 extends keyof ED>(operation: ED[T]['Operation'] | ED[T]['Selection'], context: Cxt, option: OperateOption | SelectOption) => {
|
|
39
|
+
entity: T2;
|
|
40
|
+
expr: RefOrExpression<keyof ED[T2]['OpSchema']>;
|
|
41
|
+
filter: ED[T2]['Selection']['filter'];
|
|
42
|
+
};
|
|
43
|
+
errMsg: string;
|
|
44
|
+
};
|
|
45
|
+
export declare type ExpressionRelationChecker<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = {
|
|
46
|
+
priority?: number;
|
|
47
|
+
type: 'expressionRelation';
|
|
48
|
+
entity: T;
|
|
49
|
+
action: ED[T]['Action'] | Array<ED[T]['Action']>;
|
|
50
|
+
expression: <T2 extends keyof ED>(operation: ED[T]['Operation'] | ED[T]['Selection'], context: Cxt, option: OperateOption | SelectOption) => {
|
|
51
|
+
entity: T2;
|
|
52
|
+
expr: RefOrExpression<keyof ED[T2]['OpSchema']>;
|
|
53
|
+
filter: ED[T2]['Selection']['filter'];
|
|
54
|
+
};
|
|
55
|
+
errMsg: string;
|
|
56
|
+
};
|
|
57
|
+
export declare type Checker<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = DataChecker<ED, T, Cxt> | RowChecker<ED, T, Cxt> | RelationChecker<ED, T, Cxt> | ExpressionChecker<ED, T, Cxt> | ExpressionRelationChecker<ED, T, Cxt>;
|
package/lib/types/Auth.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/types/Connector.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IncomingHttpHeaders } from "http";
|
|
3
|
-
import { AsyncContext, AsyncRowStore } from "../store/AsyncRowStore";
|
|
4
|
-
import { SyncContext } from "../store/SyncRowStore";
|
|
5
|
-
import { EntityDict, OpRecord } from "./Entity";
|
|
6
|
-
import { OakException } from "./Exception";
|
|
7
|
-
export declare abstract class Connector<ED extends EntityDict, BackCxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>> {
|
|
8
|
-
abstract callAspect(name: string, params: any, context: FrontCxt): Promise<{
|
|
9
|
-
result: any;
|
|
10
|
-
opRecords: OpRecord<ED>[];
|
|
11
|
-
}>;
|
|
12
|
-
abstract getRouter(): string;
|
|
13
|
-
abstract parseRequest(headers: IncomingHttpHeaders, body: any, store: AsyncRowStore<ED, BackCxt>): Promise<{
|
|
14
|
-
name: string;
|
|
15
|
-
params: any;
|
|
16
|
-
context: BackCxt;
|
|
17
|
-
}>;
|
|
18
|
-
abstract serializeResult(result: any, context: BackCxt, headers: IncomingHttpHeaders, body: any): {
|
|
19
|
-
body: any;
|
|
20
|
-
headers?: Record<string, any>;
|
|
21
|
-
};
|
|
22
|
-
abstract serializeException(exception: OakException, headers: IncomingHttpHeaders, body: any): {
|
|
23
|
-
body: any;
|
|
24
|
-
headers?: Record<string, any>;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IncomingHttpHeaders } from "http";
|
|
3
|
+
import { AsyncContext, AsyncRowStore } from "../store/AsyncRowStore";
|
|
4
|
+
import { SyncContext } from "../store/SyncRowStore";
|
|
5
|
+
import { EntityDict, OpRecord } from "./Entity";
|
|
6
|
+
import { OakException } from "./Exception";
|
|
7
|
+
export declare abstract class Connector<ED extends EntityDict, BackCxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>> {
|
|
8
|
+
abstract callAspect(name: string, params: any, context: FrontCxt): Promise<{
|
|
9
|
+
result: any;
|
|
10
|
+
opRecords: OpRecord<ED>[];
|
|
11
|
+
}>;
|
|
12
|
+
abstract getRouter(): string;
|
|
13
|
+
abstract parseRequest(headers: IncomingHttpHeaders, body: any, store: AsyncRowStore<ED, BackCxt>): Promise<{
|
|
14
|
+
name: string;
|
|
15
|
+
params: any;
|
|
16
|
+
context: BackCxt;
|
|
17
|
+
}>;
|
|
18
|
+
abstract serializeResult(result: any, context: BackCxt, headers: IncomingHttpHeaders, body: any): {
|
|
19
|
+
body: any;
|
|
20
|
+
headers?: Record<string, any>;
|
|
21
|
+
};
|
|
22
|
+
abstract serializeException(exception: OakException, headers: IncomingHttpHeaders, body: any): {
|
|
23
|
+
body: any;
|
|
24
|
+
headers?: Record<string, any>;
|
|
25
|
+
};
|
|
26
|
+
}
|
package/lib/types/Connector.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Connector = void 0;
|
|
4
|
-
var Connector = /** @class */ (function () {
|
|
5
|
-
function Connector() {
|
|
6
|
-
}
|
|
7
|
-
return Connector;
|
|
8
|
-
}());
|
|
9
|
-
exports.Connector = Connector;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Connector = void 0;
|
|
4
|
+
var Connector = /** @class */ (function () {
|
|
5
|
+
function Connector() {
|
|
6
|
+
}
|
|
7
|
+
return Connector;
|
|
8
|
+
}());
|
|
9
|
+
exports.Connector = Connector;
|
package/lib/types/Context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface Context {
|
|
2
|
-
getCurrentTxnId(): string | undefined;
|
|
3
|
-
getCurrentUserId(allowUnloggedIn?: boolean): string | undefined;
|
|
4
|
-
isRoot(): boolean;
|
|
5
|
-
toString(): string;
|
|
6
|
-
}
|
|
1
|
+
export interface Context {
|
|
2
|
+
getCurrentTxnId(): string | undefined;
|
|
3
|
+
getCurrentUserId(allowUnloggedIn?: boolean): string | undefined;
|
|
4
|
+
isRoot(): boolean;
|
|
5
|
+
toString(): string;
|
|
6
|
+
}
|
package/lib/types/Context.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
;
|
package/lib/types/DataType.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Geo, SingleGeo } from "./Geo";
|
|
2
|
-
export declare type Int<L extends 1 | 2 | 4 | 8> = number;
|
|
3
|
-
export declare type Uint<L extends 1 | 2 | 4 | 8> = number;
|
|
4
|
-
export declare type Double<P extends number, S extends number> = number;
|
|
5
|
-
export declare type Float<P extends number, S extends number> = number;
|
|
6
|
-
export declare type String<L extends number> = string;
|
|
7
|
-
export declare type Text = string;
|
|
8
|
-
export declare type Image = string;
|
|
9
|
-
export declare type File = string;
|
|
10
|
-
export declare type Datetime = number | Date;
|
|
11
|
-
export declare type Boolean = boolean;
|
|
12
|
-
export declare type PrimaryKey = string;
|
|
13
|
-
export declare type ForeignKey<E extends string> = string;
|
|
14
|
-
export declare type Sequence = string;
|
|
15
|
-
export { Geo, SingleGeo } from './Geo';
|
|
16
|
-
export declare type DataTypes = number | string | Datetime | Geo | Object | SingleGeo;
|
|
17
|
-
export declare const types: string[];
|
|
18
|
-
export declare const unIndexedTypes: string[];
|
|
1
|
+
import { Geo, SingleGeo } from "./Geo";
|
|
2
|
+
export declare type Int<L extends 1 | 2 | 4 | 8> = number;
|
|
3
|
+
export declare type Uint<L extends 1 | 2 | 4 | 8> = number;
|
|
4
|
+
export declare type Double<P extends number, S extends number> = number;
|
|
5
|
+
export declare type Float<P extends number, S extends number> = number;
|
|
6
|
+
export declare type String<L extends number> = string;
|
|
7
|
+
export declare type Text = string;
|
|
8
|
+
export declare type Image = string;
|
|
9
|
+
export declare type File = string;
|
|
10
|
+
export declare type Datetime = number | Date;
|
|
11
|
+
export declare type Boolean = boolean;
|
|
12
|
+
export declare type PrimaryKey = string;
|
|
13
|
+
export declare type ForeignKey<E extends string> = string;
|
|
14
|
+
export declare type Sequence = string;
|
|
15
|
+
export { Geo, SingleGeo } from './Geo';
|
|
16
|
+
export declare type DataTypes = number | string | Datetime | Geo | Object | SingleGeo;
|
|
17
|
+
export declare const types: string[];
|
|
18
|
+
export declare const unIndexedTypes: string[];
|
package/lib/types/DataType.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unIndexedTypes = exports.types = void 0;
|
|
4
|
-
exports.types = ['Int', 'Uint', 'Double', 'Float', 'String', 'Text', 'Datetime', 'Boolean', 'Image', 'File', 'Geo', 'SingleGeo'];
|
|
5
|
-
exports.unIndexedTypes = ['Text', 'Image', 'File', 'Object'];
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unIndexedTypes = exports.types = void 0;
|
|
4
|
+
exports.types = ['Int', 'Uint', 'Double', 'Float', 'String', 'Text', 'Datetime', 'Boolean', 'Image', 'File', 'Geo', 'SingleGeo'];
|
|
5
|
+
exports.unIndexedTypes = ['Text', 'Image', 'File', 'Object'];
|
package/lib/types/Demand.d.ts
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { RefOrExpression } from "./Expression";
|
|
2
|
-
import { OneOf } from "./Polyfill";
|
|
3
|
-
export declare const EXPRESSION_PREFIX = "$expr";
|
|
4
|
-
export declare type NodeId = `node-${number}`;
|
|
5
|
-
export declare type ExpressionKey = '$expr' | '$expr1' | '$expr2' | '$expr3' | '$expr4' | '$expr5' | '$expr6' | '$expr7' | '$expr8' | '$expr9' | '$expr10' | '$expr11' | '$expr12' | '$expr13' | '$expr14' | '$expr15' | '$expr16' | '$expr17' | '$expr18' | '$expr19' | '$expr20';
|
|
6
|
-
export declare type ExprOp<A> = {
|
|
7
|
-
[K in ExpressionKey]: RefOrExpression<A>;
|
|
8
|
-
};
|
|
9
|
-
export declare type Q_NumberComparisonValue = number | OneOf<{
|
|
10
|
-
$gt: number;
|
|
11
|
-
$lt: number;
|
|
12
|
-
$gte: number;
|
|
13
|
-
$lte: number;
|
|
14
|
-
$eq: number;
|
|
15
|
-
$ne: number;
|
|
16
|
-
$in: number[];
|
|
17
|
-
$nin: number[];
|
|
18
|
-
$between: [number, number];
|
|
19
|
-
}>;
|
|
20
|
-
export declare type Q_StringComparisonValue = string | OneOf<{
|
|
21
|
-
$gt: string;
|
|
22
|
-
$lt: string;
|
|
23
|
-
$gte: string;
|
|
24
|
-
$lte: string;
|
|
25
|
-
$eq: string;
|
|
26
|
-
$ne: string;
|
|
27
|
-
$startsWith: string;
|
|
28
|
-
$endsWith: string;
|
|
29
|
-
$includes: string;
|
|
30
|
-
$in: string[];
|
|
31
|
-
$nin: string[];
|
|
32
|
-
}>;
|
|
33
|
-
export declare type Q_BooleanComparisonValue = boolean;
|
|
34
|
-
export declare type Q_DateComparisonValue = Q_NumberComparisonValue;
|
|
35
|
-
export declare type Q_EnumComparisonValue<E> = E | OneOf<{
|
|
36
|
-
$in: E[];
|
|
37
|
-
$nin: E[];
|
|
38
|
-
}>;
|
|
39
|
-
export declare type Q_ExistsValue = {
|
|
40
|
-
$exists: boolean;
|
|
41
|
-
};
|
|
42
|
-
export declare type Q_NumberValue = Q_NumberComparisonValue | Q_ExistsValue;
|
|
43
|
-
export declare type Q_StringValue = Q_StringComparisonValue | Q_ExistsValue;
|
|
44
|
-
export declare type Q_BooleanValue = Q_BooleanComparisonValue | Q_ExistsValue;
|
|
45
|
-
export declare type Q_DateValue = Q_DateComparisonValue | Q_ExistsValue;
|
|
46
|
-
export declare type Q_EnumValue<E> = Q_EnumComparisonValue<E> | Q_ExistsValue;
|
|
47
|
-
export declare type Q_State<S> = S | {
|
|
48
|
-
$in: S[];
|
|
49
|
-
} | {
|
|
50
|
-
$nin: S[];
|
|
51
|
-
} | Q_ExistsValue;
|
|
52
|
-
export declare type Q_FullTextValue = {
|
|
53
|
-
$search: string;
|
|
54
|
-
$language?: 'zh_CN' | 'en_US';
|
|
55
|
-
};
|
|
56
|
-
export declare type Q_FullTextKey = '$text';
|
|
57
|
-
export declare type FulltextFilter = {
|
|
58
|
-
[F in Q_FullTextKey]?: Q_FullTextValue;
|
|
59
|
-
};
|
|
60
|
-
declare type Q_LogicKey = '$and' | '$or';
|
|
61
|
-
declare type Q_LinearLogicKey = '$not';
|
|
62
|
-
export declare type MakeFilterWrapper<F extends Object> = {
|
|
63
|
-
[Q in Q_LogicKey]?: Array<MakeFilterWrapper<F>>;
|
|
64
|
-
} & {
|
|
65
|
-
[Q in Q_LinearLogicKey]?: MakeFilterWrapper<F>;
|
|
66
|
-
} & Partial<F>;
|
|
67
|
-
export declare type MakeFilter<F extends Object> = {
|
|
68
|
-
'#id'?: NodeId;
|
|
69
|
-
} & MakeFilterWrapper<F>;
|
|
70
|
-
export declare type RefAttr<A> = {
|
|
71
|
-
'#attr': A;
|
|
72
|
-
} | {
|
|
73
|
-
'#refId': NodeId;
|
|
74
|
-
'#refAttr': string;
|
|
75
|
-
};
|
|
76
|
-
export declare function isRefAttrNode<A>(node: any): node is RefAttr<A>;
|
|
77
|
-
export {};
|
|
1
|
+
import { RefOrExpression } from "./Expression";
|
|
2
|
+
import { OneOf } from "./Polyfill";
|
|
3
|
+
export declare const EXPRESSION_PREFIX = "$expr";
|
|
4
|
+
export declare type NodeId = `node-${number}`;
|
|
5
|
+
export declare type ExpressionKey = '$expr' | '$expr1' | '$expr2' | '$expr3' | '$expr4' | '$expr5' | '$expr6' | '$expr7' | '$expr8' | '$expr9' | '$expr10' | '$expr11' | '$expr12' | '$expr13' | '$expr14' | '$expr15' | '$expr16' | '$expr17' | '$expr18' | '$expr19' | '$expr20';
|
|
6
|
+
export declare type ExprOp<A> = {
|
|
7
|
+
[K in ExpressionKey]: RefOrExpression<A>;
|
|
8
|
+
};
|
|
9
|
+
export declare type Q_NumberComparisonValue = number | OneOf<{
|
|
10
|
+
$gt: number;
|
|
11
|
+
$lt: number;
|
|
12
|
+
$gte: number;
|
|
13
|
+
$lte: number;
|
|
14
|
+
$eq: number;
|
|
15
|
+
$ne: number;
|
|
16
|
+
$in: number[];
|
|
17
|
+
$nin: number[];
|
|
18
|
+
$between: [number, number];
|
|
19
|
+
}>;
|
|
20
|
+
export declare type Q_StringComparisonValue = string | OneOf<{
|
|
21
|
+
$gt: string;
|
|
22
|
+
$lt: string;
|
|
23
|
+
$gte: string;
|
|
24
|
+
$lte: string;
|
|
25
|
+
$eq: string;
|
|
26
|
+
$ne: string;
|
|
27
|
+
$startsWith: string;
|
|
28
|
+
$endsWith: string;
|
|
29
|
+
$includes: string;
|
|
30
|
+
$in: string[];
|
|
31
|
+
$nin: string[];
|
|
32
|
+
}>;
|
|
33
|
+
export declare type Q_BooleanComparisonValue = boolean;
|
|
34
|
+
export declare type Q_DateComparisonValue = Q_NumberComparisonValue;
|
|
35
|
+
export declare type Q_EnumComparisonValue<E> = E | OneOf<{
|
|
36
|
+
$in: E[];
|
|
37
|
+
$nin: E[];
|
|
38
|
+
}>;
|
|
39
|
+
export declare type Q_ExistsValue = {
|
|
40
|
+
$exists: boolean;
|
|
41
|
+
};
|
|
42
|
+
export declare type Q_NumberValue = Q_NumberComparisonValue | Q_ExistsValue;
|
|
43
|
+
export declare type Q_StringValue = Q_StringComparisonValue | Q_ExistsValue;
|
|
44
|
+
export declare type Q_BooleanValue = Q_BooleanComparisonValue | Q_ExistsValue;
|
|
45
|
+
export declare type Q_DateValue = Q_DateComparisonValue | Q_ExistsValue;
|
|
46
|
+
export declare type Q_EnumValue<E> = Q_EnumComparisonValue<E> | Q_ExistsValue;
|
|
47
|
+
export declare type Q_State<S> = S | {
|
|
48
|
+
$in: S[];
|
|
49
|
+
} | {
|
|
50
|
+
$nin: S[];
|
|
51
|
+
} | Q_ExistsValue;
|
|
52
|
+
export declare type Q_FullTextValue = {
|
|
53
|
+
$search: string;
|
|
54
|
+
$language?: 'zh_CN' | 'en_US';
|
|
55
|
+
};
|
|
56
|
+
export declare type Q_FullTextKey = '$text';
|
|
57
|
+
export declare type FulltextFilter = {
|
|
58
|
+
[F in Q_FullTextKey]?: Q_FullTextValue;
|
|
59
|
+
};
|
|
60
|
+
declare type Q_LogicKey = '$and' | '$or';
|
|
61
|
+
declare type Q_LinearLogicKey = '$not';
|
|
62
|
+
export declare type MakeFilterWrapper<F extends Object> = {
|
|
63
|
+
[Q in Q_LogicKey]?: Array<MakeFilterWrapper<F>>;
|
|
64
|
+
} & {
|
|
65
|
+
[Q in Q_LinearLogicKey]?: MakeFilterWrapper<F>;
|
|
66
|
+
} & Partial<F>;
|
|
67
|
+
export declare type MakeFilter<F extends Object> = {
|
|
68
|
+
'#id'?: NodeId;
|
|
69
|
+
} & MakeFilterWrapper<F>;
|
|
70
|
+
export declare type RefAttr<A> = {
|
|
71
|
+
'#attr': A;
|
|
72
|
+
} | {
|
|
73
|
+
'#refId': NodeId;
|
|
74
|
+
'#refAttr': string;
|
|
75
|
+
};
|
|
76
|
+
export declare function isRefAttrNode<A>(node: any): node is RefAttr<A>;
|
|
77
|
+
export {};
|
package/lib/types/Demand.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRefAttrNode = exports.EXPRESSION_PREFIX = void 0;
|
|
4
|
-
exports.EXPRESSION_PREFIX = '$expr';
|
|
5
|
-
function isRefAttrNode(node) {
|
|
6
|
-
return node.hasOwnProperty('#attr') || (node.hasOwnProperty('#refId') && node.hasOwnProperty('#refAttr'));
|
|
7
|
-
}
|
|
8
|
-
exports.isRefAttrNode = isRefAttrNode;
|
|
9
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRefAttrNode = exports.EXPRESSION_PREFIX = void 0;
|
|
4
|
+
exports.EXPRESSION_PREFIX = '$expr';
|
|
5
|
+
function isRefAttrNode(node) {
|
|
6
|
+
return node.hasOwnProperty('#attr') || (node.hasOwnProperty('#refId') && node.hasOwnProperty('#refAttr'));
|
|
7
|
+
}
|
|
8
|
+
exports.isRefAttrNode = isRefAttrNode;
|
|
9
|
+
;
|