@lark-project/js-sdk 0.0.23
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/.eslintrc.js +5 -0
- package/.nvmrc +1 -0
- package/.prettierrc +5 -0
- package/LICENSE +9 -0
- package/README.md +6 -0
- package/api-extractor.json +427 -0
- package/dist/es/index.js +323 -0
- package/dist/lib/index.js +361 -0
- package/dist/types/index.d.ts +728 -0
- package/package.json +72 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
declare const MEEGO_BIZ_HUB = "__MEEGO_BIZ_HUB__";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* 每个声明的抽象类都必须实现这个属性,用于唯一标识
|
|
8
|
+
*/
|
|
9
|
+
declare const IMPL_KEY = "__MEEGO_SDK_IMPL_KEY__";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
declare abstract class BaseModel {
|
|
15
|
+
protected static [IMPL_KEY]: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
* 语言
|
|
21
|
+
*/
|
|
22
|
+
type Language = 'zh_CN' | 'en_US';
|
|
23
|
+
/**
|
|
24
|
+
* 区域
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
* 宿主环境信息
|
|
29
|
+
*/
|
|
30
|
+
declare abstract class HostEnv extends BaseModel {
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
protected static [IMPL_KEY]: string;
|
|
35
|
+
/**
|
|
36
|
+
* 当前语言
|
|
37
|
+
*/
|
|
38
|
+
abstract language: Language;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @public
|
|
43
|
+
* 用户信息
|
|
44
|
+
*/
|
|
45
|
+
interface User {
|
|
46
|
+
/**
|
|
47
|
+
* 唯一标识
|
|
48
|
+
*/
|
|
49
|
+
id: string;
|
|
50
|
+
/**
|
|
51
|
+
* 用户名
|
|
52
|
+
*/
|
|
53
|
+
name: string;
|
|
54
|
+
/**
|
|
55
|
+
* 用户头像
|
|
56
|
+
*/
|
|
57
|
+
avatar: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @public
|
|
61
|
+
* 字段类型枚举
|
|
62
|
+
*
|
|
63
|
+
* @privateRemarks
|
|
64
|
+
* 仅枚举产品功能上允许用户新建的字段类型
|
|
65
|
+
*/
|
|
66
|
+
declare enum FieldType {
|
|
67
|
+
/**
|
|
68
|
+
* 未知字段类型
|
|
69
|
+
*/
|
|
70
|
+
unknown = "unknown",
|
|
71
|
+
/**
|
|
72
|
+
* 文本(单行、多行)
|
|
73
|
+
*
|
|
74
|
+
* @privateRemarks
|
|
75
|
+
* 字段新建提供了单行文本、多行文本,但实际对应的都是 text
|
|
76
|
+
*/
|
|
77
|
+
text = "text",
|
|
78
|
+
/**
|
|
79
|
+
* 富文本
|
|
80
|
+
*/
|
|
81
|
+
richText = "multi-text",
|
|
82
|
+
/**
|
|
83
|
+
* 单项选择
|
|
84
|
+
*/
|
|
85
|
+
select = "select",
|
|
86
|
+
/**
|
|
87
|
+
* 多项选择
|
|
88
|
+
*/
|
|
89
|
+
multiSelect = "multi-select",
|
|
90
|
+
/**
|
|
91
|
+
* 级联单选
|
|
92
|
+
*/
|
|
93
|
+
treeSelect = "treeSelect",
|
|
94
|
+
/**
|
|
95
|
+
* 级联多选
|
|
96
|
+
*/
|
|
97
|
+
treeMultiSelect = "tree-multi-select",
|
|
98
|
+
/**
|
|
99
|
+
* 单选按钮
|
|
100
|
+
*/
|
|
101
|
+
radio = "radio",
|
|
102
|
+
/**
|
|
103
|
+
* 单选人员
|
|
104
|
+
*/
|
|
105
|
+
user = "user",
|
|
106
|
+
/**
|
|
107
|
+
* 多选人员
|
|
108
|
+
*/
|
|
109
|
+
multiUser = "multi-user",
|
|
110
|
+
/**
|
|
111
|
+
* 日期(日期 + 时间)
|
|
112
|
+
*
|
|
113
|
+
* @privateRemarks
|
|
114
|
+
* 字段新建提供了日期、日期 + 时间,但实际对应的都是 date
|
|
115
|
+
*/
|
|
116
|
+
date = "date",
|
|
117
|
+
/**
|
|
118
|
+
* 日期区间
|
|
119
|
+
*/
|
|
120
|
+
dateRange = "schedule",
|
|
121
|
+
/**
|
|
122
|
+
* 简单投票
|
|
123
|
+
*/
|
|
124
|
+
simpleVoting = "vote-boolean",
|
|
125
|
+
/**
|
|
126
|
+
* 单选投票
|
|
127
|
+
*/
|
|
128
|
+
singleVoting = "vote-option",
|
|
129
|
+
/**
|
|
130
|
+
* 多选投票
|
|
131
|
+
*/
|
|
132
|
+
multiVoting = "vote-option-multi",
|
|
133
|
+
/**
|
|
134
|
+
* 超链接
|
|
135
|
+
*/
|
|
136
|
+
link = "link",
|
|
137
|
+
/**
|
|
138
|
+
* 数字
|
|
139
|
+
*/
|
|
140
|
+
number = "number",
|
|
141
|
+
/**
|
|
142
|
+
* 附件
|
|
143
|
+
*/
|
|
144
|
+
attachment = "multi-file",
|
|
145
|
+
/**
|
|
146
|
+
* 开关
|
|
147
|
+
*/
|
|
148
|
+
bool = "bool",
|
|
149
|
+
/**
|
|
150
|
+
* 单信号
|
|
151
|
+
*/
|
|
152
|
+
singleSignal = "signal",
|
|
153
|
+
/**
|
|
154
|
+
* 多信号
|
|
155
|
+
*/
|
|
156
|
+
multiSignal = "multi-signal",
|
|
157
|
+
/**
|
|
158
|
+
* 复合字段
|
|
159
|
+
*/
|
|
160
|
+
compoundField = "compound_field",
|
|
161
|
+
/**
|
|
162
|
+
* 单选关联工作项
|
|
163
|
+
*/
|
|
164
|
+
workitemRelatedSelect = "workitem_related_select",
|
|
165
|
+
/**
|
|
166
|
+
* 多选关联工作项
|
|
167
|
+
*/
|
|
168
|
+
workitemRelatedMultiSelect = "workitem_related_multi_select"
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @public
|
|
172
|
+
* 字段(仅含关键属性)
|
|
173
|
+
*/
|
|
174
|
+
interface BriefField {
|
|
175
|
+
/**
|
|
176
|
+
* 唯一标识
|
|
177
|
+
*/
|
|
178
|
+
id: string;
|
|
179
|
+
/**
|
|
180
|
+
* 名称
|
|
181
|
+
*/
|
|
182
|
+
name: string;
|
|
183
|
+
/**
|
|
184
|
+
* 字段类型
|
|
185
|
+
*/
|
|
186
|
+
type: FieldType;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @public
|
|
190
|
+
* 工作项实例(仅含关键属性)
|
|
191
|
+
*/
|
|
192
|
+
type BriefWorkItem = {
|
|
193
|
+
id: number;
|
|
194
|
+
name: string;
|
|
195
|
+
spaceId: string;
|
|
196
|
+
workObjectId: string;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* @public
|
|
200
|
+
* 模板(仅含关键属性)
|
|
201
|
+
*/
|
|
202
|
+
interface BriefTemplate {
|
|
203
|
+
id: number;
|
|
204
|
+
name: string;
|
|
205
|
+
flowMode: FlowMode;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @public
|
|
209
|
+
* 角色
|
|
210
|
+
*/
|
|
211
|
+
interface Role {
|
|
212
|
+
id: string;
|
|
213
|
+
name: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* @public
|
|
217
|
+
* 角色与人员
|
|
218
|
+
*/
|
|
219
|
+
interface RoleOwners {
|
|
220
|
+
roleId: string;
|
|
221
|
+
owners: User[];
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @public
|
|
225
|
+
* 工作流模式
|
|
226
|
+
*/
|
|
227
|
+
declare enum FlowMode {
|
|
228
|
+
/**
|
|
229
|
+
* 节点流,TODO: 需要给一些介绍
|
|
230
|
+
*/
|
|
231
|
+
workFlow = "workflow",
|
|
232
|
+
/**
|
|
233
|
+
* 状态流,TODO: 同上
|
|
234
|
+
*/
|
|
235
|
+
stateFlow = "stateflow"
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* @public
|
|
239
|
+
* 工作项基础信息
|
|
240
|
+
*/
|
|
241
|
+
interface BriefWorkObject {
|
|
242
|
+
id: string;
|
|
243
|
+
name: string;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @public
|
|
247
|
+
* 业务线
|
|
248
|
+
*/
|
|
249
|
+
interface BizLine {
|
|
250
|
+
id: string;
|
|
251
|
+
name: string;
|
|
252
|
+
isLeaf: boolean;
|
|
253
|
+
disabled: boolean;
|
|
254
|
+
children?: BizLine[];
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* @public
|
|
258
|
+
* 流程节点(仅含关键属性)
|
|
259
|
+
*/
|
|
260
|
+
interface BriefNode {
|
|
261
|
+
id: string;
|
|
262
|
+
name: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* @public
|
|
266
|
+
* 视图(仅含关键属性)
|
|
267
|
+
*/
|
|
268
|
+
type BriefView = any;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* 集成构成
|
|
272
|
+
* 用于配置第三方平台&本平台的数据集成规则
|
|
273
|
+
*/
|
|
274
|
+
interface IntegrationFeatureContext {
|
|
275
|
+
/**
|
|
276
|
+
* 空间标识
|
|
277
|
+
*/
|
|
278
|
+
spaceId: string;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* 按钮位置
|
|
282
|
+
*/
|
|
283
|
+
declare enum ButtonScene {
|
|
284
|
+
/**
|
|
285
|
+
* 工作项-更多
|
|
286
|
+
*/
|
|
287
|
+
workItem = 3,
|
|
288
|
+
/**
|
|
289
|
+
* 工作项节点-更多
|
|
290
|
+
*/
|
|
291
|
+
workItemNode = 4
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* 按钮构成
|
|
295
|
+
* 可被配置于详情页工具栏,视图页、视图工具栏、用于操作单个或多个工作项
|
|
296
|
+
*/
|
|
297
|
+
interface ButtonFeatureContext {
|
|
298
|
+
/**
|
|
299
|
+
* 空间标识
|
|
300
|
+
*/
|
|
301
|
+
spaceId: string;
|
|
302
|
+
/**
|
|
303
|
+
* 工作项类型标识
|
|
304
|
+
*/
|
|
305
|
+
workObjectId: string;
|
|
306
|
+
/**
|
|
307
|
+
* 工作项标识
|
|
308
|
+
*/
|
|
309
|
+
workItemId: string;
|
|
310
|
+
/**
|
|
311
|
+
* 按钮位置
|
|
312
|
+
*/
|
|
313
|
+
buttonScene: ButtonScene;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* 内嵌页面构成
|
|
317
|
+
* 一个单独的导航入口+内嵌页面
|
|
318
|
+
*/
|
|
319
|
+
interface PageFeatureContext {
|
|
320
|
+
/**
|
|
321
|
+
* 空间标识
|
|
322
|
+
*/
|
|
323
|
+
spaceId: string;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* 详情页 Tab 构成
|
|
327
|
+
* 工作项详情页中的 Tab 页面
|
|
328
|
+
*/
|
|
329
|
+
interface TabFeatureContext {
|
|
330
|
+
/**
|
|
331
|
+
* 空间标识
|
|
332
|
+
*/
|
|
333
|
+
spaceId: string;
|
|
334
|
+
/**
|
|
335
|
+
* 工作项类型标识
|
|
336
|
+
*/
|
|
337
|
+
workObjectId: string;
|
|
338
|
+
/**
|
|
339
|
+
* 工作项标识
|
|
340
|
+
*/
|
|
341
|
+
workItemId: string;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* 视图构成
|
|
345
|
+
* 工作项视图或者图表视图页面
|
|
346
|
+
*/
|
|
347
|
+
interface ViewFeatureContext {
|
|
348
|
+
/**
|
|
349
|
+
* 空间标识
|
|
350
|
+
*/
|
|
351
|
+
spaceId: string;
|
|
352
|
+
/**
|
|
353
|
+
* 工作项类型标识
|
|
354
|
+
*/
|
|
355
|
+
workObjectId: string;
|
|
356
|
+
/**
|
|
357
|
+
* 视图标识
|
|
358
|
+
*/
|
|
359
|
+
viewId: string;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* 控件构成
|
|
363
|
+
* 可被配置于详情页、节点流转、状态流转表单、表格页并可用于筛选和分组
|
|
364
|
+
*/
|
|
365
|
+
interface ControlFeatureContext {
|
|
366
|
+
[key: string]: any;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* 拦截事件类型
|
|
370
|
+
*/
|
|
371
|
+
declare enum InterceptionEvent {
|
|
372
|
+
/** 创建工作项 */
|
|
373
|
+
CreateWorkItem = 1001,
|
|
374
|
+
/** 删除工作项 */
|
|
375
|
+
DeleteWorkItem = 1002,
|
|
376
|
+
/** 批量删除工作项 */
|
|
377
|
+
BatchDeleteWorkItem = 1003,
|
|
378
|
+
/** 恢复工作项 */
|
|
379
|
+
RecoveryWorkItem = 1004,
|
|
380
|
+
/** 终止工作项 */
|
|
381
|
+
AbortWorkItem = 1005,
|
|
382
|
+
/** 模板升级 */
|
|
383
|
+
UpgradeTemplate = 1006,
|
|
384
|
+
/** 批量模板升级 */
|
|
385
|
+
BatchUpgradeTemplate = 1007,
|
|
386
|
+
/** 导出工作项 */
|
|
387
|
+
ExportWorkItem = 1008,
|
|
388
|
+
/** 完成节点 */
|
|
389
|
+
FinishNode = 2001,
|
|
390
|
+
/** 删除节点 */
|
|
391
|
+
DeleteNode = 2002,
|
|
392
|
+
/** 恢复节点 */
|
|
393
|
+
RecoveryNode = 2003,
|
|
394
|
+
/** 回滚节点 */
|
|
395
|
+
RollBackNode = 2004,
|
|
396
|
+
/** 填写排期与估分 */
|
|
397
|
+
EditSchedule = 2005,
|
|
398
|
+
/** 变更状态 */
|
|
399
|
+
UpdateState = 3001
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* 拦截构成
|
|
403
|
+
* 用于拦截用户行为,包括拦截位置、触发规则和提示等相关配置
|
|
404
|
+
*/
|
|
405
|
+
interface InterceptionFeatureContext {
|
|
406
|
+
eventType: InterceptionEvent;
|
|
407
|
+
spaceId: string;
|
|
408
|
+
workItems: Array<BriefWorkItem>;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* @internal
|
|
413
|
+
*/
|
|
414
|
+
type unwatch = () => void;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* @public
|
|
418
|
+
* 当前会话状态
|
|
419
|
+
*/
|
|
420
|
+
declare abstract class Session extends BaseModel {
|
|
421
|
+
/**
|
|
422
|
+
* @internal
|
|
423
|
+
*/
|
|
424
|
+
protected static [IMPL_KEY]: string;
|
|
425
|
+
/**
|
|
426
|
+
* 当前登录用户信息
|
|
427
|
+
*/
|
|
428
|
+
abstract user: User;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* @public
|
|
433
|
+
* 当前页面状态集合
|
|
434
|
+
*/
|
|
435
|
+
declare abstract class Cursor extends BaseModel {
|
|
436
|
+
/**
|
|
437
|
+
* @internal
|
|
438
|
+
*/
|
|
439
|
+
protected static [IMPL_KEY]: string;
|
|
440
|
+
/**
|
|
441
|
+
* 详情页的状态
|
|
442
|
+
*/
|
|
443
|
+
abstract detailPage?: {
|
|
444
|
+
/**
|
|
445
|
+
* 激活工作项
|
|
446
|
+
*/
|
|
447
|
+
activeWorkItem?: BriefWorkItem;
|
|
448
|
+
/**
|
|
449
|
+
* 当前选中的工作流节点
|
|
450
|
+
*/
|
|
451
|
+
selectedWorkflowNode?: BriefNode;
|
|
452
|
+
};
|
|
453
|
+
/**
|
|
454
|
+
* 监听 Cursor 变化,目前仅在 Web 端 detailPage.activeWorkItem、detailPage.selectedWorkflowNode 变化时触发回调
|
|
455
|
+
* @param callback
|
|
456
|
+
*/
|
|
457
|
+
abstract watch(callback: (nextValue: Cursor) => void): unwatch;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* @public
|
|
462
|
+
* 项目空间
|
|
463
|
+
*/
|
|
464
|
+
declare abstract class Space extends BaseModel {
|
|
465
|
+
/**
|
|
466
|
+
* @internal
|
|
467
|
+
*/
|
|
468
|
+
protected static [IMPL_KEY]: string;
|
|
469
|
+
/**
|
|
470
|
+
* 加载空间模型
|
|
471
|
+
* @param id 空间唯一标识
|
|
472
|
+
* @returns 空间实例(Promise)
|
|
473
|
+
*/
|
|
474
|
+
static load(id: string): Promise<Space>;
|
|
475
|
+
/**
|
|
476
|
+
* 空间唯一标识
|
|
477
|
+
*/
|
|
478
|
+
abstract id: string;
|
|
479
|
+
/**
|
|
480
|
+
* 空间名称
|
|
481
|
+
*/
|
|
482
|
+
abstract name: string;
|
|
483
|
+
/**
|
|
484
|
+
* 所有工作项列表
|
|
485
|
+
*/
|
|
486
|
+
abstract allWorkObjectList: BriefWorkObject[];
|
|
487
|
+
/**
|
|
488
|
+
* 启用的工作项列表
|
|
489
|
+
*/
|
|
490
|
+
abstract enabledWorkObjectList: BriefWorkObject[];
|
|
491
|
+
/**
|
|
492
|
+
* 禁用的工作项列表
|
|
493
|
+
*/
|
|
494
|
+
abstract disabledWorkObjectList: BriefWorkObject[];
|
|
495
|
+
/**
|
|
496
|
+
* 获取空间业务线列表
|
|
497
|
+
* @returns 空间业务线列表
|
|
498
|
+
*/
|
|
499
|
+
abstract getBizLineList(): Promise<Array<BizLine> | undefined>;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* @public
|
|
504
|
+
* 工作项对象
|
|
505
|
+
*/
|
|
506
|
+
declare abstract class WorkObject extends BaseModel {
|
|
507
|
+
/**
|
|
508
|
+
* @internal
|
|
509
|
+
*/
|
|
510
|
+
protected static [IMPL_KEY]: string;
|
|
511
|
+
/**
|
|
512
|
+
* 加载工作项对象模型
|
|
513
|
+
* @param params
|
|
514
|
+
* spaceId 空间唯一标识
|
|
515
|
+
* workObjectId 工作项对象唯一标识
|
|
516
|
+
*/
|
|
517
|
+
static load(params: {
|
|
518
|
+
spaceId: string;
|
|
519
|
+
workObjectId: string;
|
|
520
|
+
}): Promise<WorkObject>;
|
|
521
|
+
/**
|
|
522
|
+
* 唯一标识
|
|
523
|
+
*/
|
|
524
|
+
abstract id: string;
|
|
525
|
+
/**
|
|
526
|
+
* 工作流模式
|
|
527
|
+
*/
|
|
528
|
+
abstract flowMode: FlowMode;
|
|
529
|
+
/**
|
|
530
|
+
* 所属空间标识
|
|
531
|
+
*/
|
|
532
|
+
abstract spaceId: string;
|
|
533
|
+
/**
|
|
534
|
+
* 名称
|
|
535
|
+
*/
|
|
536
|
+
abstract name: string;
|
|
537
|
+
/**
|
|
538
|
+
* 描述
|
|
539
|
+
*/
|
|
540
|
+
abstract description: string;
|
|
541
|
+
/**
|
|
542
|
+
* 字段列表
|
|
543
|
+
*/
|
|
544
|
+
abstract fieldList: BriefField[];
|
|
545
|
+
/**
|
|
546
|
+
* 读流程模板列表
|
|
547
|
+
*/
|
|
548
|
+
abstract getTemplateList(): Promise<BriefTemplate[]>;
|
|
549
|
+
/**
|
|
550
|
+
* 读取角色列表
|
|
551
|
+
*/
|
|
552
|
+
abstract getRoleList(): Promise<Role[]>;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* @public
|
|
557
|
+
* 工作项实例
|
|
558
|
+
*/
|
|
559
|
+
declare abstract class WorkItem extends BaseModel {
|
|
560
|
+
/**
|
|
561
|
+
* @internal
|
|
562
|
+
*/
|
|
563
|
+
protected static [IMPL_KEY]: string;
|
|
564
|
+
/**
|
|
565
|
+
* 加载工作项实例模型
|
|
566
|
+
* @param params
|
|
567
|
+
* spaceId 空间唯一标识
|
|
568
|
+
* workObjectId 工作项对象唯一标识
|
|
569
|
+
* workItemId 工作项实例唯一标识
|
|
570
|
+
*/
|
|
571
|
+
static load(params: {
|
|
572
|
+
spaceId: string;
|
|
573
|
+
workObjectId: string;
|
|
574
|
+
workItemId: number;
|
|
575
|
+
}): Promise<WorkItem>;
|
|
576
|
+
/**
|
|
577
|
+
* 唯一标识
|
|
578
|
+
*/
|
|
579
|
+
abstract id: number;
|
|
580
|
+
/**
|
|
581
|
+
* 空间标识
|
|
582
|
+
*/
|
|
583
|
+
abstract spaceId: string;
|
|
584
|
+
/**
|
|
585
|
+
* 所属工作项标识
|
|
586
|
+
*/
|
|
587
|
+
abstract workObjectId: string;
|
|
588
|
+
/**
|
|
589
|
+
* 使用的工作项模板标识
|
|
590
|
+
*/
|
|
591
|
+
abstract templateId: string;
|
|
592
|
+
/**
|
|
593
|
+
* 工作项实例名称
|
|
594
|
+
*/
|
|
595
|
+
abstract name: string;
|
|
596
|
+
/**
|
|
597
|
+
* 角色与人员列表
|
|
598
|
+
*/
|
|
599
|
+
abstract roleOwnersList: RoleOwners[];
|
|
600
|
+
/**
|
|
601
|
+
* 工作项实例已终止
|
|
602
|
+
*/
|
|
603
|
+
abstract isAborted: boolean;
|
|
604
|
+
/**
|
|
605
|
+
* 工作项实例已删除
|
|
606
|
+
*/
|
|
607
|
+
abstract isDeleted: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* 获取工作项实例自定义字段相关数据
|
|
610
|
+
* TODO: 类型暂未定义
|
|
611
|
+
*/
|
|
612
|
+
abstract getFieldValue(filedId: string): any;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* @public
|
|
617
|
+
* 字段
|
|
618
|
+
*/
|
|
619
|
+
declare abstract class Field extends BaseModel {
|
|
620
|
+
/**
|
|
621
|
+
* @internal
|
|
622
|
+
*/
|
|
623
|
+
protected static [IMPL_KEY]: string;
|
|
624
|
+
/**
|
|
625
|
+
* 加载字段模型
|
|
626
|
+
* @param id 字段唯一标识
|
|
627
|
+
* spaceId 空间唯一标识
|
|
628
|
+
* workObjectId 工作项对象唯一标识
|
|
629
|
+
* fieldId 字段唯一标识
|
|
630
|
+
*/
|
|
631
|
+
static load(params: {
|
|
632
|
+
spaceId: string;
|
|
633
|
+
workObjectId: string;
|
|
634
|
+
fieldId: string;
|
|
635
|
+
}): Promise<Field>;
|
|
636
|
+
/**
|
|
637
|
+
* 字段唯一标识
|
|
638
|
+
*/
|
|
639
|
+
abstract id: string;
|
|
640
|
+
/**
|
|
641
|
+
* 字段类型
|
|
642
|
+
*/
|
|
643
|
+
abstract type: FieldType;
|
|
644
|
+
/**
|
|
645
|
+
* 字段名称
|
|
646
|
+
*/
|
|
647
|
+
abstract name: string;
|
|
648
|
+
/**
|
|
649
|
+
* 属于系统字段(用户可编辑值)
|
|
650
|
+
*/
|
|
651
|
+
abstract isSystemField: boolean;
|
|
652
|
+
/**
|
|
653
|
+
* 属于系统计算字段(用户不可编辑值,由系统自动计算)
|
|
654
|
+
*/
|
|
655
|
+
abstract isSystemCalculateField: boolean;
|
|
656
|
+
/**
|
|
657
|
+
* 属于公式字段
|
|
658
|
+
*/
|
|
659
|
+
abstract isFormulaField: boolean;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* @public
|
|
664
|
+
* SDKClient 的配置项
|
|
665
|
+
*/
|
|
666
|
+
interface SDKClientOptions {
|
|
667
|
+
isDebug?: boolean;
|
|
668
|
+
pluginId: string;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* @public
|
|
672
|
+
* SDKClient 是使用 SDK 的入口,需要通过 SDKClient 实例化并配置相关数据后才能调用 API
|
|
673
|
+
*/
|
|
674
|
+
declare class SDKClient {
|
|
675
|
+
/**
|
|
676
|
+
* SDK 版本号
|
|
677
|
+
*/
|
|
678
|
+
static version: string;
|
|
679
|
+
/**
|
|
680
|
+
* 宿主环境
|
|
681
|
+
*/
|
|
682
|
+
get hostEnv(): HostEnv;
|
|
683
|
+
/**
|
|
684
|
+
* 当前会话状态,如当前登录用户
|
|
685
|
+
*/
|
|
686
|
+
get session(): Session;
|
|
687
|
+
/**
|
|
688
|
+
* 当前页面状态集合,如详情页选中的节点
|
|
689
|
+
*/
|
|
690
|
+
get cursor(): Cursor;
|
|
691
|
+
/**
|
|
692
|
+
* 空间
|
|
693
|
+
*/
|
|
694
|
+
get Space(): typeof Space;
|
|
695
|
+
/**
|
|
696
|
+
* 工作项配置
|
|
697
|
+
*/
|
|
698
|
+
get WorkObject(): typeof WorkObject;
|
|
699
|
+
/**
|
|
700
|
+
* 工作项
|
|
701
|
+
*/
|
|
702
|
+
get WorkItem(): typeof WorkItem;
|
|
703
|
+
/**
|
|
704
|
+
* 字段
|
|
705
|
+
*/
|
|
706
|
+
get Field(): typeof Field;
|
|
707
|
+
/**
|
|
708
|
+
* @internal
|
|
709
|
+
*/
|
|
710
|
+
private _meegoBizHub;
|
|
711
|
+
/**
|
|
712
|
+
* JSSDK 初始化配置
|
|
713
|
+
* @param options 配置项
|
|
714
|
+
* @returns sdk
|
|
715
|
+
*/
|
|
716
|
+
config(options: SDKClientOptions): Promise<this>;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* 用于飞书项目插件读取系统数据的 JSSDK
|
|
721
|
+
*
|
|
722
|
+
* @remarks
|
|
723
|
+
* 使用 SDK 之前请先初始化 {@link SDKClient},并通过 config 配置
|
|
724
|
+
*
|
|
725
|
+
* @packageDocumentation
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
export { BizLine, BriefField, BriefNode, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, ButtonFeatureContext, ButtonScene, ControlFeatureContext, Cursor, Field, FieldType, FlowMode, HostEnv, IMPL_KEY, IntegrationFeatureContext, InterceptionEvent, InterceptionFeatureContext, Language, MEEGO_BIZ_HUB, PageFeatureContext, Role, RoleOwners, SDKClient, SDKClientOptions, Session, Space, TabFeatureContext, User, ViewFeatureContext, WorkItem, WorkObject, SDKClient as default, unwatch };
|