@lark-project/js-sdk 2.0.4-dev.1 → 2.0.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.
package/dist/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  * MIT License
4
- * Copyright (c) 2024 Lark Technologies Pte. Ltd.
4
+ * Copyright (c) 2025 Lark Technologies Pte. Ltd.
5
5
  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
  * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
7
7
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -430,16 +430,6 @@ _a23 = IMPL_KEY;
430
430
  */
431
431
  View[_a23] = "view";
432
432
 
433
- // src/features/CustomComponent.ts
434
- var _a24;
435
- var CustomComponent = class extends BaseModel {
436
- };
437
- _a24 = IMPL_KEY;
438
- /**
439
- * @internal
440
- */
441
- CustomComponent[_a24] = "customComponent";
442
-
443
433
  // src/client.ts
444
434
  function getImplClass(decl, impls) {
445
435
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -624,7 +614,7 @@ var SDKClient = _SDKClient;
624
614
  /**
625
615
  * SDK 版本号
626
616
  */
627
- SDKClient.version = "2.0.4-dev.1";
617
+ SDKClient.version = "2.0.5";
628
618
 
629
619
  // src/types/biz.ts
630
620
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -695,16 +685,6 @@ var InterceptEvent = /* @__PURE__ */ ((InterceptEvent2) => {
695
685
  InterceptEvent2[InterceptEvent2["UpdateState"] = 3001] = "UpdateState";
696
686
  return InterceptEvent2;
697
687
  })(InterceptEvent || {});
698
- var CustomComponentType = /* @__PURE__ */ ((CustomComponentType2) => {
699
- CustomComponentType2["Schedule"] = "schedule";
700
- return CustomComponentType2;
701
- })(CustomComponentType || {});
702
- var CustomComponentScene = /* @__PURE__ */ ((CustomComponentScene2) => {
703
- CustomComponentScene2[CustomComponentScene2["ALL"] = 0] = "ALL";
704
- CustomComponentScene2[CustomComponentScene2["workItemNode"] = 1] = "workItemNode";
705
- CustomComponentScene2[CustomComponentScene2["scheduleTable"] = 2] = "scheduleTable";
706
- return CustomComponentScene2;
707
- })(CustomComponentScene || {});
708
688
 
709
689
  // src/errors/CustomError.ts
710
690
  var CustomError = class extends Error {
@@ -792,9 +772,6 @@ export {
792
772
  ContainerModal,
793
773
  Context,
794
774
  Control,
795
- CustomComponent,
796
- CustomComponentScene,
797
- CustomComponentType,
798
775
  Field,
799
776
  FieldType,
800
777
  FlowMode,
package/dist/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  * MIT License
4
- * Copyright (c) 2024 Lark Technologies Pte. Ltd.
4
+ * Copyright (c) 2025 Lark Technologies Pte. Ltd.
5
5
  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
  * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
7
7
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -57,9 +57,6 @@ __export(src_exports, {
57
57
  ContainerModal: () => ContainerModal,
58
58
  Context: () => Context,
59
59
  Control: () => Control,
60
- CustomComponent: () => CustomComponent,
61
- CustomComponentScene: () => CustomComponentScene,
62
- CustomComponentType: () => CustomComponentType,
63
60
  Field: () => Field,
64
61
  FieldType: () => FieldType,
65
62
  FlowMode: () => FlowMode,
@@ -495,16 +492,6 @@ _a23 = IMPL_KEY;
495
492
  */
496
493
  View[_a23] = "view";
497
494
 
498
- // src/features/CustomComponent.ts
499
- var _a24;
500
- var CustomComponent = class extends BaseModel {
501
- };
502
- _a24 = IMPL_KEY;
503
- /**
504
- * @internal
505
- */
506
- CustomComponent[_a24] = "customComponent";
507
-
508
495
  // src/client.ts
509
496
  function getImplClass(decl, impls) {
510
497
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -689,7 +676,7 @@ var SDKClient = _SDKClient;
689
676
  /**
690
677
  * SDK 版本号
691
678
  */
692
- SDKClient.version = "2.0.4-dev.1";
679
+ SDKClient.version = "2.0.5";
693
680
 
694
681
  // src/types/biz.ts
695
682
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -760,16 +747,6 @@ var InterceptEvent = /* @__PURE__ */ ((InterceptEvent2) => {
760
747
  InterceptEvent2[InterceptEvent2["UpdateState"] = 3001] = "UpdateState";
761
748
  return InterceptEvent2;
762
749
  })(InterceptEvent || {});
763
- var CustomComponentType = /* @__PURE__ */ ((CustomComponentType2) => {
764
- CustomComponentType2["Schedule"] = "schedule";
765
- return CustomComponentType2;
766
- })(CustomComponentType || {});
767
- var CustomComponentScene = /* @__PURE__ */ ((CustomComponentScene2) => {
768
- CustomComponentScene2[CustomComponentScene2["ALL"] = 0] = "ALL";
769
- CustomComponentScene2[CustomComponentScene2["workItemNode"] = 1] = "workItemNode";
770
- CustomComponentScene2[CustomComponentScene2["scheduleTable"] = 2] = "scheduleTable";
771
- return CustomComponentScene2;
772
- })(CustomComponentScene || {});
773
750
 
774
751
  // src/errors/CustomError.ts
775
752
  var CustomError = class extends Error {
@@ -858,9 +835,6 @@ var src_default = SDKClient;
858
835
  ContainerModal,
859
836
  Context,
860
837
  Control,
861
- CustomComponent,
862
- CustomComponentScene,
863
- CustomComponentType,
864
838
  Field,
865
839
  FieldType,
866
840
  FlowMode,
@@ -522,85 +522,6 @@ interface InterceptFeatureContext<T> {
522
522
  }>;
523
523
  customData: T;
524
524
  }
525
- /**
526
- * 自定义组件构成
527
- * 支持的定义组件类型
528
- */
529
- declare enum CustomComponentType {
530
- Schedule = "schedule"
531
- }
532
- /**
533
- * 自定义组件构成
534
- * 允许用户定制指定业务组件类型的UI
535
- */
536
- interface CustomComponentFeatureContext {
537
- /**
538
- * 组件当前所属空间标识
539
- */
540
- spaceId: string;
541
- /**
542
- * 组件当前所属工作项类型标识
543
- */
544
- workObjectId: string;
545
- /**
546
- * 组件当前所属工作项实例标识
547
- * 新建页表单内该值为空
548
- */
549
- workItemId?: number;
550
- /**
551
- * 组件唯一标识
552
- * 新建场景结合 webhook 用于关联自有数据
553
- * 详情页可能为空,不推荐强依赖 UUID 读取自有数据
554
- */
555
- UUID?: string;
556
- /**
557
- * 组件节点标识
558
- * 适用场景:详情页为节点流时,且当前控件位于节点表单内,该字段才有数据
559
- */
560
- nodeId?: string;
561
- /**
562
- * 组件子任务标识
563
- * 适用场景:详情页为节点流时,且当前控件位于节点表单内,该字段才有数据
564
- */
565
- taskId?: string;
566
- }
567
- /**
568
- * 排期组件位置
569
- */
570
- declare enum CustomComponentScene {
571
- /**
572
- * 全部
573
- */
574
- ALL = 0,
575
- /**
576
- * 工作项节点/子任务
577
- */
578
- workItemNode = 1,
579
- /**
580
- * 计划表
581
- */
582
- scheduleTable = 2
583
- }
584
- /**
585
- * schedule 组件类型校验返回值
586
- */
587
- type ScheduleCompValueType = string[];
588
- interface ScheduleCompValidateMsg {
589
- code: 200 | 403;
590
- msg: string;
591
- }
592
- /**
593
- * 自定义组件构成
594
- * 各业务组件类型拥有的 props
595
- */
596
- interface CustomComponentProps {
597
- [CustomComponentType.Schedule]: {
598
- value: ScheduleCompValueType;
599
- disabled?: boolean;
600
- getContext: () => Promise<CustomComponentFeatureContext>;
601
- handleSubmit: (value: ScheduleCompValueType) => ScheduleCompValidateMsg;
602
- };
603
- }
604
525
 
605
526
  /**
606
527
  * @internal
@@ -661,10 +582,6 @@ declare abstract class Context extends BaseModel {
661
582
  * 当前登录用户信息
662
583
  */
663
584
  abstract loginUser: User;
664
- /**
665
- * 主空间信息(左侧导航栏选中的空间)
666
- */
667
- abstract mainSpace?: BriefSpace;
668
585
  /**
669
586
  * 当前打开的工作项(仅工作项详情页可用)
670
587
  */
@@ -1185,7 +1102,11 @@ interface ModalConfirmOptions {
1185
1102
  /**
1186
1103
  * Modal 展示配置
1187
1104
  */
1188
- interface ModalOptions<Context> {
1105
+ interface ModalOpenOptions<Context> {
1106
+ /**
1107
+ * 指定 modal 内容的代码入口,即在入口文件中导出的模块名
1108
+ */
1109
+ entry: string;
1189
1110
  /**
1190
1111
  * 宽度
1191
1112
  * 默认: 448
@@ -1245,7 +1166,7 @@ declare abstract class Modal extends BaseModel {
1245
1166
  * @param options
1246
1167
  * @returns 当前打开 Modal 的关闭方法
1247
1168
  */
1248
- abstract open<Context>(options: ModalOptions<Context>): Promise<{
1169
+ abstract open<Context>(options: ModalOpenOptions<Context>): Promise<{
1249
1170
  close: () => void;
1250
1171
  }>;
1251
1172
  }
@@ -1618,29 +1539,6 @@ declare abstract class View extends BaseModel {
1618
1539
  abstract getContext(): Promise<ViewFeatureContext>;
1619
1540
  }
1620
1541
 
1621
- /**
1622
- * @public
1623
- * 自定义组件构成
1624
- */
1625
- declare abstract class CustomComponent extends BaseModel {
1626
- /**
1627
- * @internal
1628
- */
1629
- protected static [IMPL_KEY]: string;
1630
- abstract [CustomComponentType.Schedule]: {
1631
- load: () => Promise<CustomComponentProps[CustomComponentType.Schedule]>;
1632
- /**
1633
- * 用于监听 props 变更
1634
- * @param callback 返回 schedule 组件新的 props
1635
- * @param watchKeys 监听的 key,只能监听属性的 key(不能监听 api key),不传默认监听所有 key。监听的 key 对应的值变更会触发回调
1636
- * @returns
1637
- */
1638
- watch: (callback: (next: CustomComponentProps[CustomComponentType.Schedule]) => void, watchKeys?: keyof Omit<CustomComponentProps[CustomComponentType.Schedule], 'getContext' | 'handleSubmit'>[]) => Off;
1639
- getContext: () => Promise<CustomComponentFeatureContext>;
1640
- handleSubmit: (value: ScheduleCompValueType) => Promise<ScheduleCompValidateMsg>;
1641
- };
1642
- }
1643
-
1644
1542
  /**
1645
1543
  * @public
1646
1544
  * SDKClient 的配置项
@@ -1854,4 +1752,4 @@ declare class NotSupportedError extends CustomError {
1854
1752
  * @packageDocumentation
1855
1753
  */
1856
1754
 
1857
- export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, Configuration, ConfigurationFeatureContext, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, CustomComponent, CustomComponentFeatureContext, CustomComponentProps, CustomComponentScene, CustomComponentType, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, Page, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, ScheduleCompValidateMsg, ScheduleCompValueType, Shared, Space, Storage, Tab, TabFeatureContext, Toast, ToastOptions, User, Utils, View, ViewFeatureContext, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
1755
+ export { ActionSheet, ActionSheetOptions, AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, Configuration, ConfigurationFeatureContext, ContainerModal, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, ModalOpenOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, Page, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, Shared, Space, Storage, Tab, TabFeatureContext, Toast, ToastOptions, User, Utils, View, ViewFeatureContext, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-project/js-sdk",
3
- "version": "2.0.4-dev.1",
3
+ "version": "2.0.5",
4
4
  "runtimeMinVersions": {
5
5
  "web": "2.1.0",
6
6
  "mobile": "1.1.0"