@lark-project/js-sdk 2.1.5 → 2.1.7

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 CHANGED
@@ -1,4 +1,7 @@
1
1
  # Change Log
2
+ ## 2.1.7(2026/5/28)
3
+ - 「Add」新增 AI 节点相关类型与客户端入口
4
+
2
5
  # 2.1.5(2026/3/6)
3
6
  - 「Add」新增 LiteAppSubscribedPropertyValueType 类型相关定义
4
7
 
package/dist/es/index.js CHANGED
@@ -496,6 +496,16 @@ _a29 = IMPL_KEY;
496
496
  */
497
497
  BuilderComponent[_a29] = "liteAppComponent";
498
498
 
499
+ // src/features/AINode.ts
500
+ var _a30;
501
+ var AINode = class extends BaseModel {
502
+ };
503
+ _a30 = IMPL_KEY;
504
+ /**
505
+ * @internal
506
+ */
507
+ AINode[_a30] = "aiNode";
508
+
499
509
  // src/client.ts
500
510
  function getImplClass(decl, impls) {
501
511
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -589,6 +599,13 @@ var _SDKClient = class {
589
599
  get liteAppComponent() {
590
600
  return getImplValue(BuilderComponent, this._meegoBizHub);
591
601
  }
602
+ /**
603
+ * AI 节点点位容器特有能力
604
+ * only 2.0
605
+ */
606
+ get aiNode() {
607
+ return getImplValue(AINode, this._meegoBizHub);
608
+ }
592
609
  /**
593
610
  * 应用导航
594
611
  */
@@ -722,7 +739,7 @@ var SDKClient = _SDKClient;
722
739
  /**
723
740
  * SDK 版本号
724
741
  */
725
- SDKClient.version = "2.1.5";
742
+ SDKClient.version = "2.1.7";
726
743
 
727
744
  // src/types/biz.ts
728
745
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -833,6 +850,14 @@ var LiteAppSubscribedPropertyTemplate = /* @__PURE__ */ ((LiteAppSubscribedPrope
833
850
  LiteAppSubscribedPropertyTemplate2["DataSource"] = "dataSource";
834
851
  return LiteAppSubscribedPropertyTemplate2;
835
852
  })(LiteAppSubscribedPropertyTemplate || {});
853
+ var AINodeRuningState = /* @__PURE__ */ ((AINodeRuningState2) => {
854
+ AINodeRuningState2["Idle"] = "idle";
855
+ AINodeRuningState2["Running"] = "running";
856
+ AINodeRuningState2["Done"] = "done";
857
+ AINodeRuningState2["Stopped"] = "stopped";
858
+ AINodeRuningState2["Error"] = "error";
859
+ return AINodeRuningState2;
860
+ })(AINodeRuningState || {});
836
861
 
837
862
  // src/errors/CustomError.ts
838
863
  var CustomError = class extends Error {
@@ -934,6 +959,8 @@ var SystemPermissionDeniedError = class extends CustomError {
934
959
  // src/index.ts
935
960
  var src_default = SDKClient;
936
961
  export {
962
+ AINode,
963
+ AINodeRuningState,
937
964
  ActionSheet,
938
965
  AttributeType,
939
966
  BuilderComponent,
package/dist/lib/index.js CHANGED
@@ -48,6 +48,8 @@ var __async = (__this, __arguments, generator) => {
48
48
  // src/index.ts
49
49
  var src_exports = {};
50
50
  __export(src_exports, {
51
+ AINode: () => AINode,
52
+ AINodeRuningState: () => AINodeRuningState,
51
53
  ActionSheet: () => ActionSheet,
52
54
  AttributeType: () => AttributeType,
53
55
  BuilderComponent: () => BuilderComponent,
@@ -570,6 +572,16 @@ _a29 = IMPL_KEY;
570
572
  */
571
573
  BuilderComponent[_a29] = "liteAppComponent";
572
574
 
575
+ // src/features/AINode.ts
576
+ var _a30;
577
+ var AINode = class extends BaseModel {
578
+ };
579
+ _a30 = IMPL_KEY;
580
+ /**
581
+ * @internal
582
+ */
583
+ AINode[_a30] = "aiNode";
584
+
573
585
  // src/client.ts
574
586
  function getImplClass(decl, impls) {
575
587
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -663,6 +675,13 @@ var _SDKClient = class {
663
675
  get liteAppComponent() {
664
676
  return getImplValue(BuilderComponent, this._meegoBizHub);
665
677
  }
678
+ /**
679
+ * AI 节点点位容器特有能力
680
+ * only 2.0
681
+ */
682
+ get aiNode() {
683
+ return getImplValue(AINode, this._meegoBizHub);
684
+ }
666
685
  /**
667
686
  * 应用导航
668
687
  */
@@ -796,7 +815,7 @@ var SDKClient = _SDKClient;
796
815
  /**
797
816
  * SDK 版本号
798
817
  */
799
- SDKClient.version = "2.1.5";
818
+ SDKClient.version = "2.1.7";
800
819
 
801
820
  // src/types/biz.ts
802
821
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -907,6 +926,14 @@ var LiteAppSubscribedPropertyTemplate = /* @__PURE__ */ ((LiteAppSubscribedPrope
907
926
  LiteAppSubscribedPropertyTemplate2["DataSource"] = "dataSource";
908
927
  return LiteAppSubscribedPropertyTemplate2;
909
928
  })(LiteAppSubscribedPropertyTemplate || {});
929
+ var AINodeRuningState = /* @__PURE__ */ ((AINodeRuningState2) => {
930
+ AINodeRuningState2["Idle"] = "idle";
931
+ AINodeRuningState2["Running"] = "running";
932
+ AINodeRuningState2["Done"] = "done";
933
+ AINodeRuningState2["Stopped"] = "stopped";
934
+ AINodeRuningState2["Error"] = "error";
935
+ return AINodeRuningState2;
936
+ })(AINodeRuningState || {});
910
937
 
911
938
  // src/errors/CustomError.ts
912
939
  var CustomError = class extends Error {
@@ -1009,6 +1036,8 @@ var SystemPermissionDeniedError = class extends CustomError {
1009
1036
  var src_default = SDKClient;
1010
1037
  // Annotate the CommonJS export names for ESM import in node:
1011
1038
  0 && (module.exports = {
1039
+ AINode,
1040
+ AINodeRuningState,
1012
1041
  ActionSheet,
1013
1042
  AttributeType,
1014
1043
  BuilderComponent,
@@ -149,6 +149,11 @@ declare enum FieldType {
149
149
  */
150
150
  workItemRelatedMultiSelect = "work_item_related_multi_select"
151
151
  }
152
+ /**
153
+ * @public
154
+ * 工作项字段值类型
155
+ */
156
+ type WorkItemFieldValue = string | string[] | number | number[] | boolean | unknown;
152
157
  /**
153
158
  * @public
154
159
  * 空间(仅含关键属性)
@@ -435,6 +440,10 @@ interface ScheduleUnitButtonFeatureContext {
435
440
  * 计划表单元值
436
441
  */
437
442
  value: Record<string, any>;
443
+ /**
444
+ * 当前计划表唯一标识
445
+ */
446
+ scheduleTableUUID: string;
438
447
  };
439
448
  }
440
449
  /**
@@ -1027,6 +1036,44 @@ interface LiteAppComponentPreset {
1027
1036
  height: number;
1028
1037
  };
1029
1038
  }
1039
+ /** ----------------------- AI 节点构成类型 ----------------------- */
1040
+ interface AINodeFeatureContext {
1041
+ /**
1042
+ * AI 节点当前所属空间标识
1043
+ */
1044
+ spaceId: string;
1045
+ /**
1046
+ * AI 节点当前所属工作项类型标识
1047
+ */
1048
+ workObjectId: string;
1049
+ /**
1050
+ * AI 节点当前所属工作项实例标识
1051
+ */
1052
+ workItemId: number;
1053
+ /**
1054
+ * 当前节点标识
1055
+ */
1056
+ nodeId: string;
1057
+ }
1058
+ /**
1059
+ * AI 节点运行状态
1060
+ */
1061
+ declare enum AINodeRuningState {
1062
+ Idle = "idle",
1063
+ Running = "running",
1064
+ Done = "done",
1065
+ Stopped = "stopped",
1066
+ Error = "error"
1067
+ }
1068
+ /**
1069
+ * AI 节点 props
1070
+ */
1071
+ interface AINodeProps {
1072
+ /**
1073
+ * AI 节点运行状态字段
1074
+ */
1075
+ ai_node_running: AINodeRuningState;
1076
+ }
1030
1077
  /**
1031
1078
  * liteapp 工作项实例定义
1032
1079
  */
@@ -1064,9 +1111,9 @@ type LiteAppWorkItemInstance = {
1064
1111
  */
1065
1112
  isDeleted: boolean;
1066
1113
  /**
1067
- * 其他字段
1114
+ * 配置字段
1068
1115
  */
1069
- fields?: Record<string, unknown>;
1116
+ fields?: Record<string, WorkItemFieldValue>;
1070
1117
  };
1071
1118
  type LiteAppComponentDataSourceResult = {
1072
1119
  /**
@@ -1324,9 +1371,8 @@ declare abstract class WorkItem extends BaseModel {
1324
1371
  abstract isDeleted: boolean;
1325
1372
  /**
1326
1373
  * 获取工作项实例自定义字段相关数据
1327
- * TODO: 类型暂未定义
1328
1374
  */
1329
- abstract getFieldValue(fieldId: string): any;
1375
+ abstract getFieldValue(fieldId: string): FieldValue;
1330
1376
  }
1331
1377
 
1332
1378
  /**
@@ -2465,6 +2511,42 @@ declare abstract class BuilderComponent extends BaseModel {
2465
2511
  abstract notify: (key: string, value: LiteAppSubscribedPropertyValueType) => Promise<void>;
2466
2512
  }
2467
2513
 
2514
+ /**
2515
+ * @public
2516
+ * AI 节点
2517
+ */
2518
+ declare abstract class AINode extends BaseModel {
2519
+ /**
2520
+ * @internal
2521
+ */
2522
+ protected static [IMPL_KEY]: string;
2523
+ /**
2524
+ * 获取当前 AI 节点所在的上下文
2525
+ */
2526
+ abstract getContext(): Promise<AINodeFeatureContext>;
2527
+ /**
2528
+ * 获取 AI 节点运行态 props
2529
+ */
2530
+ abstract getProps(): Promise<AINodeProps>;
2531
+ /**
2532
+ * 监听 AI 节点 props 变更
2533
+ * @param callback 返回最新的 props
2534
+ * @param watchKeys 需要监听的 key,默认监听所有 key
2535
+ */
2536
+ abstract watch(callback: (next: AINodeProps | Record<string, never>) => void, watchKeys?: (keyof AINodeProps)[]): Promise<Off>;
2537
+ /**
2538
+ * 监听工作项表单项值变化
2539
+ * @param options.watchKeys 需要监听的工作项字段 ID 列表
2540
+ * @param callback 当监听值发生变化时触发,changedValue 为变化的 kv
2541
+ */
2542
+ abstract onWorkItemFormValueChanged(options: {
2543
+ watchKeys: Array<{
2544
+ key: string | AttributeType;
2545
+ type: Exclude<FieldType, FieldType.richText | FieldType.singleSignal | FieldType.multiSignal | FieldType.singleVoting | FieldType.multiVoting | FieldType.simpleVoting>;
2546
+ }>;
2547
+ }, callback: (changedValue: Record<string, unknown>) => void): Promise<Off>;
2548
+ }
2549
+
2468
2550
  /**
2469
2551
  * @public
2470
2552
  * SDKClient 的配置项
@@ -2543,6 +2625,11 @@ declare class SDKClient {
2543
2625
  * only web 2.0
2544
2626
  */
2545
2627
  get liteAppComponent(): BuilderComponent;
2628
+ /**
2629
+ * AI 节点点位容器特有能力
2630
+ * only 2.0
2631
+ */
2632
+ get aiNode(): AINode;
2546
2633
  /**
2547
2634
  * 应用导航
2548
2635
  */
@@ -2700,4 +2787,4 @@ declare class NotSupportedError extends CustomError {
2700
2787
  * @packageDocumentation
2701
2788
  */
2702
2789
 
2703
- export { ActionSheet, ActionSheetOptions, AttributeType, BatchButtonFeatureContext, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, BuilderComponent, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ComponentScheduleIdentity, ComponentScheduleScene, Configuration, ConfigurationFeatureContext, ContainerModal, ContainerModalConfigureOptions, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, CustomComponent, CustomComponentFeatureContext, CustomComponentProps, CustomComponentType, CustomField, CustomFieldConfig, CustomFieldFeatureContext, CustomFieldProps, CustomFieldValidateMsg, CustomFieldValueType, Event, EventPayloadMap, EventType, ExCompoundFieldValueType, Field, FieldType, FieldValue, FlowMode, Geolocation, GeolocationCoordinates, GeolocationPosition, I18nTitleConfig, IMPL_KEY, IPluginCustomBuildConfig, IRichTextEditorImageUploadComplete, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, LiteAppCompLayoutConfig, LiteAppCompPropBriefConfig, LiteAppCompPropFullConfig, LiteAppCompPropSelectConfig, LiteAppCompPropValueType, LiteAppComponentConfig, LiteAppComponentDataSourceResult, LiteAppComponentFeatureContext, LiteAppComponentPreset, LiteAppComponentProps, LiteAppPropBoolean, LiteAppPropDataSource, LiteAppPropDateRange, LiteAppPropDateWithTime, LiteAppPropField, LiteAppPropLayout, LiteAppPropMultiSelect, LiteAppPropNumber, LiteAppPropSelect, LiteAppPropTemplateType, LiteAppPropText, LiteAppPropView, LiteAppPropWorkItemInstance, LiteAppPropWorkItemListAfterFilter, LiteAppPropWorkItemListAfterSort, LiteAppPropWorkItemType, LiteAppSubscribedPropertyTemplate, LiteAppSubscribedPropertyValueType, LiteAppWorkItemInstance, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, ModalOpenOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, Page, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, ScheduleCompValidateMsg, ScheduleCompValueType, ScheduleUnitButtonFeatureContext, Script, ScriptFeatureContext, Shared, Space, Storage, SubFieldType, SystemPermissionDeniedError, Tab, TabFeatureContext, Toast, ToastOptions, User, UserInfo, Utils, View, ViewFeatureContext, WbsStatus, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
2790
+ export { AINode, AINodeFeatureContext, AINodeProps, AINodeRuningState, ActionSheet, ActionSheetOptions, AttributeType, BatchButtonFeatureContext, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, BuilderComponent, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ComponentScheduleIdentity, ComponentScheduleScene, Configuration, ConfigurationFeatureContext, ContainerModal, ContainerModalConfigureOptions, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, CustomComponent, CustomComponentFeatureContext, CustomComponentProps, CustomComponentType, CustomField, CustomFieldConfig, CustomFieldFeatureContext, CustomFieldProps, CustomFieldValidateMsg, CustomFieldValueType, Event, EventPayloadMap, EventType, ExCompoundFieldValueType, Field, FieldType, FieldValue, FlowMode, Geolocation, GeolocationCoordinates, GeolocationPosition, I18nTitleConfig, IMPL_KEY, IPluginCustomBuildConfig, IRichTextEditorImageUploadComplete, IntegrationFeatureContext, Intercept, InterceptEvent, InterceptFeatureContext, InternalError, InvalidParamsError, Language, LiteAppCompLayoutConfig, LiteAppCompPropBriefConfig, LiteAppCompPropFullConfig, LiteAppCompPropSelectConfig, LiteAppCompPropValueType, LiteAppComponentConfig, LiteAppComponentDataSourceResult, LiteAppComponentFeatureContext, LiteAppComponentPreset, LiteAppComponentProps, LiteAppPropBoolean, LiteAppPropDataSource, LiteAppPropDateRange, LiteAppPropDateWithTime, LiteAppPropField, LiteAppPropLayout, LiteAppPropMultiSelect, LiteAppPropNumber, LiteAppPropSelect, LiteAppPropTemplateType, LiteAppPropText, LiteAppPropView, LiteAppPropWorkItemInstance, LiteAppPropWorkItemListAfterFilter, LiteAppPropWorkItemListAfterSort, LiteAppPropWorkItemType, LiteAppSubscribedPropertyTemplate, LiteAppSubscribedPropertyValueType, LiteAppWorkItemInstance, MEEGO_BIZ_HUB, Modal, ModalConfirmOptions, ModalOpenOptions, Navigation, NoAuthError, NodeStatus, NotFoundError, NotSupportedError, Off, OutOfLimitError, Page, PageFeatureContext, RichTextEditor, RichTextEditorContent, RichTextEditorOptions, Role, RoleOwners, SDKClient, SDKClientOptions, ScheduleCompValidateMsg, ScheduleCompValueType, ScheduleUnitButtonFeatureContext, Script, ScriptFeatureContext, Shared, Space, Storage, SubFieldType, SystemPermissionDeniedError, Tab, TabFeatureContext, Toast, ToastOptions, User, UserInfo, Utils, View, ViewFeatureContext, WbsStatus, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFieldValue, 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.1.5",
3
+ "version": "2.1.7",
4
4
  "runtimeMinVersions": {
5
5
  "web": "2.1.0",
6
6
  "mobile": "1.1.0"