@byted-apaas/server-sdk-node 0.0.2-beta.2 → 0.0.2-beta.5

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 (129) hide show
  1. package/LICENSE +7 -0
  2. package/NOTICE +3 -0
  3. package/application/impl/impl.js +2 -1
  4. package/application/impl/impl.js.map +1 -1
  5. package/constants/constants.js +2 -0
  6. package/constants/constants.js.map +1 -1
  7. package/context/context.js +2 -0
  8. package/context/context.js.map +1 -1
  9. package/context/db/db.js +2 -0
  10. package/context/db/db.js.map +1 -1
  11. package/context/db/impl/IObject.js +2 -0
  12. package/context/db/impl/IObject.js.map +1 -1
  13. package/context/db/impl/object.js +2 -0
  14. package/context/db/impl/object.js.map +1 -1
  15. package/context/db/impl/oql/ioql.js +2 -0
  16. package/context/db/impl/oql/ioql.js.map +1 -1
  17. package/context/db/impl/oql/oql.js +2 -0
  18. package/context/db/impl/oql/oql.js.map +1 -1
  19. package/context/db/impl/order.js +2 -0
  20. package/context/db/impl/order.js.map +1 -1
  21. package/context/db/impl/propertiesStore.js +2 -0
  22. package/context/db/impl/propertiesStore.js.map +1 -1
  23. package/context/db/impl/queryBuilder.js +2 -0
  24. package/context/db/impl/queryBuilder.js.map +1 -1
  25. package/context/db/impl/transaction/index.js +2 -0
  26. package/context/db/impl/transaction/index.js.map +1 -1
  27. package/context/db/impl/transaction.js +2 -0
  28. package/context/db/impl/transaction.js.map +1 -1
  29. package/context/globalConfig/globalConfig.js +2 -0
  30. package/context/globalConfig/globalConfig.js.map +1 -1
  31. package/context/metadata/components/common.js +2 -0
  32. package/context/metadata/components/common.js.map +1 -1
  33. package/context/metadata/components/components.js +2 -0
  34. package/context/metadata/components/components.js.map +1 -1
  35. package/context/metadata/components/desktop/recordDetail.js +2 -0
  36. package/context/metadata/components/desktop/recordDetail.js.map +1 -1
  37. package/context/metadata/components/mobile/list.js +2 -0
  38. package/context/metadata/components/mobile/list.js.map +1 -1
  39. package/context/metadata/metadata.js +2 -0
  40. package/context/metadata/metadata.js.map +1 -1
  41. package/context/metadata/objects/fields.js +2 -0
  42. package/context/metadata/objects/fields.js.map +1 -1
  43. package/context/metadata/objects/objects.js +2 -0
  44. package/context/metadata/objects/objects.js.map +1 -1
  45. package/context/metadata/types/common.js +2 -0
  46. package/context/metadata/types/common.js.map +1 -1
  47. package/context/metadata/types/components.js +2 -0
  48. package/context/metadata/types/components.js.map +1 -1
  49. package/context/metadata/types/objects.js +2 -0
  50. package/context/metadata/types/objects.js.map +1 -1
  51. package/context/msg/msg.js +2 -0
  52. package/context/msg/msg.js.map +1 -1
  53. package/context/resources/impl/resources.js +2 -0
  54. package/context/resources/impl/resources.js.map +1 -1
  55. package/kunlun/kunlun.js +2 -0
  56. package/kunlun/kunlun.js.map +1 -1
  57. package/kunlun/operator/IOperator.js +2 -0
  58. package/kunlun/operator/IOperator.js.map +1 -1
  59. package/kunlun/operator/impl/expression.js +2 -0
  60. package/kunlun/operator/impl/expression.js.map +1 -1
  61. package/kunlun/operator/impl/logic.js +2 -0
  62. package/kunlun/operator/impl/logic.js.map +1 -1
  63. package/kunlun/operator/impl/operator.js +2 -0
  64. package/kunlun/operator/impl/operator.js.map +1 -1
  65. package/lib/core.js +2 -0
  66. package/lib/core.js.map +1 -1
  67. package/package.json +3 -14
  68. package/request/innerapi.js +4 -2
  69. package/request/innerapi.js.map +1 -1
  70. package/request/interface.js +2 -0
  71. package/request/interface.js.map +1 -1
  72. package/request/openapi.js +2 -0
  73. package/request/openapi.js.map +1 -1
  74. package/types/types.js +2 -0
  75. package/types/types.js.map +1 -1
  76. package/LICENSE.md +0 -0
  77. package/application/application.ts +0 -40
  78. package/application/function/function.ts +0 -37
  79. package/application/impl/common.ts +0 -50
  80. package/application/impl/impl.ts +0 -48
  81. package/constants/constants.ts +0 -12
  82. package/context/context.ts +0 -127
  83. package/context/db/db.ts +0 -77
  84. package/context/db/impl/IObject.ts +0 -244
  85. package/context/db/impl/db.ts +0 -95
  86. package/context/db/impl/object.ts +0 -628
  87. package/context/db/impl/oql/ioql.ts +0 -6
  88. package/context/db/impl/oql/oql.ts +0 -22
  89. package/context/db/impl/order.ts +0 -16
  90. package/context/db/impl/propertiesStore.ts +0 -28
  91. package/context/db/impl/queryBuilder.ts +0 -103
  92. package/context/db/impl/transaction/index.ts +0 -337
  93. package/context/db/impl/transaction/operation.ts +0 -72
  94. package/context/db/impl/transaction.ts +0 -76
  95. package/context/globalConfig/globalConfig.ts +0 -11
  96. package/context/metadata/components/common.ts +0 -19
  97. package/context/metadata/components/components.ts +0 -19
  98. package/context/metadata/components/desktop/list.ts +0 -457
  99. package/context/metadata/components/desktop/recordDetail.ts +0 -64
  100. package/context/metadata/components/mobile/list.ts +0 -176
  101. package/context/metadata/metadata.ts +0 -175
  102. package/context/metadata/objects/fields.ts +0 -454
  103. package/context/metadata/objects/fields.util.ts +0 -360
  104. package/context/metadata/objects/objects.ts +0 -27
  105. package/context/metadata/types/common.ts +0 -10
  106. package/context/metadata/types/components.ts +0 -105
  107. package/context/metadata/types/objects.ts +0 -251
  108. package/context/msg/msg.ts +0 -49
  109. package/context/resources/IResources.ts +0 -73
  110. package/context/resources/impl/resources.ts +0 -170
  111. package/context/tasks/tasks.ts +0 -159
  112. package/data/index.ts +0 -30
  113. package/hooks/api.ts +0 -341
  114. package/hooks/hooks.ts +0 -100
  115. package/kunlun/kunlun.ts +0 -69
  116. package/kunlun/operator/IOperator.ts +0 -163
  117. package/kunlun/operator/impl/expression.ts +0 -71
  118. package/kunlun/operator/impl/logic.ts +0 -595
  119. package/kunlun/operator/impl/logicV2.ts +0 -254
  120. package/kunlun/operator/impl/operator.ts +0 -255
  121. package/kunlun/operator/impl/operatorV2.ts +0 -249
  122. package/lib/core.ts +0 -4
  123. package/request/common.ts +0 -91
  124. package/request/constants.ts +0 -25
  125. package/request/faasinfra.ts +0 -393
  126. package/request/innerapi.ts +0 -1645
  127. package/request/interface.ts +0 -166
  128. package/request/openapi.ts +0 -1220
  129. package/types/types.ts +0 -105
package/kunlun/kunlun.ts DELETED
@@ -1,69 +0,0 @@
1
- import { IOperator } from './operator/IOperator';
2
- import { globalVariables } from '../data/index'
3
- import { GMTOffset as GMT } from "@byted-apaas/server-common-node/constants/timeZone";
4
- import { area2code } from "@byted-apaas/server-common-node/constants/countryCode";
5
- import { ITool, IToolsExtra } from "@byted-apaas/server-common-node/kunlun/tool/Itool";
6
- import { Tool } from "@byted-apaas/server-common-node/kunlun/tool/impl/tool";
7
- import { errCodes } from "@byted-apaas/server-common-node/utils/exceptions";
8
- import { Operator } from "./operator/impl/operator";
9
- import * as common from "@byted-apaas/server-common-node";
10
- import * as Request from "../request/interface";
11
-
12
- declare global {
13
- export namespace kunlun {
14
- /**
15
- * 指令操作符
16
- */
17
- export let operator: IOperator;
18
- }
19
- }
20
-
21
- export namespace kunlun {
22
- /**
23
- * 引用时区信息
24
- */
25
- export const GMTOffset: typeof GMT = GMT;
26
-
27
- /**
28
- * 引用国际区号
29
- */
30
- export const countryCode: typeof area2code = area2code;
31
-
32
- /**
33
- * 工具方法
34
- */
35
- export let tool: ITool & IToolsExtra = new Tool();
36
-
37
- /**
38
- * 生成复杂数据结构
39
- */
40
- export namespace type {
41
- export import Multilingual = common.fieldType.Multilingual
42
- export import Phone = common.fieldType.Phone
43
- export import Date = common.fieldType.Date
44
- export import DateTime = common.fieldType.DateTime
45
- }
46
-
47
- /**
48
- * 错误码
49
- */
50
- export const errorCode = {
51
- /**
52
- * 限流错误码
53
- */
54
- RATE_LIMIT_ERROR: errCodes.RATE_LIMIT_ERROR,
55
- }
56
-
57
- /**
58
- * 根据 key 获取对应的全局变量
59
- * @param key 全局变量的 key
60
- */
61
- export async function getVar(key: string): Promise<string> {
62
- return await Request.GetInstance().getGlobalConfigByKey(key);
63
- }
64
-
65
- /**
66
- * 指令操作符
67
- */
68
- export const operator: IOperator = new Operator();
69
- }
@@ -1,163 +0,0 @@
1
- import { _Cond, _BooleanCond, _LogicalCond } from '../../types/types'
2
- import { UserDataType } from './impl/expression';
3
-
4
- export interface IOperator {
5
- /**
6
- * 逻辑与
7
- * @param conditions 多个条件,用逗号分隔
8
- * @example
9
- * ```
10
- * context.db.object("_user").where(kunlun.operator.and({
11
- * age: "22"
12
- * },{
13
- * gender: "male"
14
- * }))
15
- * ```
16
- */
17
- and<T>(...conditions: (_Cond<T> | _BooleanCond<T>)[]): _LogicalCond<T>;
18
- /**
19
- * 逻辑或
20
- * @param conditions 多个条件,用逗号分隔
21
- * @example
22
- * ```
23
- * context.db.object("_user").where(kunlun.operator.or({
24
- * age: "22"
25
- * },{
26
- * age: "25"
27
- * }))
28
- * ```
29
- */
30
- or<T>(...conditions: (_Cond<T> | _BooleanCond<T>)[]): _LogicalCond<T>;
31
- /**
32
- * 包含
33
- * @param value 判定是否包含的文本值
34
- * @example
35
- * ```
36
- * context.db.object("_user").where({_name: kunlun.operator.contain("a")})
37
- * ```
38
- */
39
- contain<T>(value: UserDataType): _BooleanCond<T>;
40
- /**
41
- * 不包含
42
- * @param value 判定是否不包含的文本值
43
- * @example
44
- * ```
45
- * context.db.object("_user").where({_name: kunlun.operator.notContain("a")})
46
- * ```
47
- */
48
- notContain<T>(value: UserDataType): _BooleanCond<T>;
49
- /**
50
- * 无需入参,判断是否为空
51
- * @example
52
- * ```
53
- * context.db.object("_user").where({employeeType: kunlun.operator.empty()})
54
- * ```
55
- */
56
- empty(): _BooleanCond<any>;
57
- /**
58
- * 无需入参,判断是否为空
59
- * @example
60
- * ```
61
- * context.db.object("_user").where({employeeType: kunlun.operator.notEmpty()})
62
- * ```
63
- */
64
- notEmpty(): _BooleanCond<any>;
65
- /**
66
- * 等于
67
- * @param value 判定是否相等的值
68
- * @example
69
- * ```
70
- * context.db.object("_user").where({age: kunlun.operator.eq(20)})
71
- * ```
72
- */
73
- eq<T>(value: UserDataType): _BooleanCond<T>;
74
- /**
75
- * 不等于
76
- * @param value 判定是否不相等的值
77
- * @example
78
- * ```
79
- * context.db.object("_user").where({age: kunlun.operator.neq(20)})
80
- * ```
81
- */
82
- neq<T>(value: UserDataType): _BooleanCond<T>;
83
- /**
84
- * 大于或晚于
85
- * @param value 判定是否大于或晚于的值
86
- * @example
87
- * ```
88
- * kunlun.operator.gt(new Date("2020-11-26").getTime())
89
- * ```
90
- */
91
- gt<T>(value: number | Date): _BooleanCond<T>;
92
- /**
93
- * 大于等于或晚于等于
94
- * @param value 判定是否大于等于或晚于等于的值
95
- * @example
96
- * ```
97
- * kunlun.operator.gte(new Date("2020-11-26").getTime())
98
- * ```
99
- */
100
- gte<T>(value: number | Date): _BooleanCond<T>;
101
- /**
102
- * 小于或早于
103
- * @param value 判定是否小于或早于的值
104
- * @example
105
- * ```
106
- * kunlun.operator.lt(new Date("2020-11-26").getTime())
107
- * ```
108
- */
109
- lt<T>(value: number | Date): _BooleanCond<T>;
110
- /**
111
- * 小于等于或早于等于
112
- * @param value 判定是否小于等于或早于等于的值
113
- * @example
114
- * ```
115
- * kunlun.operator.lte(new Date("2020-11-26").getTime())
116
- * ```
117
- */
118
- lte<T>(value: number | Date): _BooleanCond<T>;
119
- /**
120
- * 存在于给定的数组内
121
- * @param values 判定是否存在于的一组值,用数组传递
122
- */
123
- in<T>(values: UserDataType[]): _BooleanCond<T>;
124
- /**
125
- * 存在于给定的数组内
126
- * @param values 判定是否存在于的一组值,用逗号分隔
127
- */
128
- in<T>(...values: UserDataType[]): _BooleanCond<T>;
129
- /**
130
- * 不存在于给定的数组内
131
- * @param values 判定是否不存在于的一组值,用数组传递
132
- */
133
- notIn<T>(values: UserDataType[]): _BooleanCond<T>;
134
- /**
135
- * 不存在于给定的数组内
136
- * @param values 判定是否不存在于的一组值,用逗号分隔
137
- */
138
- notIn<T>(...values: UserDataType[]): _BooleanCond<T>;
139
-
140
- /**
141
- * 存在给定的多个值中的任何一个值
142
- * @param values 判定是否不存在于的一组值,用逗号分隔
143
- */
144
- hasAnyOf<T>(values: number[] | string[]): _BooleanCond<T>;
145
-
146
- /**
147
- * 存在给定的多个值中的任何一个值
148
- * @param values 判定是否不存在于的一组值,用逗号分隔
149
- */
150
- hasAnyOf<T>(...values: number[] | string[]): _BooleanCond<T>;
151
-
152
- /**
153
- * 不存在给定的多个值中的任何值
154
- * @param values 判定是否不存在于的一组值,用逗号分隔
155
- */
156
- hasNoneOf<T>(values: number[] | string[]): _BooleanCond<T>;
157
-
158
- /**
159
- * 不存在给定的多个值中的任何值
160
- * @param values 判定是否不存在于的一组值,用逗号分隔
161
- */
162
- hasNoneOf<T>(...values: number[] | string[]): _BooleanCond<T>;
163
- }
@@ -1,71 +0,0 @@
1
- export type UserDataType = null | string | boolean | number | Date | object
2
-
3
- export class Expression {
4
- index: number
5
- left: ExpressionField
6
- operator: string
7
- right: ExpressionField
8
-
9
- constructor(left: ExpressionField, operator: string, right: ExpressionField, index: number) {
10
- this.index = index;
11
- this.left = left;
12
- this.operator = operator;
13
- this.right = right;
14
- }
15
- }
16
-
17
- type SettingType = {
18
- data?: UserDataType
19
- fieldPath?: PathType[]
20
- }
21
-
22
- export type PathType = {
23
- objectApiName: string
24
- fieldApiName: string
25
- extendLogicTags: string[]
26
- }
27
-
28
- /**
29
- * 总共有4种类型,当前仅支持constant,metadataVariable
30
- *
31
- * constant:不可为左值
32
- * metadataVariable
33
- * function
34
- * customizedVariable
35
- */
36
- class ExpressionField {
37
- type: string
38
- settings: SettingType
39
- constructor(type: string, settings: SettingType) {
40
- this.type = type;
41
- this.settings = settings;
42
- }
43
- }
44
-
45
- /**
46
- * 常量表达式字段
47
- *
48
- * 比如在 condition: user.name equal "bob" 中,"bob" 将被构建为 ConstantExpressionField
49
- */
50
- export class ConstantExpressionField extends ExpressionField {
51
- constructor(data: UserDataType) {
52
- super("constant", {"data": data});
53
- }
54
- }
55
-
56
- /**
57
- * 元数据表达式字段
58
- *
59
- * 比如在 condition: user.name equal "bob" 中,"user.name" 将被构建为 MetadataExpressionField
60
- */
61
- export class MetadataExpressionField extends ExpressionField {
62
- constructor(objectApiName: string, fieldApiName: string) {
63
- super("metadataVariable", {
64
- "fieldPath": [{
65
- objectApiName: objectApiName,
66
- fieldApiName: fieldApiName,
67
- extendLogicTags: [],
68
- }]
69
- });
70
- }
71
- }