@byted-apaas/server-sdk-node 0.0.2-beta.2 → 0.0.2-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/application/application.js +0 -1
- package/application/function/function.js +0 -1
- package/application/impl/common.js +0 -1
- package/application/impl/impl.js +2 -2
- package/constants/constants.js +2 -1
- package/context/context.js +2 -1
- package/context/db/db.js +2 -1
- package/context/db/impl/IObject.js +2 -1
- package/context/db/impl/db.js +0 -1
- package/context/db/impl/object.js +2 -1
- package/context/db/impl/oql/ioql.js +2 -1
- package/context/db/impl/oql/oql.js +2 -1
- package/context/db/impl/order.js +2 -1
- package/context/db/impl/propertiesStore.js +2 -1
- package/context/db/impl/queryBuilder.js +2 -1
- package/context/db/impl/transaction/index.js +2 -1
- package/context/db/impl/transaction/operation.js +0 -1
- package/context/db/impl/transaction.js +2 -1
- package/context/globalConfig/globalConfig.js +2 -1
- package/context/metadata/components/common.js +2 -1
- package/context/metadata/components/components.js +2 -1
- package/context/metadata/components/desktop/list.js +0 -1
- package/context/metadata/components/desktop/recordDetail.js +2 -1
- package/context/metadata/components/mobile/list.js +2 -1
- package/context/metadata/metadata.js +2 -1
- package/context/metadata/objects/fields.js +2 -1
- package/context/metadata/objects/fields.util.js +0 -1
- package/context/metadata/objects/objects.js +2 -1
- package/context/metadata/types/common.js +2 -1
- package/context/metadata/types/components.js +2 -1
- package/context/metadata/types/objects.js +2 -1
- package/context/msg/msg.js +2 -1
- package/context/resources/IResources.js +0 -1
- package/context/resources/impl/resources.js +2 -1
- package/context/tasks/tasks.js +0 -1
- package/data/index.js +0 -1
- package/hooks/api.js +0 -1
- package/hooks/hooks.js +0 -1
- package/kunlun/kunlun.js +2 -1
- package/kunlun/operator/IOperator.js +2 -1
- package/kunlun/operator/impl/expression.js +2 -1
- package/kunlun/operator/impl/logic.js +2 -1
- package/kunlun/operator/impl/logicV2.js +0 -1
- package/kunlun/operator/impl/operator.js +2 -1
- package/kunlun/operator/impl/operatorV2.js +0 -1
- package/lib/core.js +2 -1
- package/package.json +3 -14
- package/request/common.js +0 -1
- package/request/constants.js +0 -1
- package/request/faasinfra.js +0 -1
- package/request/innerapi.js +2 -1
- package/request/interface.js +2 -1
- package/request/openapi.js +2 -1
- package/types/types.js +2 -1
- package/LICENSE.md +0 -0
- package/application/application.js.map +0 -1
- package/application/application.ts +0 -40
- package/application/function/function.js.map +0 -1
- package/application/function/function.ts +0 -37
- package/application/impl/common.js.map +0 -1
- package/application/impl/common.ts +0 -50
- package/application/impl/impl.js.map +0 -1
- package/application/impl/impl.ts +0 -48
- package/constants/constants.js.map +0 -1
- package/constants/constants.ts +0 -12
- package/context/context.js.map +0 -1
- package/context/context.ts +0 -127
- package/context/db/db.js.map +0 -1
- package/context/db/db.ts +0 -77
- package/context/db/impl/IObject.js.map +0 -1
- package/context/db/impl/IObject.ts +0 -244
- package/context/db/impl/db.js.map +0 -1
- package/context/db/impl/db.ts +0 -95
- package/context/db/impl/object.js.map +0 -1
- package/context/db/impl/object.ts +0 -628
- package/context/db/impl/oql/ioql.js.map +0 -1
- package/context/db/impl/oql/ioql.ts +0 -6
- package/context/db/impl/oql/oql.js.map +0 -1
- package/context/db/impl/oql/oql.ts +0 -22
- package/context/db/impl/order.js.map +0 -1
- package/context/db/impl/order.ts +0 -16
- package/context/db/impl/propertiesStore.js.map +0 -1
- package/context/db/impl/propertiesStore.ts +0 -28
- package/context/db/impl/queryBuilder.js.map +0 -1
- package/context/db/impl/queryBuilder.ts +0 -103
- package/context/db/impl/transaction/index.js.map +0 -1
- package/context/db/impl/transaction/index.ts +0 -337
- package/context/db/impl/transaction/operation.js.map +0 -1
- package/context/db/impl/transaction/operation.ts +0 -72
- package/context/db/impl/transaction.js.map +0 -1
- package/context/db/impl/transaction.ts +0 -76
- package/context/globalConfig/globalConfig.js.map +0 -1
- package/context/globalConfig/globalConfig.ts +0 -11
- package/context/metadata/components/common.js.map +0 -1
- package/context/metadata/components/common.ts +0 -19
- package/context/metadata/components/components.js.map +0 -1
- package/context/metadata/components/components.ts +0 -19
- package/context/metadata/components/desktop/list.js.map +0 -1
- package/context/metadata/components/desktop/list.ts +0 -457
- package/context/metadata/components/desktop/recordDetail.js.map +0 -1
- package/context/metadata/components/desktop/recordDetail.ts +0 -64
- package/context/metadata/components/mobile/list.js.map +0 -1
- package/context/metadata/components/mobile/list.ts +0 -176
- package/context/metadata/metadata.js.map +0 -1
- package/context/metadata/metadata.ts +0 -175
- package/context/metadata/objects/fields.js.map +0 -1
- package/context/metadata/objects/fields.ts +0 -454
- package/context/metadata/objects/fields.util.js.map +0 -1
- package/context/metadata/objects/fields.util.ts +0 -360
- package/context/metadata/objects/objects.js.map +0 -1
- package/context/metadata/objects/objects.ts +0 -27
- package/context/metadata/types/common.js.map +0 -1
- package/context/metadata/types/common.ts +0 -10
- package/context/metadata/types/components.js.map +0 -1
- package/context/metadata/types/components.ts +0 -105
- package/context/metadata/types/objects.js.map +0 -1
- package/context/metadata/types/objects.ts +0 -251
- package/context/msg/msg.js.map +0 -1
- package/context/msg/msg.ts +0 -49
- package/context/resources/IResources.js.map +0 -1
- package/context/resources/IResources.ts +0 -73
- package/context/resources/impl/resources.js.map +0 -1
- package/context/resources/impl/resources.ts +0 -170
- package/context/tasks/tasks.js.map +0 -1
- package/context/tasks/tasks.ts +0 -159
- package/data/index.js.map +0 -1
- package/data/index.ts +0 -30
- package/hooks/api.js.map +0 -1
- package/hooks/api.ts +0 -341
- package/hooks/hooks.js.map +0 -1
- package/hooks/hooks.ts +0 -100
- package/kunlun/kunlun.js.map +0 -1
- package/kunlun/kunlun.ts +0 -69
- package/kunlun/operator/IOperator.js.map +0 -1
- package/kunlun/operator/IOperator.ts +0 -163
- package/kunlun/operator/impl/expression.js.map +0 -1
- package/kunlun/operator/impl/expression.ts +0 -71
- package/kunlun/operator/impl/logic.js.map +0 -1
- package/kunlun/operator/impl/logic.ts +0 -595
- package/kunlun/operator/impl/logicV2.js.map +0 -1
- package/kunlun/operator/impl/logicV2.ts +0 -254
- package/kunlun/operator/impl/operator.js.map +0 -1
- package/kunlun/operator/impl/operator.ts +0 -255
- package/kunlun/operator/impl/operatorV2.js.map +0 -1
- package/kunlun/operator/impl/operatorV2.ts +0 -249
- package/lib/core.js.map +0 -1
- package/lib/core.ts +0 -4
- package/request/common.js.map +0 -1
- package/request/common.ts +0 -91
- package/request/constants.js.map +0 -1
- package/request/constants.ts +0 -25
- package/request/faasinfra.js.map +0 -1
- package/request/faasinfra.ts +0 -393
- package/request/innerapi.js.map +0 -1
- package/request/innerapi.ts +0 -1645
- package/request/interface.js.map +0 -1
- package/request/interface.ts +0 -166
- package/request/openapi.js.map +0 -1
- package/request/openapi.ts +0 -1220
- package/types/types.js.map +0 -1
- package/types/types.ts +0 -105
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import {I18ns} from "./common";
|
|
2
|
-
|
|
3
|
-
export interface BaseFieldType {
|
|
4
|
-
type: string;
|
|
5
|
-
apiName: string;
|
|
6
|
-
label: I18ns;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface KTextFieldType extends BaseFieldType {
|
|
10
|
-
required: boolean; // 默认值:false
|
|
11
|
-
unique: boolean; // 默认值:false
|
|
12
|
-
caseSensitive: boolean; // unique 为 false 时生效,默认值:true
|
|
13
|
-
multiline: boolean; // 默认值:false
|
|
14
|
-
maxLength: number; // 默认值:1000
|
|
15
|
-
validationRegex: string; // 正则校验的表达式
|
|
16
|
-
errorMsg: I18ns;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface RichTextType extends BaseFieldType {
|
|
20
|
-
required: boolean; // 默认值:false
|
|
21
|
-
maxLength: number;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface MultilingualType extends BaseFieldType {
|
|
25
|
-
required: boolean; // 默认值:false
|
|
26
|
-
unique: boolean; // 默认值:false
|
|
27
|
-
caseSensitive: boolean; // unique 为 ture 时生效,默认值:true
|
|
28
|
-
multiline: boolean; // 默认值:false
|
|
29
|
-
maxLength: number; // 默认值:1000
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface NumberType extends BaseFieldType {
|
|
33
|
-
required: boolean; // 默认值:false
|
|
34
|
-
unique: boolean; // 默认值:false
|
|
35
|
-
displayAsPercentage: boolean; // 默认值:false
|
|
36
|
-
decimalPlacesNumber: number;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface KDateType extends BaseFieldType {
|
|
40
|
-
required: boolean; // 默认值:false
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface DateTimeType extends BaseFieldType {
|
|
44
|
-
required: boolean; // 默认值:false
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type SubOptionType = {
|
|
48
|
-
label: I18ns;
|
|
49
|
-
apiName: string;
|
|
50
|
-
description: I18ns;
|
|
51
|
-
color: ("grey" | "blue" | "cyan" | "green" | "yellow" | "orange" | "red" | "magenta" | "purple" | "blueMagenta"); // 按色阶顺序给默认值
|
|
52
|
-
active: boolean; // 默认值: true
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface OptionType extends BaseFieldType {
|
|
56
|
-
required: boolean; // 默认值:false
|
|
57
|
-
multiple: boolean; // 默认值:false
|
|
58
|
-
optionSource: ("custom" | "global"); // 对应选项字段的「选项来源」属性(分为「自定义选项」和「使用全局选项), 默认值:"custom"
|
|
59
|
-
globalOptionApiName: string; // 关联全局选项的 apiName(创建字段时,设定 optionSource 为 "custom",则无需传入,且生成的元数据中不包含该属性)
|
|
60
|
-
optionList: SubOptionType[];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface Email extends BaseFieldType {
|
|
64
|
-
required: boolean; // 默认值:false
|
|
65
|
-
unique: boolean; // 默认值:false
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface MobileNumber extends BaseFieldType {
|
|
69
|
-
required: boolean; // 默认值:false
|
|
70
|
-
unique: boolean; // 默认值:false
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface Boolean extends BaseFieldType {
|
|
74
|
-
descriptionWhenTrue: I18ns;
|
|
75
|
-
descriptionWhenFalse: I18ns;
|
|
76
|
-
defaultValue: boolean;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface AvatarOrLogo extends BaseFieldType {
|
|
80
|
-
displayStyle: ("square" | "round"); // 默认值:"square"
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface SortConditionType {
|
|
84
|
-
fieldApiName: string;
|
|
85
|
-
sort: ("asc" | "desc") // 默认值:"asc"
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
type ConditionType = {
|
|
89
|
-
left: {
|
|
90
|
-
objectApiName: string;
|
|
91
|
-
fieldApiName: string;
|
|
92
|
-
};
|
|
93
|
-
operator: ("eq" | "neq" | "in" | "notIn" | "empty" | "notEmpty" | "lte" | "gte" | "hasAllOf" | "hasNoneOf" | "hasAnyOf");
|
|
94
|
-
valueType: ("reference" | "specified");
|
|
95
|
-
right: (object | string); // 当 valueType 为 "reference" 时,值类型同 left 属性;若为 "specified",值类型则为固定的字符串值
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
type CriterionType = {
|
|
99
|
-
conditions: ConditionType[]; // filter 条件
|
|
100
|
-
logic: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export type FilterType = {
|
|
104
|
-
label: string; // 对应为查找字段设置过滤条件中的「名称」属性
|
|
105
|
-
needTriggerCriterion: boolean; // 默认值:false
|
|
106
|
-
triggerCriterion: CriterionType
|
|
107
|
-
criterion: CriterionType
|
|
108
|
-
errorMsg: I18ns;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface Lookup extends BaseFieldType {
|
|
112
|
-
required: boolean; // 默认值:false
|
|
113
|
-
multiple: boolean; // 默认值:false,对应查找字段的「关联记录数」属性(分为「单条」和「多条」)
|
|
114
|
-
objectApiName: string; // 字段 look up 的对象
|
|
115
|
-
hierarchy: boolean; // 默认值:false,multiple 为 false 时生效
|
|
116
|
-
displayStyle: ("search" | "dropDown" | "tree"); // 默认值:"dropDown",对应查找字段的「关联记录展示方式」属性,仅当 hierarchy 为 true 时才可设置为 "tree"
|
|
117
|
-
sortConditions: SortConditionType[];
|
|
118
|
-
filter: FilterType[];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface FormulaType extends BaseFieldType {
|
|
122
|
-
returnType: string; // 对应公式字段的「公式返回值类型」属性
|
|
123
|
-
formula: I18ns;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export interface AutoIDType extends BaseFieldType {
|
|
127
|
-
generateMethod: ("random" | "incremental"); // 默认值: "random"
|
|
128
|
-
digitsNumber: number;
|
|
129
|
-
prefix: string;
|
|
130
|
-
suffix: string;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface ReferenceFieldType extends BaseFieldType {
|
|
134
|
-
guideFieldApiName: string;
|
|
135
|
-
fieldApiName: string;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export interface FileType extends BaseFieldType {
|
|
139
|
-
required: boolean; // 默认值: false
|
|
140
|
-
multiple: boolean; // 默认值: false
|
|
141
|
-
fileTypes: string[]; // 支持 "jpeg"|"jpg"|"png"|"gif"|"pdf"|"docx"|"doc"|"xlsx"|"xls"|"pptx"|"ppt"|"csv"|"txt"|"json"|"mp4"|"zip"|"rar",同时支持 "*.doc" 的描述方式,当为空数组,或 null、undefined 时,默认支持「全部类型」
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export interface BackLookuType extends BaseFieldType {
|
|
145
|
-
objectApiName: string;
|
|
146
|
-
fieldApiName: string; // 由于下游提供仍是 api ID 版本,因此禁用
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export interface CompositeType extends BaseFieldType {
|
|
150
|
-
compositeTypeApiName: string; // 关联组合类型的 apiName,「主子对象」需求调整后,将不存在该 key
|
|
151
|
-
subFields: BaseFieldType[]; // 组合类型中的子字段的元数据
|
|
152
|
-
required: boolean; // 默认值: false
|
|
153
|
-
multiple: boolean; // 默认值: false
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface ExtractSingleRecordType extends BaseFieldType {
|
|
157
|
-
compositeTypeApiName: string; // 关联组合类型的 apiName,「主子对象」需求调整后,将调整为「子表单」类型字段的 apiName
|
|
158
|
-
subFields: BaseFieldType[]; // 组合类型中的子字段的元数据
|
|
159
|
-
filter: FilterType[];
|
|
160
|
-
sortConditions: SortConditionType[];
|
|
161
|
-
recordPosition: number; // 默认值: 1,对应多值取单值字段的「返回记录」(分为「第一条」、「最后一条」和「第 {{n}} 条」),取值为正整数时为相应位置的记录,取值为 -1 时为「最后一条」记录
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export type FieldType = {
|
|
165
|
-
"allow_search": boolean,
|
|
166
|
-
"api_name": string,
|
|
167
|
-
"calculated": boolean,
|
|
168
|
-
"description": I18ns,
|
|
169
|
-
"domain": number,
|
|
170
|
-
"encryption_mode": string,
|
|
171
|
-
"field_permission": number,
|
|
172
|
-
"formula_id": number,
|
|
173
|
-
"id": number,
|
|
174
|
-
"indexed": number,
|
|
175
|
-
"inherit_settings": object,
|
|
176
|
-
"is_encrypted": boolean,
|
|
177
|
-
"is_inherit": boolean,
|
|
178
|
-
"is_progress_field": boolean,
|
|
179
|
-
"label": I18ns,
|
|
180
|
-
"namespace": string,
|
|
181
|
-
"object_api_name": string,
|
|
182
|
-
"object_id": number,
|
|
183
|
-
"order": number,
|
|
184
|
-
"required": boolean,
|
|
185
|
-
"tenant_id": number,
|
|
186
|
-
"type": {
|
|
187
|
-
"name": string,
|
|
188
|
-
"settings": {
|
|
189
|
-
"multiline": boolean,
|
|
190
|
-
"text_version": number,
|
|
191
|
-
"decimal_places": number,
|
|
192
|
-
"display_as_percentage": boolean,
|
|
193
|
-
"placeholder": object,
|
|
194
|
-
"max_length": number,
|
|
195
|
-
"regexp_expression": string,
|
|
196
|
-
"regexp_err_msg": I18ns,
|
|
197
|
-
"is_array": boolean,
|
|
198
|
-
"option_type": string,
|
|
199
|
-
"related_to_global_option": {
|
|
200
|
-
"apiName": string,
|
|
201
|
-
"id": number,
|
|
202
|
-
"name": string,
|
|
203
|
-
},
|
|
204
|
-
"options": {
|
|
205
|
-
"name": I18ns,
|
|
206
|
-
"api_name": string,
|
|
207
|
-
"description": I18ns,
|
|
208
|
-
"color_id": string,
|
|
209
|
-
"active": boolean,
|
|
210
|
-
}[],
|
|
211
|
-
"description_if_true": I18ns,
|
|
212
|
-
"description_if_false": I18ns,
|
|
213
|
-
"display_style": string,
|
|
214
|
-
"default_value": boolean,
|
|
215
|
-
"referenced_object_api_name": string,
|
|
216
|
-
"is_hierarchy": boolean,
|
|
217
|
-
"return_type": string,
|
|
218
|
-
"formulas": I18ns,
|
|
219
|
-
"generation_method": string,
|
|
220
|
-
"digits": number,
|
|
221
|
-
"prefix": string,
|
|
222
|
-
"suffix": string,
|
|
223
|
-
"target_referenced_object_api_name": string,
|
|
224
|
-
"target_reference_field_api_name": string,
|
|
225
|
-
"multiple": boolean,
|
|
226
|
-
"mime_types": string[],
|
|
227
|
-
"related_to_object_api_name": string,
|
|
228
|
-
"related_to_field_api_name": string,
|
|
229
|
-
"related_to_api_name": string,
|
|
230
|
-
"related_to_fields": object[],
|
|
231
|
-
"filter": FilterType[],
|
|
232
|
-
"sort": {
|
|
233
|
-
"field": string,
|
|
234
|
-
"type": "string",
|
|
235
|
-
"direction": ("asc" | "desc")
|
|
236
|
-
}[],
|
|
237
|
-
"filter_record": {
|
|
238
|
-
"index": number,
|
|
239
|
-
"type": string,
|
|
240
|
-
},
|
|
241
|
-
"is_extract": boolean,
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
"unique_type": number,
|
|
245
|
-
"updated_at": number,
|
|
246
|
-
"updated_by": {
|
|
247
|
-
"avatar": object,
|
|
248
|
-
"id": number,
|
|
249
|
-
"name": string,
|
|
250
|
-
},
|
|
251
|
-
}
|
package/context/msg/msg.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"msg.js","sourceRoot":"","sources":["msg.ts"],"names":[],"mappings":";;;AAAA,mDAAmD;AAMnD,MAAa,aAAa;IACtB;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,GAMnB;QACG,OAAO,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;IAAA,CAAC;IACF;;;;OAIG;IACI,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,GAMlC;QACG,OAAO,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACjE,CAAC;IAAA,CAAC;CACL;AA5BD,sCA4BC;AAED;;GAEG;AACH,MAAa,OAAO;IAMhB;QACI,IAAI,CAAC,YAAY,GAAG,IAAI,aAAa,EAAE,CAAC;IAC5C,CAAC;CACJ;AATD,0BASC"}
|
package/context/msg/msg.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as Request from "../../request/interface";
|
|
2
|
-
import * as common from "@byted-apaas/server-common-node"
|
|
3
|
-
import Multilingual = common.fieldType.Multilingual
|
|
4
|
-
|
|
5
|
-
export type _IconType = "success" | "error" | "progress" | "info"
|
|
6
|
-
|
|
7
|
-
export class _NotifyCenter {
|
|
8
|
-
/**
|
|
9
|
-
* 消息中心推送消息
|
|
10
|
-
* @param msg 消息
|
|
11
|
-
*/
|
|
12
|
-
public async create(msg: {
|
|
13
|
-
icon: _IconType,
|
|
14
|
-
percent: Number,
|
|
15
|
-
target_users: number[],
|
|
16
|
-
title: Multilingual,
|
|
17
|
-
detail: Multilingual,
|
|
18
|
-
}): Promise<number> {
|
|
19
|
-
return await Request.GetInstance().createMessage(msg);
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* 消息中心更新消息
|
|
23
|
-
* @param msgId 消息 ID
|
|
24
|
-
* @param msg 消息
|
|
25
|
-
*/
|
|
26
|
-
public async update(msgId: number, msg: {
|
|
27
|
-
icon?: _IconType,
|
|
28
|
-
percent?: Number,
|
|
29
|
-
target_users?: number[],
|
|
30
|
-
title?: Multilingual,
|
|
31
|
-
detail?: Multilingual,
|
|
32
|
-
}): Promise<void> {
|
|
33
|
-
return await Request.GetInstance().updateMessage(msgId, msg);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 消息类
|
|
39
|
-
*/
|
|
40
|
-
export class Message {
|
|
41
|
-
/**
|
|
42
|
-
* 消息中心
|
|
43
|
-
*/
|
|
44
|
-
notifyCenter: _NotifyCenter;
|
|
45
|
-
|
|
46
|
-
constructor() {
|
|
47
|
-
this.notifyCenter = new _NotifyCenter();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IResources.js","sourceRoot":"","sources":["IResources.ts"],"names":[],"mappings":""}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Stream } from "stream";
|
|
2
|
-
import { _KunlunOpenSDKFile } from "./impl/resources";
|
|
3
|
-
import { UploadFileResp } from "../../request/interface";
|
|
4
|
-
|
|
5
|
-
export interface _FileInfo {
|
|
6
|
-
id: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface _IKunlunFile {
|
|
10
|
-
/**
|
|
11
|
-
* 上传文件
|
|
12
|
-
* @param filePath 文件路径
|
|
13
|
-
* @param expire 文件过期时间,可选,单位:秒
|
|
14
|
-
*/
|
|
15
|
-
upload(filePath: string, expire?: number): Promise<UploadFileResp>;
|
|
16
|
-
/**
|
|
17
|
-
* 上传文件
|
|
18
|
-
* @param stream 文件流
|
|
19
|
-
* @param expire 文件过期时间,可选,单位:秒
|
|
20
|
-
*/
|
|
21
|
-
upload(stream: Stream, expire?: number): Promise<UploadFileResp>;
|
|
22
|
-
/**
|
|
23
|
-
* 下载文件
|
|
24
|
-
* @param fileToken 文件令牌
|
|
25
|
-
*/
|
|
26
|
-
download(fileToken: string): Promise<Buffer>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* 下载文件
|
|
30
|
-
* @param fileToken 文件令牌
|
|
31
|
-
* @param filePath 文件保存的路径
|
|
32
|
-
*/
|
|
33
|
-
download(fileToken: string, filePath: string): Promise<void>;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* 下载文件
|
|
37
|
-
* @param fileInfo 文件信息
|
|
38
|
-
*/
|
|
39
|
-
download(fileInfo: _FileInfo): Promise<Buffer>;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 下载文件
|
|
43
|
-
* @param fileInfo 文件信息
|
|
44
|
-
* @param filePath 文件保存的路径
|
|
45
|
-
*/
|
|
46
|
-
download(fileInfo: _FileInfo, filePath: string): Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export type FileUploadResult = {
|
|
50
|
-
fileId: string;
|
|
51
|
-
type: string;
|
|
52
|
-
name: string;
|
|
53
|
-
size: number;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export type UploadAvatarResult = {
|
|
57
|
-
ImageId: string;
|
|
58
|
-
PreviewImageId: string;
|
|
59
|
-
};
|
|
60
|
-
export interface _IOpenSDKFile {
|
|
61
|
-
Upload(fileName: string, path: string): Promise<FileUploadResult>;
|
|
62
|
-
Upload(fileName: string, reader: Stream): Promise<FileUploadResult>;
|
|
63
|
-
Upload(fileName: string, buffer: Buffer): Promise<FileUploadResult>;
|
|
64
|
-
UploadAvatar(fileName: string, path: string): Promise<UploadAvatarResult>;
|
|
65
|
-
UploadAvatar(fileName: string, reader: Stream): Promise<UploadAvatarResult>;
|
|
66
|
-
UploadAvatar(fileName: string, buffer: Buffer): Promise<UploadAvatarResult>;
|
|
67
|
-
Download(fileID: string): Promise<Buffer>;
|
|
68
|
-
DownloadAvatar(imageID: string): Promise<Buffer>;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface _IOpenSDKResources {
|
|
72
|
-
file: _IOpenSDKFile;
|
|
73
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["resources.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAEhC,sDAAsD;AACtD,6DAAoE;AACpE,0DAAyD;AAEzD,qEAAgE;AAEhE,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAErC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB,MAAa,kBAAkB;IAG3B,YAAY,MAAc;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAKD,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,MAAgC;QAC3D,2BAA2B;QAC3B,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YAC9B,MAAM,IAAI,UAAU,CAAC,iBAAiB,CAAC,mDAAmD,CAAC,CAAC;SAC/F;QACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,YAAY,eAAM,CAAC,IAAI,CAAC,CAAC,MAAM,YAAY,MAAM,CAAC,EAAE;YAC1F,MAAM,IAAI,UAAU,CAAC,iBAAiB,CAAC,qEAAqE,CAAC,CAAC;SACjH;QACD,2BAA2B;QAC3B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC5B,mBAAmB;YACnB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;gBACxB,MAAM,IAAI,UAAU,CAAC,iBAAiB,CAAC,iBAAiB,MAAM,GAAG,CAAC,CAAA;aACrE;YACD,MAAM,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;SACxC;QACD,IAAI,MAAM,YAAY,eAAM,EAAE;YAC1B,qBAAqB;YACrB,MAAM,GAAG,MAAM,IAAA,iCAAc,E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;AA7CD,kCA6CC;AAED;;GAEG;AACH,MAAa,iBAAiB;IAG1B,YAAY,MAAc;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;CACJ;AAND,8CAMC;AAED;;GAEG;AACH,MAAa,UAAU;IAInB;QACI,IAAI,CAAC,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,CAAC;CAEJ;AARD,gCAQC"}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { Stream } from "stream";
|
|
2
|
-
import { _FileInfo, _IKunlunFile, _IOpenSDKFile, UploadAvatarResult, FileUploadResult } from "../IResources";
|
|
3
|
-
import * as Request from "../../../request/interface";
|
|
4
|
-
import { runCtxForOpenSDK } from "../../../application/impl/common";
|
|
5
|
-
import * as common from "@byted-apaas/server-common-node"
|
|
6
|
-
import { AppCtx } from "../../../application/application";
|
|
7
|
-
import { streamToBuffer } from "@jorgeferrero/stream-to-buffer";
|
|
8
|
-
|
|
9
|
-
const exceptions = common.exceptions;
|
|
10
|
-
|
|
11
|
-
const fs = require('fs');
|
|
12
|
-
|
|
13
|
-
export class _KunlunOpenSDKFile implements _IOpenSDKFile {
|
|
14
|
-
appCtx: AppCtx
|
|
15
|
-
|
|
16
|
-
constructor(appCtx: AppCtx) {
|
|
17
|
-
this.appCtx = appCtx;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async Upload(fileName: string, path: string): Promise<FileUploadResult>;
|
|
21
|
-
async Upload(fileName: string, reader: Stream): Promise<FileUploadResult>;
|
|
22
|
-
async Upload(fileName: string, buffer: Buffer): Promise<FileUploadResult>;
|
|
23
|
-
async Upload(fileName: string, source: string | Stream | Buffer): Promise<FileUploadResult> {
|
|
24
|
-
// 1. check parameters type
|
|
25
|
-
if (typeof fileName !== 'string') {
|
|
26
|
-
throw new exceptions.InvalidParamError('upload method parameter fileName must be string. ');
|
|
27
|
-
}
|
|
28
|
-
if (typeof source !== 'string' && !(source instanceof Stream) && !(source instanceof Buffer)) {
|
|
29
|
-
throw new exceptions.InvalidParamError('upload method parameter source must be string or stream or buffer. ');
|
|
30
|
-
}
|
|
31
|
-
// 2. divide by source type
|
|
32
|
-
if (typeof source === 'string') {
|
|
33
|
-
// upload from path
|
|
34
|
-
if (!fs.existsSync(source)) {
|
|
35
|
-
throw new exceptions.InvalidParamError(`no such file '${source}'`)
|
|
36
|
-
}
|
|
37
|
-
source = fs.createReadStream(source);
|
|
38
|
-
}
|
|
39
|
-
if (source instanceof Stream) {
|
|
40
|
-
// upload from stream
|
|
41
|
-
source = await streamToBuffer(source as any);
|
|
42
|
-
}
|
|
43
|
-
if (source instanceof Buffer) {
|
|
44
|
-
return await runCtxForOpenSDK(this.appCtx, async () => {
|
|
45
|
-
return await Request.GetInstance().openSDKUploadFile(fileName, source as Buffer);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
};
|
|
50
|
-
async UploadAvatar(fileName: string, path: string): Promise<UploadAvatarResult>;
|
|
51
|
-
async UploadAvatar(fileName: string, reader: Stream): Promise<UploadAvatarResult>;
|
|
52
|
-
async UploadAvatar(fileName: string, buffer: Buffer): Promise<UploadAvatarResult>;
|
|
53
|
-
async UploadAvatar(fileName: string, source: string | Stream | Buffer): Promise<UploadAvatarResult> {
|
|
54
|
-
// 1. check parameters type
|
|
55
|
-
if (typeof fileName !== 'string') {
|
|
56
|
-
throw new exceptions.InvalidParamError('upload method parameter fileName must be string. ');
|
|
57
|
-
}
|
|
58
|
-
if (typeof source !== 'string' && !(source instanceof Stream) && !(source instanceof Buffer)) {
|
|
59
|
-
throw new exceptions.InvalidParamError('upload method parameter source must be string or stream or buffer. ');
|
|
60
|
-
}
|
|
61
|
-
// 2. divide by source type
|
|
62
|
-
if (typeof source === 'string') {
|
|
63
|
-
// upload from path
|
|
64
|
-
if (!fs.existsSync(source)) {
|
|
65
|
-
throw new exceptions.InvalidParamError(`no such file '${source}'`)
|
|
66
|
-
}
|
|
67
|
-
source = fs.createReadStream(source);
|
|
68
|
-
}
|
|
69
|
-
if (source instanceof Stream) {
|
|
70
|
-
// upload from stream
|
|
71
|
-
source = await streamToBuffer(source as any);
|
|
72
|
-
}
|
|
73
|
-
if (source instanceof Buffer) {
|
|
74
|
-
// upload from buffer
|
|
75
|
-
return await runCtxForOpenSDK(this.appCtx, async () => {
|
|
76
|
-
return await Request.GetInstance().openSDKUploadAvatar(fileName, source as Buffer);
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
};
|
|
81
|
-
async Download(fileID: string): Promise<Buffer> {
|
|
82
|
-
// 1. check parameters type
|
|
83
|
-
if (typeof fileID !== 'string') {
|
|
84
|
-
throw new exceptions.InvalidParamError('download method parameter fileID must be string. ');
|
|
85
|
-
}
|
|
86
|
-
return await runCtxForOpenSDK(this.appCtx, async () => {
|
|
87
|
-
return await Request.GetInstance().downloadFileByID(fileID) as Buffer;
|
|
88
|
-
})
|
|
89
|
-
};
|
|
90
|
-
async DownloadAvatar(imageID: string): Promise<Buffer> {
|
|
91
|
-
// 1. check parameters type
|
|
92
|
-
if (typeof imageID !== 'string') {
|
|
93
|
-
throw new exceptions.InvalidParamError('download method parameter imageID must be string. ');
|
|
94
|
-
}
|
|
95
|
-
return await runCtxForOpenSDK(this.appCtx, async () => {
|
|
96
|
-
return await Request.GetInstance().openSDKDownloadAvatar(imageID) as Buffer;
|
|
97
|
-
})
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export class _KunlunFile implements _IKunlunFile {
|
|
102
|
-
async download(fileToken: string): Promise<Buffer>;
|
|
103
|
-
async download(fileToken: string, filePath?: string): Promise<void>;
|
|
104
|
-
async download(fileToken: _FileInfo): Promise<Buffer>;
|
|
105
|
-
async download(fileInfo: _FileInfo, filePath: string): Promise<void>;
|
|
106
|
-
async download(fileTokenOrInfo: string | _FileInfo, filePath?: string): Promise<Buffer | void> {
|
|
107
|
-
if (typeof (fileTokenOrInfo) === "string") {
|
|
108
|
-
return await Request.GetInstance().downloadFileByToken(fileTokenOrInfo, filePath);
|
|
109
|
-
} else if (typeof (fileTokenOrInfo) === "object") {
|
|
110
|
-
if (!fileTokenOrInfo.id) {
|
|
111
|
-
throw new exceptions.InvalidParamError(`The value of fileInfo.id is empty`);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (typeof (fileTokenOrInfo.id) !== "string") {
|
|
115
|
-
throw new exceptions.InvalidParamError(`The type of fileInfo.id should be string, but ${typeof (fileTokenOrInfo)}`);
|
|
116
|
-
}
|
|
117
|
-
return await Request.GetInstance().downloadFileByID(fileTokenOrInfo.id, filePath);
|
|
118
|
-
} else {
|
|
119
|
-
throw new exceptions.InvalidParamError(`The type of first param should be string or object, but ${typeof (fileTokenOrInfo)}`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
async upload(filePath: string): Promise<Request.UploadFileResp>;
|
|
124
|
-
async upload(stream: Stream): Promise<Request.UploadFileResp>;
|
|
125
|
-
async upload(filePath: string, expire: number): Promise<Request.UploadFileResp>;
|
|
126
|
-
async upload(stream: Stream, expire: number): Promise<Request.UploadFileResp>;
|
|
127
|
-
async upload(data: string | Stream, expire?: number, ...ret: string[]): Promise<Request.UploadFileResp> {
|
|
128
|
-
if (ret.length > 0) {
|
|
129
|
-
throw new exceptions.InvalidParamError(`params is too many, as ${ret.length + 2}`)
|
|
130
|
-
}
|
|
131
|
-
if (!data) {
|
|
132
|
-
throw new exceptions.InvalidParamError(`params is null`)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// 1. data is filePath, read it from disk, convert it to Steam.
|
|
136
|
-
if (typeof (data) === 'string') {
|
|
137
|
-
if (!fs.existsSync(data)) {
|
|
138
|
-
throw new exceptions.InvalidParamError(`no such file '${data}'`)
|
|
139
|
-
}
|
|
140
|
-
data = fs.createReadStream(data);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// 2. data must be Stream at here.
|
|
144
|
-
return await Request.GetInstance().uploadFile(data as Stream, expire);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* OpenSDK 静态资源操作类
|
|
150
|
-
*/
|
|
151
|
-
export class _OpenSDKResources {
|
|
152
|
-
file: _IOpenSDKFile;
|
|
153
|
-
|
|
154
|
-
constructor(appCtx: AppCtx) {
|
|
155
|
-
this.file = new _KunlunOpenSDKFile(appCtx);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* 静态资源操作类
|
|
161
|
-
*/
|
|
162
|
-
export class _Resources {
|
|
163
|
-
|
|
164
|
-
file: _IKunlunFile;
|
|
165
|
-
|
|
166
|
-
constructor() {
|
|
167
|
-
this.file = new _KunlunFile();
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["tasks.ts"],"names":[],"mappings":";;;AAAA,0DAAyD;AACzD,mDAAkD;AAElD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;AAC1B,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAA;AAEpC,MAAa,QAAQ;CAapB;AAbD,4BAaC;AAED,0GAA0G;AAC1G,wEAAwE;AACxE,IAAI;AAEJ,MAAa,KAAK;IAGd,YAAY,EAAa;QACrB,IAAI,CAAC,CAAC,GAAG,EAAE,CAAA;IACf,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,OAAW,EAAE,MAAc;QACpD,IAAI,OAAO,IAAI,MAAM,EAAE;YACnB,eAAe;YACf,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,EAAC,qBAAqB;gBAC3C,YAAY;gBACZ,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE;oBACjB,OAAO,MAAM,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,C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