@lark-project/js-sdk 2.1.4-dev.ainode.2 → 2.1.5-alpha.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 CHANGED
@@ -1,4 +1,6 @@
1
1
  # Change Log
2
+ # 2.1.4(2025/1/14)
3
+ - 「Add」新增 LiteAppPropDataSource 类型相关定义
2
4
 
3
5
  ## 2.1.3(2025/12/19)
4
6
  - 「Add」新增 geolocation.getCurrentPosition
package/dist/es/index.js CHANGED
@@ -496,16 +496,6 @@ _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
-
509
499
  // src/client.ts
510
500
  function getImplClass(decl, impls) {
511
501
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -599,13 +589,6 @@ var _SDKClient = class {
599
589
  get liteAppComponent() {
600
590
  return getImplValue(BuilderComponent, this._meegoBizHub);
601
591
  }
602
- /**
603
- * AI 节点点位容器特有能力
604
- * only 2.0
605
- */
606
- get aiNode() {
607
- return getImplValue(AINode, this._meegoBizHub);
608
- }
609
592
  /**
610
593
  * 应用导航
611
594
  */
@@ -739,7 +722,7 @@ var SDKClient = _SDKClient;
739
722
  /**
740
723
  * SDK 版本号
741
724
  */
742
- SDKClient.version = "2.1.4-dev.ainode.2";
725
+ SDKClient.version = "2.1.5-alpha.0";
743
726
 
744
727
  // src/types/biz.ts
745
728
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -839,14 +822,6 @@ var LiteAppPropTemplateType = /* @__PURE__ */ ((LiteAppPropTemplateType2) => {
839
822
  LiteAppPropTemplateType2["workItemTypeWithField"] = "workItemTypeWithField";
840
823
  return LiteAppPropTemplateType2;
841
824
  })(LiteAppPropTemplateType || {});
842
- var AINodeRuningState = /* @__PURE__ */ ((AINodeRuningState2) => {
843
- AINodeRuningState2["Idle"] = "idle";
844
- AINodeRuningState2["Running"] = "running";
845
- AINodeRuningState2["Done"] = "done";
846
- AINodeRuningState2["Stopped"] = "stopped";
847
- AINodeRuningState2["Error"] = "error";
848
- return AINodeRuningState2;
849
- })(AINodeRuningState || {});
850
825
 
851
826
  // src/errors/CustomError.ts
852
827
  var CustomError = class extends Error {
@@ -948,8 +923,6 @@ var SystemPermissionDeniedError = class extends CustomError {
948
923
  // src/index.ts
949
924
  var src_default = SDKClient;
950
925
  export {
951
- AINode,
952
- AINodeRuningState,
953
926
  ActionSheet,
954
927
  AttributeType,
955
928
  BuilderComponent,
package/dist/lib/index.js CHANGED
@@ -48,8 +48,6 @@ 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,
53
51
  ActionSheet: () => ActionSheet,
54
52
  AttributeType: () => AttributeType,
55
53
  BuilderComponent: () => BuilderComponent,
@@ -571,16 +569,6 @@ _a29 = IMPL_KEY;
571
569
  */
572
570
  BuilderComponent[_a29] = "liteAppComponent";
573
571
 
574
- // src/features/AINode.ts
575
- var _a30;
576
- var AINode = class extends BaseModel {
577
- };
578
- _a30 = IMPL_KEY;
579
- /**
580
- * @internal
581
- */
582
- AINode[_a30] = "aiNode";
583
-
584
572
  // src/client.ts
585
573
  function getImplClass(decl, impls) {
586
574
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -674,13 +662,6 @@ var _SDKClient = class {
674
662
  get liteAppComponent() {
675
663
  return getImplValue(BuilderComponent, this._meegoBizHub);
676
664
  }
677
- /**
678
- * AI 节点点位容器特有能力
679
- * only 2.0
680
- */
681
- get aiNode() {
682
- return getImplValue(AINode, this._meegoBizHub);
683
- }
684
665
  /**
685
666
  * 应用导航
686
667
  */
@@ -814,7 +795,7 @@ var SDKClient = _SDKClient;
814
795
  /**
815
796
  * SDK 版本号
816
797
  */
817
- SDKClient.version = "2.1.4-dev.ainode.2";
798
+ SDKClient.version = "2.1.5-alpha.0";
818
799
 
819
800
  // src/types/biz.ts
820
801
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -914,14 +895,6 @@ var LiteAppPropTemplateType = /* @__PURE__ */ ((LiteAppPropTemplateType2) => {
914
895
  LiteAppPropTemplateType2["workItemTypeWithField"] = "workItemTypeWithField";
915
896
  return LiteAppPropTemplateType2;
916
897
  })(LiteAppPropTemplateType || {});
917
- var AINodeRuningState = /* @__PURE__ */ ((AINodeRuningState2) => {
918
- AINodeRuningState2["Idle"] = "idle";
919
- AINodeRuningState2["Running"] = "running";
920
- AINodeRuningState2["Done"] = "done";
921
- AINodeRuningState2["Stopped"] = "stopped";
922
- AINodeRuningState2["Error"] = "error";
923
- return AINodeRuningState2;
924
- })(AINodeRuningState || {});
925
898
 
926
899
  // src/errors/CustomError.ts
927
900
  var CustomError = class extends Error {
@@ -1024,8 +997,6 @@ var SystemPermissionDeniedError = class extends CustomError {
1024
997
  var src_default = SDKClient;
1025
998
  // Annotate the CommonJS export names for ESM import in node:
1026
999
  0 && (module.exports = {
1027
- AINode,
1028
- AINodeRuningState,
1029
1000
  ActionSheet,
1030
1001
  AttributeType,
1031
1002
  BuilderComponent,
@@ -844,12 +844,18 @@ interface LiteAppComponentFeatureContext {
844
844
  /**
845
845
  * liteapp 组件属性值类型
846
846
  */
847
+ /**
848
+ * 系统内置的通用值类型
849
+ */
847
850
  type LiteAppPropLayout = {
848
851
  width: number;
849
852
  height: number;
850
853
  positionX: number;
851
854
  positionY: number;
852
855
  };
856
+ /**
857
+ * 可配置的属性及值类型
858
+ */
853
859
  declare enum LiteAppPropTemplateType {
854
860
  Text = "text",
855
861
  Number = "number",
@@ -893,13 +899,45 @@ type LiteAppPropField = {
893
899
  roleId: string;
894
900
  display?: boolean;
895
901
  };
902
+ type LiteAppPropDataSource = {
903
+ spaceId: string;
904
+ workObjectId: string;
905
+ fieldList?: LiteAppPropField[];
906
+ };
896
907
  type LiteAppPropView = {
897
908
  viewId: string;
909
+ /**
910
+ * 是否是全景视图
911
+ */
898
912
  isMultiProject: boolean;
899
913
  };
900
914
  type LiteAppPropWorkItemListAfterFilter = LiteAppPropWorkItemInstance[];
901
915
  type LiteAppPropWorkItemListAfterSort = LiteAppPropWorkItemInstance[];
902
- type LiteAppCompPropValueType = LiteAppPropText | LiteAppPropNumber | LiteAppPropSelect | LiteAppPropBoolean | LiteAppPropMultiSelect | LiteAppPropDateWithTime | LiteAppPropDateRange | LiteAppPropWorkItemType | LiteAppPropWorkItemInstance | LiteAppPropView | LiteAppPropWorkItemListAfterFilter | LiteAppPropWorkItemListAfterSort;
916
+ type LiteAppCompPropValueType = LiteAppPropText | LiteAppPropNumber | LiteAppPropSelect | LiteAppPropBoolean | LiteAppPropMultiSelect | LiteAppPropDateWithTime | LiteAppPropDateRange | LiteAppPropWorkItemType | LiteAppPropWorkItemInstance | LiteAppPropView | LiteAppPropWorkItemListAfterFilter | LiteAppPropWorkItemListAfterSort | LiteAppPropDataSource;
917
+ type LiteAppSubscribedPropertyText = string;
918
+ type LiteAppSubscribedPropertyNumber = number;
919
+ type LiteAppSubscribedPropertyDatePrecise = number;
920
+ type LiteAppSubscribedPropertyDateRange = {
921
+ start: number;
922
+ end: number;
923
+ };
924
+ type LiteAppSubscribedPropertyView = {
925
+ viewId: string;
926
+ };
927
+ type LiteAppSubscribedPropertyWorkItemInstance = {
928
+ spaceId: string;
929
+ workObjectId: string;
930
+ workItemId: number;
931
+ };
932
+ type LiteAppSubscribedPropertyWorkItemType = {
933
+ spaceId: string;
934
+ workObjectId: string;
935
+ };
936
+ type LiteAppSubscribedPropertyDataSource = {
937
+ spaceId: string;
938
+ moql: string;
939
+ };
940
+ type LiteAppSubscribedPropertyValueType = LiteAppSubscribedPropertyText | LiteAppSubscribedPropertyNumber | LiteAppSubscribedPropertyDatePrecise | LiteAppSubscribedPropertyDateRange | LiteAppSubscribedPropertyView | LiteAppSubscribedPropertyWorkItemInstance | LiteAppSubscribedPropertyWorkItemType | LiteAppSubscribedPropertyDataSource;
903
941
  /**
904
942
  * liteapp 组件不同的属性类型对应的可读配置
905
943
  */
@@ -926,11 +964,17 @@ type LiteAppCompPropFullConfig = LiteAppCompPropBriefConfig | LiteAppCompPropSel
926
964
  * liteapp 组件入参定义
927
965
  */
928
966
  type LiteAppComponentProps = {
967
+ /**
968
+ * 实例 ID
969
+ */
929
970
  instanceId: string;
930
971
  layout?: LiteAppPropLayout;
931
972
  } & {
932
973
  [propName: string]: LiteAppCompPropValueType;
933
974
  };
975
+ /**
976
+ * liteapp 组件属性配置定义
977
+ */
934
978
  type LiteAppCompLayoutConfig =
935
979
  /** 定高模式 */
936
980
  {
@@ -947,55 +991,90 @@ type LiteAppCompLayoutConfig =
947
991
  maxHeight: number;
948
992
  };
949
993
  type LiteAppComponentConfig = {
994
+ /**
995
+ * 组件 id(与实例 id 区分)
996
+ */
950
997
  id: string;
998
+ /**
999
+ * 组件名称
1000
+ */
1001
+ /**
1002
+ * 组件 icon
1003
+ */
1004
+ /**
1005
+ * layout 配置
1006
+ */
951
1007
  layout: LiteAppCompLayoutConfig;
952
1008
  } & {
1009
+ /**
1010
+ * 属性配置
1011
+ */
953
1012
  [keyOfProp: string]: LiteAppCompPropBriefConfig;
954
1013
  };
1014
+ /**
1015
+ * liteapp 组件预设值(默认值)
1016
+ */
955
1017
  interface LiteAppComponentPreset {
956
1018
  layout?: {
957
1019
  width: number;
958
1020
  height: number;
959
1021
  };
960
1022
  }
961
- /** ----------------------- AI 节点构成类型 ----------------------- */
962
- interface AINodeFeatureContext {
1023
+ /**
1024
+ * liteapp 工作项实例定义
1025
+ */
1026
+ type LiteAppWorkItemInstance = {
963
1027
  /**
964
- * AI 节点当前所属空间标识
1028
+ * 唯一标识
1029
+ */
1030
+ id: number;
1031
+ /**
1032
+ * 空间标识
965
1033
  */
966
1034
  spaceId: string;
967
1035
  /**
968
- * AI 节点当前所属工作项类型标识
1036
+ * 所属工作项标识
969
1037
  */
970
1038
  workObjectId: string;
971
1039
  /**
972
- * AI 节点当前所属工作项实例标识
1040
+ * 使用的工作项模板标识
973
1041
  */
974
- workItemId: number;
1042
+ templateId: number;
975
1043
  /**
976
- * 当前节点标识
1044
+ * 工作项实例名称
977
1045
  */
978
- nodeId: string;
979
- }
980
- /**
981
- * AI 节点运行状态
982
- */
983
- declare enum AINodeRuningState {
984
- Idle = "idle",
985
- Running = "running",
986
- Done = "done",
987
- Stopped = "stopped",
988
- Error = "error"
989
- }
990
- /**
991
- * AI 节点 props
992
- */
993
- interface AINodeProps {
1046
+ name: string;
994
1047
  /**
995
- * AI 节点运行状态字段
1048
+ * 角色与人员列表
996
1049
  */
997
- ai_node_running: AINodeRuningState;
998
- }
1050
+ roleOwnersList: RoleOwners[];
1051
+ /**
1052
+ * 工作项实例已终止
1053
+ */
1054
+ isAborted: boolean;
1055
+ /**
1056
+ * 工作项实例已删除
1057
+ */
1058
+ isDeleted: boolean;
1059
+ /**
1060
+ * 其他字段
1061
+ */
1062
+ fields?: Record<string, unknown>;
1063
+ };
1064
+ type LiteAppComponentDataSourceResult = {
1065
+ /**
1066
+ * 工作项实例列表
1067
+ */
1068
+ data: LiteAppWorkItemInstance[];
1069
+ /**
1070
+ * 数据总数
1071
+ */
1072
+ total: number;
1073
+ /**
1074
+ * 是否有更多数据
1075
+ */
1076
+ hasMore: boolean;
1077
+ };
999
1078
 
1000
1079
  /**
1001
1080
  * @internal
@@ -2369,42 +2448,14 @@ declare abstract class BuilderComponent extends BaseModel {
2369
2448
  * 暂时不支持指定多组预设值/指定预设id(统一走 default),未来视诉求开放
2370
2449
  */
2371
2450
  abstract getPreset: (propKeys?: string | string[]) => Promise<LiteAppComponentPreset>;
2372
- }
2373
-
2374
- /**
2375
- * @public
2376
- * AI 节点
2377
- */
2378
- declare abstract class AINode extends BaseModel {
2379
- /**
2380
- * @internal
2381
- */
2382
- protected static [IMPL_KEY]: string;
2383
- /**
2384
- * 获取当前 AI 节点所在的上下文
2385
- */
2386
- abstract getContext(): Promise<AINodeFeatureContext>;
2387
- /**
2388
- * 获取 AI 节点运行态 props
2389
- */
2390
- abstract getProps(): Promise<AINodeProps>;
2391
2451
  /**
2392
- * 监听 AI 节点 props 变更
2393
- * @param callback 返回最新的 props
2394
- * @param watchKeys 需要监听的 key,默认监听所有 key
2452
+ * 获取 liteapp 组件数据源属性的数据结果
2395
2453
  */
2396
- abstract watch(callback: (next: AINodeProps | Record<string, never>) => void, watchKeys?: (keyof AINodeProps)[]): Promise<Off>;
2397
- /**
2398
- * 监听工作项表单项值变化
2399
- * @param options.watchKeys 需要监听的工作项字段 ID 列表
2400
- * @param callback 当监听值发生变化时触发,changedValue 为变化的 kv
2401
- */
2402
- abstract onWorkItemFormValueChanged(options: {
2403
- watchKeys: Array<{
2404
- key: string | AttributeType;
2405
- type: Exclude<FieldType, FieldType.richText | FieldType.singleSignal | FieldType.multiSignal | FieldType.singleVoting | FieldType.multiVoting | FieldType.simpleVoting>;
2406
- }>;
2407
- }, callback: (changedValue: Record<string, unknown>) => void): Promise<Off>;
2454
+ abstract getDataSourceResult: (propKey: string, pagination: {
2455
+ pageNum: number;
2456
+ pageSize: number;
2457
+ }) => Promise<LiteAppComponentDataSourceResult>;
2458
+ abstract notify: (key: string, value: LiteAppSubscribedPropertyValueType) => Promise<void>;
2408
2459
  }
2409
2460
 
2410
2461
  /**
@@ -2485,11 +2536,6 @@ declare class SDKClient {
2485
2536
  * only web 2.0
2486
2537
  */
2487
2538
  get liteAppComponent(): BuilderComponent;
2488
- /**
2489
- * AI 节点点位容器特有能力
2490
- * only 2.0
2491
- */
2492
- get aiNode(): AINode;
2493
2539
  /**
2494
2540
  * 应用导航
2495
2541
  */
@@ -2647,4 +2693,4 @@ declare class NotSupportedError extends CustomError {
2647
2693
  * @packageDocumentation
2648
2694
  */
2649
2695
 
2650
- 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, LiteAppComponentFeatureContext, LiteAppComponentPreset, LiteAppComponentProps, LiteAppPropBoolean, LiteAppPropDateRange, LiteAppPropDateWithTime, LiteAppPropField, LiteAppPropLayout, LiteAppPropMultiSelect, LiteAppPropNumber, LiteAppPropSelect, LiteAppPropTemplateType, LiteAppPropText, LiteAppPropView, LiteAppPropWorkItemInstance, LiteAppPropWorkItemListAfterFilter, LiteAppPropWorkItemListAfterSort, LiteAppPropWorkItemType, 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 };
2696
+ 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, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-project/js-sdk",
3
- "version": "2.1.4-dev.ainode.2",
3
+ "version": "2.1.5-alpha.0",
4
4
  "runtimeMinVersions": {
5
5
  "web": "2.1.0",
6
6
  "mobile": "1.1.0"