@byted-apaas/server-sdk-node 0.0.1-beta.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/LICENSE +7 -0
- package/NOTICE +3 -0
- package/README.md +1 -0
- package/application/application.d.ts +27 -0
- package/application/application.js +2 -0
- package/application/application.ts +40 -0
- package/application/function/function.d.ts +14 -0
- package/application/function/function.js +21 -0
- package/application/function/function.ts +37 -0
- package/application/impl/common.d.ts +2 -0
- package/application/impl/common.js +50 -0
- package/application/impl/common.ts +50 -0
- package/application/impl/impl.d.ts +16 -0
- package/application/impl/impl.js +38 -0
- package/application/impl/impl.ts +48 -0
- package/constants/constants.d.ts +10 -0
- package/constants/constants.js +15 -0
- package/constants/constants.ts +15 -0
- package/context/context.d.ts +74 -0
- package/context/context.js +25 -0
- package/context/context.ts +130 -0
- package/context/db/db.d.ts +73 -0
- package/context/db/db.js +4 -0
- package/context/db/db.ts +80 -0
- package/context/db/impl/IObject.d.ts +251 -0
- package/context/db/impl/IObject.js +5 -0
- package/context/db/impl/IObject.ts +247 -0
- package/context/db/impl/db.d.ts +61 -0
- package/context/db/impl/db.js +86 -0
- package/context/db/impl/db.ts +95 -0
- package/context/db/impl/object.d.ts +92 -0
- package/context/db/impl/object.js +524 -0
- package/context/db/impl/object.ts +631 -0
- package/context/db/impl/oql/ioql.d.ts +6 -0
- package/context/db/impl/oql/ioql.js +4 -0
- package/context/db/impl/oql/ioql.ts +9 -0
- package/context/db/impl/oql/oql.d.ts +8 -0
- package/context/db/impl/oql/oql.js +21 -0
- package/context/db/impl/oql/oql.ts +25 -0
- package/context/db/impl/order.d.ts +9 -0
- package/context/db/impl/order.js +15 -0
- package/context/db/impl/order.ts +19 -0
- package/context/db/impl/propertiesStore.d.ts +8 -0
- package/context/db/impl/propertiesStore.js +29 -0
- package/context/db/impl/propertiesStore.ts +31 -0
- package/context/db/impl/queryBuilder.d.ts +29 -0
- package/context/db/impl/queryBuilder.js +78 -0
- package/context/db/impl/queryBuilder.ts +106 -0
- package/context/db/impl/transaction/index.d.ts +20 -0
- package/context/db/impl/transaction/index.js +277 -0
- package/context/db/impl/transaction/index.ts +340 -0
- package/context/db/impl/transaction/operation.d.ts +27 -0
- package/context/db/impl/transaction/operation.js +69 -0
- package/context/db/impl/transaction/operation.ts +72 -0
- package/context/db/impl/transaction.d.ts +67 -0
- package/context/db/impl/transaction.js +4 -0
- package/context/db/impl/transaction.ts +79 -0
- package/context/globalConfig/globalConfig.d.ts +7 -0
- package/context/globalConfig/globalConfig.js +16 -0
- package/context/globalConfig/globalConfig.ts +14 -0
- package/context/metadata/components/common.d.ts +6 -0
- package/context/metadata/components/common.js +17 -0
- package/context/metadata/components/common.ts +22 -0
- package/context/metadata/components/components.d.ts +12 -0
- package/context/metadata/components/components.js +19 -0
- package/context/metadata/components/components.ts +22 -0
- package/context/metadata/components/desktop/list.d.ts +16 -0
- package/context/metadata/components/desktop/list.js +402 -0
- package/context/metadata/components/desktop/list.ts +457 -0
- package/context/metadata/components/desktop/recordDetail.d.ts +11 -0
- package/context/metadata/components/desktop/recordDetail.js +53 -0
- package/context/metadata/components/desktop/recordDetail.ts +67 -0
- package/context/metadata/components/mobile/list.d.ts +24 -0
- package/context/metadata/components/mobile/list.js +145 -0
- package/context/metadata/components/mobile/list.ts +179 -0
- package/context/metadata/metadata.d.ts +61 -0
- package/context/metadata/metadata.js +103 -0
- package/context/metadata/metadata.ts +178 -0
- package/context/metadata/objects/fields.d.ts +130 -0
- package/context/metadata/objects/fields.js +334 -0
- package/context/metadata/objects/fields.ts +457 -0
- package/context/metadata/objects/fields.util.d.ts +40 -0
- package/context/metadata/objects/fields.util.js +319 -0
- package/context/metadata/objects/fields.util.ts +360 -0
- package/context/metadata/objects/objects.d.ts +11 -0
- package/context/metadata/objects/objects.js +20 -0
- package/context/metadata/objects/objects.ts +30 -0
- package/context/metadata/types/common.d.ts +6 -0
- package/context/metadata/types/common.js +9 -0
- package/context/metadata/types/common.ts +13 -0
- package/context/metadata/types/components.d.ts +90 -0
- package/context/metadata/types/components.js +4 -0
- package/context/metadata/types/components.ts +108 -0
- package/context/metadata/types/objects.d.ts +226 -0
- package/context/metadata/types/objects.js +4 -0
- package/context/metadata/types/objects.ts +254 -0
- package/context/msg/msg.d.ts +38 -0
- package/context/msg/msg.js +35 -0
- package/context/msg/msg.ts +52 -0
- package/context/resources/IResources.d.ts +66 -0
- package/context/resources/IResources.js +2 -0
- package/context/resources/IResources.ts +73 -0
- package/context/resources/impl/resources.d.ts +42 -0
- package/context/resources/impl/resources.js +150 -0
- package/context/resources/impl/resources.ts +173 -0
- package/context/tasks/tasks.d.ts +33 -0
- package/context/tasks/tasks.js +139 -0
- package/context/tasks/tasks.ts +159 -0
- package/data/index.d.ts +27 -0
- package/data/index.js +4 -0
- package/data/index.ts +30 -0
- package/hooks/api.d.ts +61 -0
- package/hooks/api.js +327 -0
- package/hooks/api.ts +341 -0
- package/hooks/hooks.d.ts +1 -0
- package/hooks/hooks.js +88 -0
- package/hooks/hooks.ts +100 -0
- package/kunlun/kunlun.d.ts +55 -0
- package/kunlun/kunlun.js +58 -0
- package/kunlun/kunlun.ts +72 -0
- package/kunlun/operator/IOperator.d.ts +158 -0
- package/kunlun/operator/IOperator.js +4 -0
- package/kunlun/operator/IOperator.ts +166 -0
- package/kunlun/operator/impl/expression.d.ts +47 -0
- package/kunlun/operator/impl/expression.js +56 -0
- package/kunlun/operator/impl/expression.ts +74 -0
- package/kunlun/operator/impl/logic.d.ts +50 -0
- package/kunlun/operator/impl/logic.js +509 -0
- package/kunlun/operator/impl/logic.ts +598 -0
- package/kunlun/operator/impl/logicV2.d.ts +58 -0
- package/kunlun/operator/impl/logicV2.js +200 -0
- package/kunlun/operator/impl/logicV2.ts +254 -0
- package/kunlun/operator/impl/operator.d.ts +179 -0
- package/kunlun/operator/impl/operator.js +222 -0
- package/kunlun/operator/impl/operator.ts +258 -0
- package/kunlun/operator/impl/operatorV2.d.ts +180 -0
- package/kunlun/operator/impl/operatorV2.js +216 -0
- package/kunlun/operator/impl/operatorV2.ts +249 -0
- package/lib/core.d.ts +4 -0
- package/lib/core.js +19 -0
- package/lib/core.ts +7 -0
- package/package.json +50 -0
- package/request/common.d.ts +13 -0
- package/request/common.js +87 -0
- package/request/common.ts +91 -0
- package/request/constants.d.ts +10 -0
- package/request/constants.js +25 -0
- package/request/constants.ts +25 -0
- package/request/faasinfra.d.ts +8 -0
- package/request/faasinfra.js +358 -0
- package/request/faasinfra.ts +393 -0
- package/request/innerapi.d.ts +67 -0
- package/request/innerapi.js +1412 -0
- package/request/innerapi.ts +1648 -0
- package/request/interface.d.ts +95 -0
- package/request/interface.js +41 -0
- package/request/interface.ts +169 -0
- package/request/openapi.d.ts +69 -0
- package/request/openapi.js +1014 -0
- package/request/openapi.ts +1223 -0
- package/types/types.d.ts +79 -0
- package/types/types.js +4 -0
- package/types/types.ts +108 -0
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare type _BooleanCond<T> = {};
|
|
2
|
+
export declare type _LogicalCond<T> = {};
|
|
3
|
+
declare type _LookupCond = number | {
|
|
4
|
+
_id: number;
|
|
5
|
+
};
|
|
6
|
+
declare type _MultiLookupCond = _LookupCond[];
|
|
7
|
+
declare type PartialCompositeType<T> = Partial<{
|
|
8
|
+
[K in keyof T]: T[K] extends _LookupField[] ? _MultiLookupCond : T[K] extends _LookupField ? _LookupCond : Partial<T[K]>;
|
|
9
|
+
}>;
|
|
10
|
+
declare type _FieldCond<T> = T extends _LookupField[] ? _MultiLookupCond : T extends _LookupField ? _LookupCond : PartialCompositeType<T>;
|
|
11
|
+
declare type _FirstLevelFieldCond<T> = Partial<{
|
|
12
|
+
[K in keyof T]: T[K] extends _LookupField ? _FieldCond<T[K]> : T[K];
|
|
13
|
+
}>;
|
|
14
|
+
declare type _KCond<T> = Partial<{
|
|
15
|
+
[K in keyof T]: _FieldCond<T[K]> | _BooleanCond<T[K]> | _LogicalCond<T[K]>;
|
|
16
|
+
}>;
|
|
17
|
+
declare type _WhereKCond<T> = Partial<{
|
|
18
|
+
[K in keyof T]: _FirstLevelFieldCond<T[K]> | _BooleanCond<T[K]> | _LogicalCond<T[K]>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare type _Cond<T> = _KCond<T> | _LogicalCond<Partial<T>>;
|
|
21
|
+
export declare type _WhereCond<T> = _WhereKCond<T> | _LogicalCond<Partial<T>>;
|
|
22
|
+
export declare type _Record<T> = {
|
|
23
|
+
[K in keyof T]: T[K] extends _LookupField ? _LookupFieldRet : T[K];
|
|
24
|
+
};
|
|
25
|
+
export declare type _CondRequireID<T> = _Cond<T> & {
|
|
26
|
+
_id: number;
|
|
27
|
+
};
|
|
28
|
+
interface _LookupFieldRet {
|
|
29
|
+
/**
|
|
30
|
+
* 名称:_id
|
|
31
|
+
*
|
|
32
|
+
* 类型:数字 / Number
|
|
33
|
+
*
|
|
34
|
+
* 格式:number
|
|
35
|
+
*/
|
|
36
|
+
_id: number;
|
|
37
|
+
/**
|
|
38
|
+
* 名称:角色名 / _name
|
|
39
|
+
*
|
|
40
|
+
* 类型:文本 / Text | 多语 / Multilingual
|
|
41
|
+
*
|
|
42
|
+
* 格式:string | {language_code: 1033|2052, text: string}[]
|
|
43
|
+
*/
|
|
44
|
+
_name: string | {
|
|
45
|
+
language_code: 1033 | 2052;
|
|
46
|
+
text: string;
|
|
47
|
+
}[];
|
|
48
|
+
is_deleted: boolean;
|
|
49
|
+
}
|
|
50
|
+
interface _LookupField {
|
|
51
|
+
_id: number;
|
|
52
|
+
}
|
|
53
|
+
import { metadataMap, currentObjApiName } from '../data/index';
|
|
54
|
+
/**
|
|
55
|
+
* target record 被使用于 workflow 场景下
|
|
56
|
+
*/
|
|
57
|
+
export interface TargetRecord {
|
|
58
|
+
/**
|
|
59
|
+
* workflow 被触发时,原始的记录信息
|
|
60
|
+
*/
|
|
61
|
+
original: metadataMap[currentObjApiName];
|
|
62
|
+
/**
|
|
63
|
+
* workflow 运行到当前位置的记录信息
|
|
64
|
+
*/
|
|
65
|
+
proposed: metadataMap[currentObjApiName];
|
|
66
|
+
}
|
|
67
|
+
export interface TriggerOld {
|
|
68
|
+
/**
|
|
69
|
+
* 更新前的记录数据
|
|
70
|
+
*/
|
|
71
|
+
old: metadataMap[currentObjApiName];
|
|
72
|
+
}
|
|
73
|
+
export interface TriggerNew {
|
|
74
|
+
/**
|
|
75
|
+
* 创建或更新后的记录数据
|
|
76
|
+
*/
|
|
77
|
+
new: metadataMap[currentObjApiName];
|
|
78
|
+
}
|
|
79
|
+
export {};
|
package/types/types.js
ADDED
package/types/types.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Copyright 2022 ByteDance Ltd. and/or its affiliates
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
// Condition 部分,用于声明在查询、操作符等场景使用的 条件、逻辑条件、布尔条件 和 字段条件
|
|
5
|
+
// 布尔类型条件
|
|
6
|
+
export type _BooleanCond<T> = {}
|
|
7
|
+
|
|
8
|
+
// 逻辑类型条件
|
|
9
|
+
export type _LogicalCond<T> = {}
|
|
10
|
+
|
|
11
|
+
// lookup 类型的条件,被改写为 number 或 仅包含 _id 属性的 object
|
|
12
|
+
type _LookupCond = number | { _id: number }
|
|
13
|
+
|
|
14
|
+
// 多值 lookup 类型的条件,改写为 number 或 仅包含 id 属性的 object 的数组
|
|
15
|
+
type _MultiLookupCond = _LookupCond[]
|
|
16
|
+
|
|
17
|
+
// 展开底层类型对象结构,在 Composite Type 的情况下,需要进行二次展开判断是否有单值或多值 Lookup
|
|
18
|
+
type PartialCompositeType<T> = Partial<{
|
|
19
|
+
[K in keyof T]: T[K] extends _LookupField[] ? _MultiLookupCond : T[K] extends _LookupField ? _LookupCond : Partial<T[K]>;
|
|
20
|
+
}>
|
|
21
|
+
|
|
22
|
+
// 字段条件,如果字段为 lookup 类型,则改写为 lookup cond,否则返回 Partial
|
|
23
|
+
type _FieldCond<T> = T extends _LookupField[] ? _MultiLookupCond : T extends _LookupField ? _LookupCond : PartialCompositeType<T>
|
|
24
|
+
|
|
25
|
+
// 第一层字段:需要提示出第二层 LookUp 的对象结构
|
|
26
|
+
type _FirstLevelFieldCond<T> = Partial<{
|
|
27
|
+
[K in keyof T]: T[K] extends _LookupField ? _FieldCond<T[K]> : T[K]
|
|
28
|
+
}>
|
|
29
|
+
|
|
30
|
+
// kunlun 的对象筛选条件,对象的每个字段可以传入 字段条件、布尔条件或者逻辑条件
|
|
31
|
+
type _KCond<T> = Partial<{
|
|
32
|
+
[K in keyof T]: _FieldCond<T[K]> | _BooleanCond<T[K]> | _LogicalCond<T[K]>
|
|
33
|
+
}>
|
|
34
|
+
|
|
35
|
+
// kunlun 的对象筛选条件,对象的每个字段可以传入 字段条件、布尔条件或者逻辑条件
|
|
36
|
+
type _WhereKCond<T> = Partial<{
|
|
37
|
+
[K in keyof T]: _FirstLevelFieldCond<T[K]> | _BooleanCond<T[K]> | _LogicalCond<T[K]>
|
|
38
|
+
}>
|
|
39
|
+
|
|
40
|
+
// 条件,可以传入一个 kunlun 的对象筛选条件 或者 一个逻辑条件
|
|
41
|
+
export type _Cond<T> = _KCond<T> | _LogicalCond<Partial<T>>;
|
|
42
|
+
|
|
43
|
+
// 筛选条件
|
|
44
|
+
export type _WhereCond<T> = _WhereKCond<T> | _LogicalCond<Partial<T>>;
|
|
45
|
+
|
|
46
|
+
// 返回记录,主要为了将 lookup 字段类型特化为特化结构
|
|
47
|
+
export type _Record<T> = {
|
|
48
|
+
[K in keyof T]: T[K] extends _LookupField ? _LookupFieldRet : T[K]
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 用于 update 和 delete 场景
|
|
52
|
+
export type _CondRequireID<T> = _Cond<T> & { _id: number }
|
|
53
|
+
|
|
54
|
+
interface _LookupFieldRet {
|
|
55
|
+
/**
|
|
56
|
+
* 名称:_id
|
|
57
|
+
*
|
|
58
|
+
* 类型:数字 / Number
|
|
59
|
+
*
|
|
60
|
+
* 格式:number
|
|
61
|
+
*/
|
|
62
|
+
_id: number,
|
|
63
|
+
/**
|
|
64
|
+
* 名称:角色名 / _name
|
|
65
|
+
*
|
|
66
|
+
* 类型:文本 / Text | 多语 / Multilingual
|
|
67
|
+
*
|
|
68
|
+
* 格式:string | {language_code: 1033|2052, text: string}[]
|
|
69
|
+
*/
|
|
70
|
+
_name: string | { language_code: 1033 | 2052, text: string }[],
|
|
71
|
+
is_deleted: boolean,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// lookup 类型字段的特征
|
|
75
|
+
interface _LookupField {
|
|
76
|
+
_id: number
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
import { metadataMap, currentObjApiName } from '../data/index'
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* target record 被使用于 workflow 场景下
|
|
83
|
+
*/
|
|
84
|
+
export interface TargetRecord {
|
|
85
|
+
/**
|
|
86
|
+
* workflow 被触发时,原始的记录信息
|
|
87
|
+
*/
|
|
88
|
+
original: metadataMap[currentObjApiName];
|
|
89
|
+
/**
|
|
90
|
+
* workflow 运行到当前位置的记录信息
|
|
91
|
+
*/
|
|
92
|
+
proposed: metadataMap[currentObjApiName];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// trigger old
|
|
96
|
+
export interface TriggerOld {
|
|
97
|
+
/**
|
|
98
|
+
* 更新前的记录数据
|
|
99
|
+
*/
|
|
100
|
+
old: metadataMap[currentObjApiName];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface TriggerNew {
|
|
104
|
+
/**
|
|
105
|
+
* 创建或更新后的记录数据
|
|
106
|
+
*/
|
|
107
|
+
new: metadataMap[currentObjApiName];
|
|
108
|
+
}
|