@lark-project/js-sdk 2.0.1-alpha.8 → 2.0.2-dev.0
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/CHANGELOG.md +13 -0
- package/dist/es/index.js +97 -13
- package/dist/lib/index.js +101 -13
- package/dist/types/index.d.ts +236 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
|
+
## 2.0.6 (2024/09/12)
|
|
3
|
+
- 「Add」新增 Fullscreen Modal
|
|
4
|
+
|
|
5
|
+
## 2.0.5 (2024/08/13)
|
|
6
|
+
- 「Add」新增 Button Context
|
|
7
|
+
|
|
8
|
+
## 2.0.4(2024/08/06)
|
|
9
|
+
- 「Add」新增 WorkItemFinder
|
|
10
|
+
|
|
11
|
+
## 2.0.3(2024/07/22)
|
|
12
|
+
- 「Add」新增 Control Context
|
|
13
|
+
- 「Add」新增 NotSupportedError
|
|
14
|
+
|
|
2
15
|
## 2.0.2(2024/07/11)
|
|
3
16
|
- 「Add」新增 ContainerModal
|
|
4
17
|
- 「Add」新增 Intercept
|
package/dist/es/index.js
CHANGED
|
@@ -260,9 +260,9 @@ _a12 = IMPL_KEY;
|
|
|
260
260
|
*/
|
|
261
261
|
RichTextEditor[_a12] = "richTextEditor";
|
|
262
262
|
|
|
263
|
-
// src/biz/
|
|
263
|
+
// src/biz/WorkItemFinder.ts
|
|
264
264
|
var _a13;
|
|
265
|
-
var
|
|
265
|
+
var WorkItemFinder = class extends BaseModel {
|
|
266
266
|
/**
|
|
267
267
|
* @internal
|
|
268
268
|
*/
|
|
@@ -274,10 +274,42 @@ _a13 = IMPL_KEY;
|
|
|
274
274
|
/**
|
|
275
275
|
* @internal
|
|
276
276
|
*/
|
|
277
|
-
|
|
277
|
+
WorkItemFinder[_a13] = "workItemFinder";
|
|
278
278
|
|
|
279
|
-
// src/
|
|
279
|
+
// src/biz/Utils.ts
|
|
280
280
|
var _a14;
|
|
281
|
+
var Utils = class extends BaseModel {
|
|
282
|
+
/**
|
|
283
|
+
* @internal
|
|
284
|
+
*/
|
|
285
|
+
static load() {
|
|
286
|
+
throw new Error("not implemented");
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
_a14 = IMPL_KEY;
|
|
290
|
+
/**
|
|
291
|
+
* @internal
|
|
292
|
+
*/
|
|
293
|
+
Utils[_a14] = "utils";
|
|
294
|
+
|
|
295
|
+
// src/biz/Broadcast.ts
|
|
296
|
+
var _a15;
|
|
297
|
+
var Broadcast = class extends BaseModel {
|
|
298
|
+
/**
|
|
299
|
+
* @internal
|
|
300
|
+
*/
|
|
301
|
+
static load() {
|
|
302
|
+
throw new Error("not implemented");
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
_a15 = IMPL_KEY;
|
|
306
|
+
/**
|
|
307
|
+
* @internal
|
|
308
|
+
*/
|
|
309
|
+
Broadcast[_a15] = "broadcast";
|
|
310
|
+
|
|
311
|
+
// src/features/ContainerModal.ts
|
|
312
|
+
var _a16;
|
|
281
313
|
var ContainerModal = class extends BaseModel {
|
|
282
314
|
/**
|
|
283
315
|
* 加载数据
|
|
@@ -286,14 +318,14 @@ var ContainerModal = class extends BaseModel {
|
|
|
286
318
|
throw new Error("not implemented");
|
|
287
319
|
}
|
|
288
320
|
};
|
|
289
|
-
|
|
321
|
+
_a16 = IMPL_KEY;
|
|
290
322
|
/**
|
|
291
323
|
* @internal
|
|
292
324
|
*/
|
|
293
|
-
ContainerModal[
|
|
325
|
+
ContainerModal[_a16] = "ContainerModal";
|
|
294
326
|
|
|
295
327
|
// src/features/Intercept.ts
|
|
296
|
-
var
|
|
328
|
+
var _a17;
|
|
297
329
|
var Intercept = class extends BaseModel {
|
|
298
330
|
/**
|
|
299
331
|
* 加载数据
|
|
@@ -302,14 +334,14 @@ var Intercept = class extends BaseModel {
|
|
|
302
334
|
throw new Error("not implemented");
|
|
303
335
|
}
|
|
304
336
|
};
|
|
305
|
-
|
|
337
|
+
_a17 = IMPL_KEY;
|
|
306
338
|
/**
|
|
307
339
|
* @internal
|
|
308
340
|
*/
|
|
309
|
-
Intercept[
|
|
341
|
+
Intercept[_a17] = "Intercept";
|
|
310
342
|
|
|
311
343
|
// src/features/Control.ts
|
|
312
|
-
var
|
|
344
|
+
var _a18;
|
|
313
345
|
var Control = class extends BaseModel {
|
|
314
346
|
/**
|
|
315
347
|
* 加载数据
|
|
@@ -318,11 +350,27 @@ var Control = class extends BaseModel {
|
|
|
318
350
|
throw new Error("not implemented");
|
|
319
351
|
}
|
|
320
352
|
};
|
|
321
|
-
|
|
353
|
+
_a18 = IMPL_KEY;
|
|
322
354
|
/**
|
|
323
355
|
* @internal
|
|
324
356
|
*/
|
|
325
|
-
Control[
|
|
357
|
+
Control[_a18] = "Control";
|
|
358
|
+
|
|
359
|
+
// src/features/Button.ts
|
|
360
|
+
var _a19;
|
|
361
|
+
var Button = class extends BaseModel {
|
|
362
|
+
/**
|
|
363
|
+
* 加载数据
|
|
364
|
+
*/
|
|
365
|
+
static load() {
|
|
366
|
+
throw new Error("not implemented");
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
_a19 = IMPL_KEY;
|
|
370
|
+
/**
|
|
371
|
+
* @internal
|
|
372
|
+
*/
|
|
373
|
+
Button[_a19] = "Button";
|
|
326
374
|
|
|
327
375
|
// src/client.ts
|
|
328
376
|
function getImplClass(decl, impls) {
|
|
@@ -346,6 +394,20 @@ var _SDKClient = class {
|
|
|
346
394
|
get intercept() {
|
|
347
395
|
return getImplValue(Intercept, this._meegoBizHub);
|
|
348
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* 控件点位容器特有能力
|
|
399
|
+
* only 2.0
|
|
400
|
+
*/
|
|
401
|
+
get control() {
|
|
402
|
+
return getImplValue(Control, this._meegoBizHub);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* 按钮点位容器特有能力
|
|
406
|
+
* only 2.0
|
|
407
|
+
*/
|
|
408
|
+
get button() {
|
|
409
|
+
return getImplValue(Button, this._meegoBizHub);
|
|
410
|
+
}
|
|
349
411
|
/**
|
|
350
412
|
* 应用导航
|
|
351
413
|
*/
|
|
@@ -377,6 +439,13 @@ var _SDKClient = class {
|
|
|
377
439
|
get richTextEditor() {
|
|
378
440
|
return getImplValue(RichTextEditor, this._meegoBizHub);
|
|
379
441
|
}
|
|
442
|
+
/**
|
|
443
|
+
* 工作项实例筛选器
|
|
444
|
+
* only web 2.0
|
|
445
|
+
*/
|
|
446
|
+
get workItemFinder() {
|
|
447
|
+
return getImplValue(WorkItemFinder, this._meegoBizHub);
|
|
448
|
+
}
|
|
380
449
|
/**
|
|
381
450
|
* 模态框
|
|
382
451
|
*/
|
|
@@ -452,7 +521,7 @@ var SDKClient = _SDKClient;
|
|
|
452
521
|
/**
|
|
453
522
|
* SDK 版本号
|
|
454
523
|
*/
|
|
455
|
-
SDKClient.version = "2.0.
|
|
524
|
+
SDKClient.version = "2.0.2-dev.0";
|
|
456
525
|
|
|
457
526
|
// src/types/biz.ts
|
|
458
527
|
var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
|
|
@@ -586,11 +655,24 @@ var InvalidParamsError = class extends CustomError {
|
|
|
586
655
|
}
|
|
587
656
|
};
|
|
588
657
|
|
|
658
|
+
// src/errors/NotSupportedError.ts
|
|
659
|
+
var NotSupportedError = class extends CustomError {
|
|
660
|
+
constructor(options) {
|
|
661
|
+
super({
|
|
662
|
+
message: "the api is not supported",
|
|
663
|
+
originMessage: options.originMessage
|
|
664
|
+
});
|
|
665
|
+
this.name = "NotSupportedError";
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
|
|
589
669
|
// src/index.ts
|
|
590
670
|
var src_default = SDKClient;
|
|
591
671
|
export {
|
|
592
672
|
ActionSheet,
|
|
593
673
|
AttributeType,
|
|
674
|
+
Broadcast,
|
|
675
|
+
Button,
|
|
594
676
|
ButtonScene,
|
|
595
677
|
Clipboard,
|
|
596
678
|
ContainerModal,
|
|
@@ -610,6 +692,7 @@ export {
|
|
|
610
692
|
NoAuthError,
|
|
611
693
|
NodeStatus,
|
|
612
694
|
NotFoundError,
|
|
695
|
+
NotSupportedError,
|
|
613
696
|
OutOfLimitError,
|
|
614
697
|
RichTextEditor,
|
|
615
698
|
SDKClient,
|
|
@@ -618,6 +701,7 @@ export {
|
|
|
618
701
|
Toast,
|
|
619
702
|
Utils,
|
|
620
703
|
WorkItem,
|
|
704
|
+
WorkItemFinder,
|
|
621
705
|
WorkObject,
|
|
622
706
|
src_default as default
|
|
623
707
|
};
|
package/dist/lib/index.js
CHANGED
|
@@ -50,6 +50,8 @@ var src_exports = {};
|
|
|
50
50
|
__export(src_exports, {
|
|
51
51
|
ActionSheet: () => ActionSheet,
|
|
52
52
|
AttributeType: () => AttributeType,
|
|
53
|
+
Broadcast: () => Broadcast,
|
|
54
|
+
Button: () => Button,
|
|
53
55
|
ButtonScene: () => ButtonScene,
|
|
54
56
|
Clipboard: () => Clipboard,
|
|
55
57
|
ContainerModal: () => ContainerModal,
|
|
@@ -69,6 +71,7 @@ __export(src_exports, {
|
|
|
69
71
|
NoAuthError: () => NoAuthError,
|
|
70
72
|
NodeStatus: () => NodeStatus,
|
|
71
73
|
NotFoundError: () => NotFoundError,
|
|
74
|
+
NotSupportedError: () => NotSupportedError,
|
|
72
75
|
OutOfLimitError: () => OutOfLimitError,
|
|
73
76
|
RichTextEditor: () => RichTextEditor,
|
|
74
77
|
SDKClient: () => SDKClient,
|
|
@@ -77,6 +80,7 @@ __export(src_exports, {
|
|
|
77
80
|
Toast: () => Toast,
|
|
78
81
|
Utils: () => Utils,
|
|
79
82
|
WorkItem: () => WorkItem,
|
|
83
|
+
WorkItemFinder: () => WorkItemFinder,
|
|
80
84
|
WorkObject: () => WorkObject,
|
|
81
85
|
default: () => src_default
|
|
82
86
|
});
|
|
@@ -314,9 +318,9 @@ _a12 = IMPL_KEY;
|
|
|
314
318
|
*/
|
|
315
319
|
RichTextEditor[_a12] = "richTextEditor";
|
|
316
320
|
|
|
317
|
-
// src/biz/
|
|
321
|
+
// src/biz/WorkItemFinder.ts
|
|
318
322
|
var _a13;
|
|
319
|
-
var
|
|
323
|
+
var WorkItemFinder = class extends BaseModel {
|
|
320
324
|
/**
|
|
321
325
|
* @internal
|
|
322
326
|
*/
|
|
@@ -328,10 +332,42 @@ _a13 = IMPL_KEY;
|
|
|
328
332
|
/**
|
|
329
333
|
* @internal
|
|
330
334
|
*/
|
|
331
|
-
|
|
335
|
+
WorkItemFinder[_a13] = "workItemFinder";
|
|
332
336
|
|
|
333
|
-
// src/
|
|
337
|
+
// src/biz/Utils.ts
|
|
334
338
|
var _a14;
|
|
339
|
+
var Utils = class extends BaseModel {
|
|
340
|
+
/**
|
|
341
|
+
* @internal
|
|
342
|
+
*/
|
|
343
|
+
static load() {
|
|
344
|
+
throw new Error("not implemented");
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
_a14 = IMPL_KEY;
|
|
348
|
+
/**
|
|
349
|
+
* @internal
|
|
350
|
+
*/
|
|
351
|
+
Utils[_a14] = "utils";
|
|
352
|
+
|
|
353
|
+
// src/biz/Broadcast.ts
|
|
354
|
+
var _a15;
|
|
355
|
+
var Broadcast = class extends BaseModel {
|
|
356
|
+
/**
|
|
357
|
+
* @internal
|
|
358
|
+
*/
|
|
359
|
+
static load() {
|
|
360
|
+
throw new Error("not implemented");
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
_a15 = IMPL_KEY;
|
|
364
|
+
/**
|
|
365
|
+
* @internal
|
|
366
|
+
*/
|
|
367
|
+
Broadcast[_a15] = "broadcast";
|
|
368
|
+
|
|
369
|
+
// src/features/ContainerModal.ts
|
|
370
|
+
var _a16;
|
|
335
371
|
var ContainerModal = class extends BaseModel {
|
|
336
372
|
/**
|
|
337
373
|
* 加载数据
|
|
@@ -340,14 +376,14 @@ var ContainerModal = class extends BaseModel {
|
|
|
340
376
|
throw new Error("not implemented");
|
|
341
377
|
}
|
|
342
378
|
};
|
|
343
|
-
|
|
379
|
+
_a16 = IMPL_KEY;
|
|
344
380
|
/**
|
|
345
381
|
* @internal
|
|
346
382
|
*/
|
|
347
|
-
ContainerModal[
|
|
383
|
+
ContainerModal[_a16] = "ContainerModal";
|
|
348
384
|
|
|
349
385
|
// src/features/Intercept.ts
|
|
350
|
-
var
|
|
386
|
+
var _a17;
|
|
351
387
|
var Intercept = class extends BaseModel {
|
|
352
388
|
/**
|
|
353
389
|
* 加载数据
|
|
@@ -356,14 +392,14 @@ var Intercept = class extends BaseModel {
|
|
|
356
392
|
throw new Error("not implemented");
|
|
357
393
|
}
|
|
358
394
|
};
|
|
359
|
-
|
|
395
|
+
_a17 = IMPL_KEY;
|
|
360
396
|
/**
|
|
361
397
|
* @internal
|
|
362
398
|
*/
|
|
363
|
-
Intercept[
|
|
399
|
+
Intercept[_a17] = "Intercept";
|
|
364
400
|
|
|
365
401
|
// src/features/Control.ts
|
|
366
|
-
var
|
|
402
|
+
var _a18;
|
|
367
403
|
var Control = class extends BaseModel {
|
|
368
404
|
/**
|
|
369
405
|
* 加载数据
|
|
@@ -372,11 +408,27 @@ var Control = class extends BaseModel {
|
|
|
372
408
|
throw new Error("not implemented");
|
|
373
409
|
}
|
|
374
410
|
};
|
|
375
|
-
|
|
411
|
+
_a18 = IMPL_KEY;
|
|
376
412
|
/**
|
|
377
413
|
* @internal
|
|
378
414
|
*/
|
|
379
|
-
Control[
|
|
415
|
+
Control[_a18] = "Control";
|
|
416
|
+
|
|
417
|
+
// src/features/Button.ts
|
|
418
|
+
var _a19;
|
|
419
|
+
var Button = class extends BaseModel {
|
|
420
|
+
/**
|
|
421
|
+
* 加载数据
|
|
422
|
+
*/
|
|
423
|
+
static load() {
|
|
424
|
+
throw new Error("not implemented");
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
_a19 = IMPL_KEY;
|
|
428
|
+
/**
|
|
429
|
+
* @internal
|
|
430
|
+
*/
|
|
431
|
+
Button[_a19] = "Button";
|
|
380
432
|
|
|
381
433
|
// src/client.ts
|
|
382
434
|
function getImplClass(decl, impls) {
|
|
@@ -400,6 +452,20 @@ var _SDKClient = class {
|
|
|
400
452
|
get intercept() {
|
|
401
453
|
return getImplValue(Intercept, this._meegoBizHub);
|
|
402
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* 控件点位容器特有能力
|
|
457
|
+
* only 2.0
|
|
458
|
+
*/
|
|
459
|
+
get control() {
|
|
460
|
+
return getImplValue(Control, this._meegoBizHub);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* 按钮点位容器特有能力
|
|
464
|
+
* only 2.0
|
|
465
|
+
*/
|
|
466
|
+
get button() {
|
|
467
|
+
return getImplValue(Button, this._meegoBizHub);
|
|
468
|
+
}
|
|
403
469
|
/**
|
|
404
470
|
* 应用导航
|
|
405
471
|
*/
|
|
@@ -431,6 +497,13 @@ var _SDKClient = class {
|
|
|
431
497
|
get richTextEditor() {
|
|
432
498
|
return getImplValue(RichTextEditor, this._meegoBizHub);
|
|
433
499
|
}
|
|
500
|
+
/**
|
|
501
|
+
* 工作项实例筛选器
|
|
502
|
+
* only web 2.0
|
|
503
|
+
*/
|
|
504
|
+
get workItemFinder() {
|
|
505
|
+
return getImplValue(WorkItemFinder, this._meegoBizHub);
|
|
506
|
+
}
|
|
434
507
|
/**
|
|
435
508
|
* 模态框
|
|
436
509
|
*/
|
|
@@ -506,7 +579,7 @@ var SDKClient = _SDKClient;
|
|
|
506
579
|
/**
|
|
507
580
|
* SDK 版本号
|
|
508
581
|
*/
|
|
509
|
-
SDKClient.version = "2.0.
|
|
582
|
+
SDKClient.version = "2.0.2-dev.0";
|
|
510
583
|
|
|
511
584
|
// src/types/biz.ts
|
|
512
585
|
var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
|
|
@@ -640,12 +713,25 @@ var InvalidParamsError = class extends CustomError {
|
|
|
640
713
|
}
|
|
641
714
|
};
|
|
642
715
|
|
|
716
|
+
// src/errors/NotSupportedError.ts
|
|
717
|
+
var NotSupportedError = class extends CustomError {
|
|
718
|
+
constructor(options) {
|
|
719
|
+
super({
|
|
720
|
+
message: "the api is not supported",
|
|
721
|
+
originMessage: options.originMessage
|
|
722
|
+
});
|
|
723
|
+
this.name = "NotSupportedError";
|
|
724
|
+
}
|
|
725
|
+
};
|
|
726
|
+
|
|
643
727
|
// src/index.ts
|
|
644
728
|
var src_default = SDKClient;
|
|
645
729
|
// Annotate the CommonJS export names for ESM import in node:
|
|
646
730
|
0 && (module.exports = {
|
|
647
731
|
ActionSheet,
|
|
648
732
|
AttributeType,
|
|
733
|
+
Broadcast,
|
|
734
|
+
Button,
|
|
649
735
|
ButtonScene,
|
|
650
736
|
Clipboard,
|
|
651
737
|
ContainerModal,
|
|
@@ -665,6 +751,7 @@ var src_default = SDKClient;
|
|
|
665
751
|
NoAuthError,
|
|
666
752
|
NodeStatus,
|
|
667
753
|
NotFoundError,
|
|
754
|
+
NotSupportedError,
|
|
668
755
|
OutOfLimitError,
|
|
669
756
|
RichTextEditor,
|
|
670
757
|
SDKClient,
|
|
@@ -673,5 +760,6 @@ var src_default = SDKClient;
|
|
|
673
760
|
Toast,
|
|
674
761
|
Utils,
|
|
675
762
|
WorkItem,
|
|
763
|
+
WorkItemFinder,
|
|
676
764
|
WorkObject
|
|
677
765
|
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -328,10 +328,10 @@ declare enum ButtonScene {
|
|
|
328
328
|
workItemNode = 4
|
|
329
329
|
}
|
|
330
330
|
/**
|
|
331
|
-
*
|
|
332
|
-
*
|
|
331
|
+
* 工作项实例按钮上下文
|
|
332
|
+
* 适用场景:工作项-更多 / 节点-更多 / 节点流转
|
|
333
333
|
*/
|
|
334
|
-
interface
|
|
334
|
+
interface WorkItemButtonFeatureContext {
|
|
335
335
|
/**
|
|
336
336
|
* 空间标识
|
|
337
337
|
*/
|
|
@@ -345,10 +345,24 @@ interface ButtonFeatureContext {
|
|
|
345
345
|
*/
|
|
346
346
|
workItemId: number;
|
|
347
347
|
/**
|
|
348
|
-
*
|
|
348
|
+
* 按钮所属节点标识
|
|
349
|
+
* 适用场景:节点-更多 / 节点流转
|
|
349
350
|
*/
|
|
350
|
-
|
|
351
|
+
nodeId?: string;
|
|
351
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* 新建按钮上下文
|
|
355
|
+
*/
|
|
356
|
+
interface CreateButtonFeatureContext {
|
|
357
|
+
/**
|
|
358
|
+
* 空间标识
|
|
359
|
+
*/
|
|
360
|
+
spaceId: string;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* 按钮构成
|
|
364
|
+
*/
|
|
365
|
+
type ButtonFeatureContext = WorkItemButtonFeatureContext | CreateButtonFeatureContext;
|
|
352
366
|
/**
|
|
353
367
|
* 内嵌页面构成
|
|
354
368
|
* 一个单独的导航入口+内嵌页面
|
|
@@ -461,9 +475,20 @@ interface InterceptFeatureContext<T> {
|
|
|
461
475
|
eventType: InterceptEvent;
|
|
462
476
|
workItems: Array<BriefWorkItem & {
|
|
463
477
|
/**
|
|
464
|
-
*
|
|
478
|
+
* 当前触发事件,不同事件类型对应不同的 changedValue
|
|
465
479
|
*/
|
|
466
|
-
changedValue?:
|
|
480
|
+
changedValue?: {
|
|
481
|
+
fieldInfo?: Array<{
|
|
482
|
+
fieldKey: string;
|
|
483
|
+
fieldType?: string;
|
|
484
|
+
alias?: string;
|
|
485
|
+
beforeFieldValue?: unknown;
|
|
486
|
+
afterFieldValue?: unknown;
|
|
487
|
+
}>;
|
|
488
|
+
nodeInfo?: any;
|
|
489
|
+
subTaskInfo?: any;
|
|
490
|
+
transitionInfo?: any;
|
|
491
|
+
};
|
|
467
492
|
}>;
|
|
468
493
|
customData: T;
|
|
469
494
|
}
|
|
@@ -472,6 +497,7 @@ interface InterceptFeatureContext<T> {
|
|
|
472
497
|
* @internal
|
|
473
498
|
*/
|
|
474
499
|
type unwatch = () => void;
|
|
500
|
+
type Off = unwatch;
|
|
475
501
|
|
|
476
502
|
type IIgnore = string | RegExp | ((value: string) => boolean);
|
|
477
503
|
interface IPluginCustomBuildConfig {
|
|
@@ -545,6 +571,12 @@ declare abstract class Context extends BaseModel {
|
|
|
545
571
|
* @param callback
|
|
546
572
|
*/
|
|
547
573
|
abstract watch(callback: (nextValue: Context) => void): unwatch;
|
|
574
|
+
/**
|
|
575
|
+
* only web 2.0
|
|
576
|
+
* 用于获取插件内设置的上下文数据
|
|
577
|
+
* 例如:在 sdk.modal.open 时传入的 context,可以通过该方法来获取
|
|
578
|
+
*/
|
|
579
|
+
abstract getCustomContext<Context>(): Promise<Context>;
|
|
548
580
|
}
|
|
549
581
|
|
|
550
582
|
/**
|
|
@@ -982,9 +1014,9 @@ declare abstract class ActionSheet extends BaseModel {
|
|
|
982
1014
|
}
|
|
983
1015
|
|
|
984
1016
|
/**
|
|
985
|
-
* Modal 展示配置
|
|
1017
|
+
* Modal confirm 展示配置
|
|
986
1018
|
*/
|
|
987
|
-
interface
|
|
1019
|
+
interface ModalConfirmOptions {
|
|
988
1020
|
/**
|
|
989
1021
|
* 标题
|
|
990
1022
|
* title 和 content 不可同时为空
|
|
@@ -1011,6 +1043,40 @@ interface ModalOptions {
|
|
|
1011
1043
|
*/
|
|
1012
1044
|
cancelText?: string;
|
|
1013
1045
|
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Modal 展示配置
|
|
1048
|
+
*/
|
|
1049
|
+
interface ModalOptions<Context> {
|
|
1050
|
+
/**
|
|
1051
|
+
* 宽度
|
|
1052
|
+
* 默认: 448
|
|
1053
|
+
*/
|
|
1054
|
+
width?: number;
|
|
1055
|
+
/**
|
|
1056
|
+
* 高度
|
|
1057
|
+
*/
|
|
1058
|
+
height?: number;
|
|
1059
|
+
/**
|
|
1060
|
+
* 是否全屏
|
|
1061
|
+
* 全屏时 width / height 无效
|
|
1062
|
+
*/
|
|
1063
|
+
fullScreen?: boolean;
|
|
1064
|
+
/**
|
|
1065
|
+
* 是否允许通过点击遮罩来关闭对话框
|
|
1066
|
+
*/
|
|
1067
|
+
maskClosable?: boolean;
|
|
1068
|
+
/**
|
|
1069
|
+
* 传入 Modal 内的上下文数据
|
|
1070
|
+
* 注:传入的数据在 Modal 内是通过 sdk.containerModal.getContext() 来获取的
|
|
1071
|
+
*/
|
|
1072
|
+
context?: Context;
|
|
1073
|
+
/**
|
|
1074
|
+
* 响应弹窗内调用的 sdk.containerModal.submit 方法
|
|
1075
|
+
* @param params 弹窗内调用的 sdk.containerModal.submit 的方法时传入的自定义参数
|
|
1076
|
+
* @returns 调用 sdk.containerModal.submit 返回的自定义值
|
|
1077
|
+
*/
|
|
1078
|
+
onSubmit?: (params: unknown) => Promise<unknown>;
|
|
1079
|
+
}
|
|
1014
1080
|
/**
|
|
1015
1081
|
* @public
|
|
1016
1082
|
* Modal 用于等待用户响应、告知用户重要信息或在不丢失上下文的情况下展示更多信息
|
|
@@ -1025,16 +1091,25 @@ declare abstract class Modal extends BaseModel {
|
|
|
1025
1091
|
*/
|
|
1026
1092
|
private static load;
|
|
1027
1093
|
/**
|
|
1028
|
-
*
|
|
1094
|
+
* 使用模态框 confirm
|
|
1029
1095
|
* @param options
|
|
1030
1096
|
* @param callback
|
|
1031
1097
|
* confirmed 点击了确认
|
|
1032
1098
|
* canceled 点击了取消
|
|
1033
1099
|
*/
|
|
1034
|
-
abstract
|
|
1100
|
+
abstract confirm(options: string | ModalConfirmOptions, callback: (result: {
|
|
1035
1101
|
confirmed: boolean;
|
|
1036
1102
|
canceled: boolean;
|
|
1037
1103
|
}) => void): Promise<void>;
|
|
1104
|
+
/**
|
|
1105
|
+
* only web 2.0
|
|
1106
|
+
* 打开自定义内容的模态框
|
|
1107
|
+
* @param options
|
|
1108
|
+
* @returns 当前打开 Modal 的关闭方法
|
|
1109
|
+
*/
|
|
1110
|
+
abstract open<Context>(options: ModalOptions<Context>): Promise<{
|
|
1111
|
+
close: () => void;
|
|
1112
|
+
}>;
|
|
1038
1113
|
}
|
|
1039
1114
|
|
|
1040
1115
|
/**
|
|
@@ -1106,7 +1181,62 @@ declare abstract class RichTextEditor extends BaseModel {
|
|
|
1106
1181
|
abstract show(options: RichTextEditorOptions, callback: (result: {
|
|
1107
1182
|
confirmed: boolean;
|
|
1108
1183
|
canceled: boolean;
|
|
1109
|
-
|
|
1184
|
+
nextValue?: RichTextEditorContent;
|
|
1185
|
+
}) => void): Promise<void>;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* WorkItemFinder 配置
|
|
1190
|
+
*/
|
|
1191
|
+
interface WorkItemFinderOptions {
|
|
1192
|
+
/**
|
|
1193
|
+
* 空间标识
|
|
1194
|
+
*/
|
|
1195
|
+
spaceId: string;
|
|
1196
|
+
/**
|
|
1197
|
+
* 工作项类型标识
|
|
1198
|
+
*/
|
|
1199
|
+
workObjectId: string;
|
|
1200
|
+
/**
|
|
1201
|
+
* 筛选器标题,仅用于展示
|
|
1202
|
+
*/
|
|
1203
|
+
title?: string;
|
|
1204
|
+
/**
|
|
1205
|
+
* 搜索条件标识
|
|
1206
|
+
* 如为空则生成新 key,不为空则会覆写
|
|
1207
|
+
* searchId 与 workObjectId | spaceId 不匹配则会异常
|
|
1208
|
+
*/
|
|
1209
|
+
searchId?: string;
|
|
1210
|
+
/**
|
|
1211
|
+
* 默认 true,控制 searchId 的筛选条件是否回填到筛选器
|
|
1212
|
+
*/
|
|
1213
|
+
backfill?: boolean;
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
* @public
|
|
1217
|
+
* WorkItemFinder 用于生成工作项实例筛选条件的面板
|
|
1218
|
+
*/
|
|
1219
|
+
declare abstract class WorkItemFinder extends BaseModel {
|
|
1220
|
+
/**
|
|
1221
|
+
* @internal
|
|
1222
|
+
*/
|
|
1223
|
+
protected static [IMPL_KEY]: string;
|
|
1224
|
+
/**
|
|
1225
|
+
* @internal
|
|
1226
|
+
*/
|
|
1227
|
+
private static load;
|
|
1228
|
+
/**
|
|
1229
|
+
* 打开工作项实例筛选条件面板
|
|
1230
|
+
* @param options
|
|
1231
|
+
* @param callback
|
|
1232
|
+
* confirmed 点击了确认
|
|
1233
|
+
* canceled 点击了取消
|
|
1234
|
+
* searchId 当点击确认时,返回筛选条件标识 searchId
|
|
1235
|
+
*/
|
|
1236
|
+
abstract open(options: WorkItemFinderOptions, callback: (result: {
|
|
1237
|
+
confirmed: boolean;
|
|
1238
|
+
canceled: boolean;
|
|
1239
|
+
searchId?: string;
|
|
1110
1240
|
}) => void): Promise<void>;
|
|
1111
1241
|
}
|
|
1112
1242
|
|
|
@@ -1143,6 +1273,35 @@ declare abstract class Utils extends BaseModel {
|
|
|
1143
1273
|
}>;
|
|
1144
1274
|
}
|
|
1145
1275
|
|
|
1276
|
+
interface IBroadcastDetailPageWorkItemValueChangedEvent {
|
|
1277
|
+
workItems: Array<{
|
|
1278
|
+
id: number;
|
|
1279
|
+
spaceId: string;
|
|
1280
|
+
workObjectId: string;
|
|
1281
|
+
changedKeys: Array<AttributeType | string>;
|
|
1282
|
+
}>;
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* @public
|
|
1286
|
+
* 事件中心
|
|
1287
|
+
*/
|
|
1288
|
+
declare abstract class Broadcast extends BaseModel {
|
|
1289
|
+
/**
|
|
1290
|
+
* @internal
|
|
1291
|
+
*/
|
|
1292
|
+
protected static [IMPL_KEY]: string;
|
|
1293
|
+
/**
|
|
1294
|
+
* @internal
|
|
1295
|
+
*/
|
|
1296
|
+
private static load;
|
|
1297
|
+
/**
|
|
1298
|
+
* 监听详情页工作项值变化
|
|
1299
|
+
* @param watchKeys 监听的工作项属性 / 字段 ID 列表
|
|
1300
|
+
* @param callback 当监听值发生变化时触发
|
|
1301
|
+
*/
|
|
1302
|
+
abstract onDetailPageWorkItemValueChanged(watchKeys: Array<string | AttributeType>, callback: (changed: IBroadcastDetailPageWorkItemValueChangedEvent) => void): Off;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1146
1305
|
/**
|
|
1147
1306
|
* @public
|
|
1148
1307
|
* 插件容器模态框
|
|
@@ -1156,10 +1315,16 @@ declare abstract class ContainerModal extends BaseModel {
|
|
|
1156
1315
|
* 加载数据
|
|
1157
1316
|
*/
|
|
1158
1317
|
static load(): Promise<ContainerModal>;
|
|
1318
|
+
/**
|
|
1319
|
+
* only web 2.0
|
|
1320
|
+
* 只存在于 modal.open 打开的容器内
|
|
1321
|
+
* submit 调用的是 sdk.modal.open 传入的 onSubmit 方法
|
|
1322
|
+
*/
|
|
1323
|
+
abstract submit?: <Params, Result>(params: Params) => Promise<Result>;
|
|
1159
1324
|
/**
|
|
1160
1325
|
* 关闭插件当前激活的容器模态框
|
|
1161
1326
|
*/
|
|
1162
|
-
abstract
|
|
1327
|
+
abstract close(): Promise<void>;
|
|
1163
1328
|
}
|
|
1164
1329
|
|
|
1165
1330
|
/**
|
|
@@ -1178,7 +1343,7 @@ declare abstract class Intercept extends BaseModel {
|
|
|
1178
1343
|
/**
|
|
1179
1344
|
* 获取当前触发的拦截事件上下文
|
|
1180
1345
|
*/
|
|
1181
|
-
abstract
|
|
1346
|
+
abstract getContext<T = any>(): Promise<InterceptFeatureContext<T>>;
|
|
1182
1347
|
}
|
|
1183
1348
|
|
|
1184
1349
|
/**
|
|
@@ -1195,9 +1360,39 @@ declare abstract class Control extends BaseModel {
|
|
|
1195
1360
|
*/
|
|
1196
1361
|
static load(): Promise<Control>;
|
|
1197
1362
|
/**
|
|
1198
|
-
*
|
|
1363
|
+
* 获取当前控件所在的上下文
|
|
1199
1364
|
*/
|
|
1200
1365
|
abstract getContext(): Promise<ControlFeatureContext>;
|
|
1366
|
+
/**
|
|
1367
|
+
* 获取新建工作项表单项的值
|
|
1368
|
+
* @param keys 需要获取的工作项属性 / 字段 ID 列表,一次限制读取 10 个 keys
|
|
1369
|
+
*/
|
|
1370
|
+
abstract getCreateWorkItemFormItemValues(keys: Array<string | AttributeType>): Promise<Record<string | AttributeType, any>>;
|
|
1371
|
+
/**
|
|
1372
|
+
* 监听新建工作项表单项值变化
|
|
1373
|
+
* @param watchKeys 需要监听的工作项属性 / 字段 ID 列表,一次限制读取 10 个 keys
|
|
1374
|
+
* @param callback 当监听值发生变化时触发,changedKeys 为变化的 keys
|
|
1375
|
+
*/
|
|
1376
|
+
abstract onCreateWorkItemFormValueChanged(watchKeys: Array<string | AttributeType>, callback: (changedKeys: Array<string | AttributeType>) => void): Off;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* @public
|
|
1381
|
+
* 按钮
|
|
1382
|
+
*/
|
|
1383
|
+
declare abstract class Button extends BaseModel {
|
|
1384
|
+
/**
|
|
1385
|
+
* @internal
|
|
1386
|
+
*/
|
|
1387
|
+
protected static [IMPL_KEY]: string;
|
|
1388
|
+
/**
|
|
1389
|
+
* 加载数据
|
|
1390
|
+
*/
|
|
1391
|
+
static load(): Promise<Button>;
|
|
1392
|
+
/**
|
|
1393
|
+
* 获取当前按钮的上下文
|
|
1394
|
+
*/
|
|
1395
|
+
abstract getContext(): Promise<ButtonFeatureContext>;
|
|
1201
1396
|
}
|
|
1202
1397
|
|
|
1203
1398
|
/**
|
|
@@ -1227,6 +1422,16 @@ declare class SDKClient {
|
|
|
1227
1422
|
* only 2.0
|
|
1228
1423
|
*/
|
|
1229
1424
|
get intercept(): Intercept;
|
|
1425
|
+
/**
|
|
1426
|
+
* 控件点位容器特有能力
|
|
1427
|
+
* only 2.0
|
|
1428
|
+
*/
|
|
1429
|
+
get control(): Control;
|
|
1430
|
+
/**
|
|
1431
|
+
* 按钮点位容器特有能力
|
|
1432
|
+
* only 2.0
|
|
1433
|
+
*/
|
|
1434
|
+
get button(): Button;
|
|
1230
1435
|
/**
|
|
1231
1436
|
* 应用导航
|
|
1232
1437
|
*/
|
|
@@ -1248,6 +1453,11 @@ declare class SDKClient {
|
|
|
1248
1453
|
* only 2.0
|
|
1249
1454
|
*/
|
|
1250
1455
|
get richTextEditor(): RichTextEditor;
|
|
1456
|
+
/**
|
|
1457
|
+
* 工作项实例筛选器
|
|
1458
|
+
* only web 2.0
|
|
1459
|
+
*/
|
|
1460
|
+
get workItemFinder(): WorkItemFinder;
|
|
1251
1461
|
/**
|
|
1252
1462
|
* 模态框
|
|
1253
1463
|
*/
|
|
@@ -1354,6 +1564,16 @@ declare class InvalidParamsError extends CustomError {
|
|
|
1354
1564
|
});
|
|
1355
1565
|
}
|
|
1356
1566
|
|
|
1567
|
+
/**
|
|
1568
|
+
* @public
|
|
1569
|
+
* API 在当前环境不支持
|
|
1570
|
+
*/
|
|
1571
|
+
declare class NotSupportedError extends CustomError {
|
|
1572
|
+
constructor(options: {
|
|
1573
|
+
originMessage: string;
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1357
1577
|
/**
|
|
1358
1578
|
* 用于飞书项目插件读取系统数据的 JSSDK
|
|
1359
1579
|
*
|
|
@@ -1363,4 +1583,4 @@ declare class InvalidParamsError extends CustomError {
|
|
|
1363
1583
|
* @packageDocumentation
|
|
1364
1584
|
*/
|
|
1365
1585
|
|
|
1366
|
-
export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ContainerModal, Context, Control, ControlFeatureContext, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal,
|
|
1586
|
+
export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Broadcast, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, Field, FieldType, FlowMode, IBroadcastDetailPageWorkItemValueChangedEvent, IMPL_KEY, IPluginCustomBuildConfig, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, Space, Storage, TabFeatureContext, Toast, ToastOptions, User, Utils, ViewFeatureContext, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
|