@lark-project/js-sdk 2.0.8-dev.4 → 2.0.8-dev.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
@@ -440,16 +440,6 @@ _a24 = IMPL_KEY;
440
440
  */
441
441
  CustomComponent[_a24] = "customComponent";
442
442
 
443
- // src/features/ExField.ts
444
- var _a25;
445
- var ExField = class extends BaseModel {
446
- };
447
- _a25 = IMPL_KEY;
448
- /**
449
- * @internal
450
- */
451
- ExField[_a25] = "exField";
452
-
453
443
  // src/client.ts
454
444
  function getImplClass(decl, impls) {
455
445
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -634,7 +624,7 @@ var SDKClient = _SDKClient;
634
624
  /**
635
625
  * SDK 版本号
636
626
  */
637
- SDKClient.version = "2.0.8-dev.4";
627
+ SDKClient.version = "2.0.8-dev.5";
638
628
 
639
629
  // src/types/biz.ts
640
630
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -715,14 +705,6 @@ var CustomComponentType = /* @__PURE__ */ ((CustomComponentType2) => {
715
705
  CustomComponentType2["Schedule"] = "schedule";
716
706
  return CustomComponentType2;
717
707
  })(CustomComponentType || {});
718
- var SubFieldType = /* @__PURE__ */ ((SubFieldType2) => {
719
- SubFieldType2["FieldNumber"] = "number";
720
- SubFieldType2["FieldMultiText"] = "text";
721
- SubFieldType2["FieldTreeSelect"] = "tree-multi-select";
722
- SubFieldType2["FieldDatePrecise"] = "date";
723
- SubFieldType2["FieldMultiUser"] = "multi-user";
724
- return SubFieldType2;
725
- })(SubFieldType || {});
726
708
 
727
709
  // src/errors/CustomError.ts
728
710
  var CustomError = class extends Error {
@@ -783,19 +765,7 @@ var InvalidParamsError = class extends CustomError {
783
765
  message: "invalid params error",
784
766
  originMessage: options.originMessage
785
767
  });
786
- this.errCode = -1;
787
- this.errMsg = "unkown error";
788
768
  this.name = "InvalidParamsError";
789
- this.errMsg = this.originMessage;
790
- this._parseErrorCode();
791
- }
792
- _parseErrorCode() {
793
- try {
794
- const { errCode, errMsg } = JSON.parse(this.originMessage);
795
- errCode !== void 0 && (this.errCode = errCode);
796
- errMsg !== void 0 && (this.errMsg = errMsg);
797
- } catch (e) {
798
- }
799
769
  }
800
770
  };
801
771
 
@@ -825,7 +795,6 @@ export {
825
795
  Control,
826
796
  CustomComponent,
827
797
  CustomComponentType,
828
- ExField,
829
798
  Field,
830
799
  FieldType,
831
800
  FlowMode,
@@ -848,7 +817,6 @@ export {
848
817
  Shared,
849
818
  Space,
850
819
  Storage,
851
- SubFieldType,
852
820
  Tab,
853
821
  Toast,
854
822
  Utils,
package/dist/lib/index.js CHANGED
@@ -60,7 +60,6 @@ __export(src_exports, {
60
60
  Control: () => Control,
61
61
  CustomComponent: () => CustomComponent,
62
62
  CustomComponentType: () => CustomComponentType,
63
- ExField: () => ExField,
64
63
  Field: () => Field,
65
64
  FieldType: () => FieldType,
66
65
  FlowMode: () => FlowMode,
@@ -83,7 +82,6 @@ __export(src_exports, {
83
82
  Shared: () => Shared,
84
83
  Space: () => Space,
85
84
  Storage: () => Storage,
86
- SubFieldType: () => SubFieldType,
87
85
  Tab: () => Tab,
88
86
  Toast: () => Toast,
89
87
  Utils: () => Utils,
@@ -507,16 +505,6 @@ _a24 = IMPL_KEY;
507
505
  */
508
506
  CustomComponent[_a24] = "customComponent";
509
507
 
510
- // src/features/ExField.ts
511
- var _a25;
512
- var ExField = class extends BaseModel {
513
- };
514
- _a25 = IMPL_KEY;
515
- /**
516
- * @internal
517
- */
518
- ExField[_a25] = "exField";
519
-
520
508
  // src/client.ts
521
509
  function getImplClass(decl, impls) {
522
510
  return impls == null ? void 0 : impls[decl[IMPL_KEY]];
@@ -701,7 +689,7 @@ var SDKClient = _SDKClient;
701
689
  /**
702
690
  * SDK 版本号
703
691
  */
704
- SDKClient.version = "2.0.8-dev.4";
692
+ SDKClient.version = "2.0.8-dev.5";
705
693
 
706
694
  // src/types/biz.ts
707
695
  var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
@@ -782,14 +770,6 @@ var CustomComponentType = /* @__PURE__ */ ((CustomComponentType2) => {
782
770
  CustomComponentType2["Schedule"] = "schedule";
783
771
  return CustomComponentType2;
784
772
  })(CustomComponentType || {});
785
- var SubFieldType = /* @__PURE__ */ ((SubFieldType2) => {
786
- SubFieldType2["FieldNumber"] = "number";
787
- SubFieldType2["FieldMultiText"] = "text";
788
- SubFieldType2["FieldTreeSelect"] = "tree-multi-select";
789
- SubFieldType2["FieldDatePrecise"] = "date";
790
- SubFieldType2["FieldMultiUser"] = "multi-user";
791
- return SubFieldType2;
792
- })(SubFieldType || {});
793
773
 
794
774
  // src/errors/CustomError.ts
795
775
  var CustomError = class extends Error {
@@ -850,19 +830,7 @@ var InvalidParamsError = class extends CustomError {
850
830
  message: "invalid params error",
851
831
  originMessage: options.originMessage
852
832
  });
853
- this.errCode = -1;
854
- this.errMsg = "unkown error";
855
833
  this.name = "InvalidParamsError";
856
- this.errMsg = this.originMessage;
857
- this._parseErrorCode();
858
- }
859
- _parseErrorCode() {
860
- try {
861
- const { errCode, errMsg } = JSON.parse(this.originMessage);
862
- errCode !== void 0 && (this.errCode = errCode);
863
- errMsg !== void 0 && (this.errMsg = errMsg);
864
- } catch (e) {
865
- }
866
834
  }
867
835
  };
868
836
 
@@ -893,7 +861,6 @@ var src_default = SDKClient;
893
861
  Control,
894
862
  CustomComponent,
895
863
  CustomComponentType,
896
- ExField,
897
864
  Field,
898
865
  FieldType,
899
866
  FlowMode,
@@ -916,7 +883,6 @@ var src_default = SDKClient;
916
883
  Shared,
917
884
  Space,
918
885
  Storage,
919
- SubFieldType,
920
886
  Tab,
921
887
  Toast,
922
888
  Utils,
@@ -697,71 +697,6 @@ interface CustomComponentProps {
697
697
  disabled?: boolean;
698
698
  };
699
699
  }
700
- /** ----------------------- 拓展字段构成类型 ----------------------- */
701
- interface ExFieldFeatureContext {
702
- /**
703
- * 控件当前所属空间标识
704
- */
705
- spaceId: string;
706
- /**
707
- * 控件当前所属工作项类型标识
708
- */
709
- workObjectId: string;
710
- /**
711
- * 控件当前所属工作项实例标识
712
- * 新建页表单内该值为空
713
- */
714
- workItemId?: number;
715
- /**
716
- * 当前节点标识
717
- * 适用场景:详情页为节点流时,且当前控件位于节点表单内,该字段才有数据
718
- */
719
- nodeId?: string;
720
- }
721
- type FieldNumberValue = number;
722
- type FieldMultiTextValue = string;
723
- type FieldTreeSelectOptionValue = string[];
724
- type FieldDatePreciseValue = string | number;
725
- type FieldMultiUserValue = string[];
726
- type FieldValue = FieldNumberValue | FieldMultiTextValue | FieldTreeSelectOptionValue | FieldDatePreciseValue | FieldMultiUserValue;
727
- interface ExCompoundFieldValueType {
728
- field_key: string;
729
- field_value: {
730
- field_key: string;
731
- value?: FieldValue;
732
- }[][];
733
- }
734
- type ExFieldValueType = ExCompoundFieldValueType;
735
- interface ExFieldProps {
736
- value: ExFieldValueType;
737
- disabled?: boolean;
738
- }
739
- interface ExFieldConfig {
740
- key: string;
741
- type: string;
742
- name: string;
743
- children?: ExFieldConfig[];
744
- }
745
- interface ExFieldValidateMsg {
746
- code: 200 | number;
747
- msg: string;
748
- }
749
- declare enum SubFieldType {
750
- FieldNumber = "number",
751
- /**
752
- * 开发者后台使用 multi-pure-text 作为 type,
753
- * 工作项后端会转为 text + { multi: true }
754
- */
755
- FieldMultiText = "text",
756
- FieldTreeSelect = "tree-multi-select",
757
- /**
758
- * 开发者后台使用 precise_date 作为 type,
759
- * 工作项后端会转为 date + format "YYYY-MM-DD HH:mm:ss"
760
- * (普通为 YYYY-MM-DD)
761
- */
762
- FieldDatePrecise = "date",
763
- FieldMultiUser = "multi-user"
764
- }
765
700
  /**
766
701
  * 构成弹窗配置
767
702
  */
@@ -1111,6 +1046,13 @@ declare abstract class Navigation extends BaseModel {
1111
1046
  */
1112
1047
  private static load;
1113
1048
  /**
1049
+ * @public
1050
+ * only web 2.0
1051
+ * 读取当前页面地址的 origin
1052
+ */
1053
+ abstract getOrigin(): Promise<string>;
1054
+ /**
1055
+ *
1114
1056
  * 读取当前完整的页面地址
1115
1057
  */
1116
1058
  abstract getHref(): Promise<string>;
@@ -1898,70 +1840,6 @@ declare abstract class CustomComponent extends BaseModel {
1898
1840
  };
1899
1841
  }
1900
1842
 
1901
- /**
1902
- * @public
1903
- * 自定义组件构成
1904
- */
1905
- declare abstract class ExField extends BaseModel {
1906
- /**
1907
- * @internal
1908
- */
1909
- protected static [IMPL_KEY]: string;
1910
- abstract getContext: () => Promise<ExFieldFeatureContext>;
1911
- abstract getProps: () => Promise<ExFieldProps>;
1912
- /**
1913
- * only for form
1914
- * 用于监听 props 变更
1915
- * @param callback 返回插件字段新的 props
1916
- * @param watchKeys 监听的 key,只能监听属性的 key(不能监听 api key),不传默认监听所有 key。监听的 key 对应的值变更会触发回调
1917
- * @returns
1918
- */
1919
- abstract watch: (callback: (next: ExFieldProps | Record<string, never>) => void, watchKeys?: (keyof ExFieldProps)[]) => Off;
1920
- abstract saveFieldValue: (value: ExFieldValueType) => Promise<ExFieldValidateMsg>;
1921
- abstract getFieldConfig: () => Promise<ExFieldConfig>;
1922
- /**
1923
- * 获取新建工作项表单项的值
1924
- * mobile version ≥ 7.29.0
1925
- * @param keys 需要获取的工作项属性 / 字段 ID 列表,一次限制读取 10 个 keys
1926
- * @param keys.key 工作项属性 / 字段 ID
1927
- * @param keys.type 类型
1928
- * 工作项属性 name 为 FieldType.text,工作项属性 template 为 FieldType.number
1929
- * 控件 role_owners 为 FieldType.control
1930
- */
1931
- abstract getCreateWorkItemFormItemValues(keys: Array<{
1932
- key: string | AttributeType;
1933
- type: Exclude<FieldType, FieldType.richText | FieldType.singleSignal | FieldType.multiSignal | FieldType.singleVoting | FieldType.multiVoting | FieldType.simpleVoting>;
1934
- }>): Promise<Record<string | AttributeType, any>>;
1935
- /**
1936
- * 监听工作项表单项值变化
1937
- * @param options.watchKeys 需要监听的工作项 字段 ID 列表
1938
- * @param callback 当监听值发生变化时触发,changedValue 为变化的 kv
1939
- */
1940
- abstract onWorkItemFormValueChanged(options: {
1941
- watchKeys: Array<{
1942
- key: string | AttributeType;
1943
- type: Exclude<FieldType, FieldType.richText | FieldType.singleSignal | FieldType.multiSignal | FieldType.singleVoting | FieldType.multiVoting | FieldType.simpleVoting>;
1944
- }>;
1945
- }, callback: (changedValue: Record<string, unknown>) => void): Promise<Off>;
1946
- /**
1947
- * only web for table
1948
- * 打开全屏插件
1949
- */
1950
- abstract getTableCellInitProps(): Promise<ExFieldProps>;
1951
- /**
1952
- * only mobile 7.35.0+
1953
- * 获取插件的展示态信息
1954
- */
1955
- abstract getDisplayInfo(): Promise<{
1956
- display_height: number;
1957
- }>;
1958
- /**
1959
- * only mobile 7.35.0+
1960
- * 打开全屏插件
1961
- */
1962
- abstract openFullScreenPlugin(): void;
1963
- }
1964
-
1965
1843
  /**
1966
1844
  * @public
1967
1845
  * SDKClient 的配置项
@@ -2151,12 +2029,9 @@ declare class OutOfLimitError extends CustomError {
2151
2029
  * 请求参数异常
2152
2030
  */
2153
2031
  declare class InvalidParamsError extends CustomError {
2154
- errCode: number;
2155
- errMsg: string;
2156
2032
  constructor(options: {
2157
2033
  originMessage: string;
2158
2034
  });
2159
- _parseErrorCode(): void;
2160
2035
  }
2161
2036
 
2162
2037
  /**
@@ -2178,4 +2053,4 @@ declare class NotSupportedError extends CustomError {
2178
2053
  * @packageDocumentation
2179
2054
  */
2180
2055
 
2181
- export { ActionSheet, ActionSheetOptions, AttributeType, BatchButtonFeatureContext, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ComponentScheduleIdentity, ComponentScheduleScene, Configuration, ConfigurationFeatureContext, ContainerModal, ContainerModalConfigureOptions, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, CustomComponent, CustomComponentFeatureContext, CustomComponentProps, CustomComponentType, ExCompoundFieldValueType, ExField, ExFieldConfig, ExFieldFeatureContext, ExFieldProps, ExFieldValidateMsg, ExFieldValueType, Field, FieldType, FieldValue, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IRichTextEditorImageUploadComplete, 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, ScheduleCompValidateMsg, ScheduleCompValueType, ScheduleUnitButtonFeatureContext, Shared, Space, Storage, SubFieldType, Tab, TabFeatureContext, Toast, ToastOptions, User, UserInfo, Utils, View, ViewFeatureContext, WbsStatus, WorkItem, WorkItemButtonFeatureContext, WorkItemCreateFormPreset, WorkItemFinder, WorkItemFinderOptions, WorkObject, SDKClient as default, unwatch };
2056
+ export { ActionSheet, ActionSheetOptions, AttributeType, BatchButtonFeatureContext, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, Button, ButtonFeatureContext, ButtonScene, Clipboard, ColorScheme, ComponentScheduleIdentity, ComponentScheduleScene, Configuration, ConfigurationFeatureContext, ContainerModal, ContainerModalConfigureOptions, Context, Control, ControlFeatureContext, CreateButtonFeatureContext, CustomComponent, CustomComponentFeatureContext, CustomComponentProps, CustomComponentType, Field, FieldType, FlowMode, IMPL_KEY, IPluginCustomBuildConfig, IRichTextEditorImageUploadComplete, 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, ScheduleCompValidateMsg, ScheduleCompValueType, ScheduleUnitButtonFeatureContext, Shared, Space, Storage, 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.0.8-dev.4",
3
+ "version": "2.0.8-dev.5",
4
4
  "runtimeMinVersions": {
5
5
  "web": "2.1.0",
6
6
  "mobile": "1.1.0"