yach.open.jssdk 4.4.3 → 4.4.4-beta.11
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/yach_jssdk_4.4.4-beta.11.js +1 -0
- package/es/api/app/custom/talYoungFilesUpload.js +0 -2
- package/es/api/biz/chat/chooseConversationByCorpId.js +0 -2
- package/es/api/biz/chat/openSingleChat.js +0 -2
- package/es/api/biz/chat/openSquad.js +0 -2
- package/es/api/biz/chat/openTeamChat.js +0 -2
- package/es/api/biz/chat/pickConversation.js +0 -2
- package/es/api/biz/chat/sendP2PMsg.js +0 -2
- package/es/api/biz/contact/complexPicker.js +0 -2
- package/es/api/biz/contact/departmentsPicker.js +0 -2
- package/es/api/biz/group/groupComplexPicker.js +0 -2
- package/es/api/biz/map/multipointView.js +0 -2
- package/es/api/biz/map/view.js +0 -2
- package/es/api/biz/navigation/close.js +0 -2
- package/es/api/biz/navigation/goBack.js +0 -2
- package/es/api/biz/navigation/quit.js +0 -2
- package/es/api/biz/navigation/replace.js +0 -2
- package/es/api/biz/navigation/setIcon.js +0 -2
- package/es/api/biz/navigation/setLeft.js +0 -2
- package/es/api/biz/navigation/setMenu.js +0 -2
- package/es/api/biz/navigation/setPanGestureEnable.js +0 -2
- package/es/api/biz/navigation/setRight.js +0 -2
- package/es/api/biz/navigation/setTitle.js +0 -2
- package/es/api/biz/navigation/setTitleExpandIcon.js +0 -2
- package/es/api/biz/navigation/setWindowBig.js +0 -2
- package/es/api/biz/navigation/tencentMeeting.js +0 -2
- package/es/api/biz/navigation/tencentMeetingBegin.js +0 -2
- package/es/api/biz/navigation/updateExpandTitle.js +0 -2
- package/es/api/biz/telephone/call.js +0 -2
- package/es/api/biz/telephone/showCallMenu.js +0 -2
- package/es/api/biz/util/addAppToNav.js +0 -2
- package/es/api/biz/util/assistantCreate.js +0 -2
- package/es/api/biz/util/authFinish.js +0 -2
- package/es/api/biz/util/authStart.js +0 -2
- package/es/api/biz/util/chosen.js +0 -2
- package/es/api/biz/util/clipboardFileUpload.js +0 -2
- package/es/api/biz/util/closeWindow.js +0 -2
- package/es/api/biz/util/complain.js +0 -2
- package/es/api/biz/util/copy.d.ts +11 -0
- package/es/api/biz/util/copy.js +19 -0
- package/es/api/biz/util/createModifySchedule.js +0 -2
- package/es/api/biz/util/datepicker.js +0 -2
- package/es/api/biz/util/datetimepicker.js +0 -2
- package/es/api/biz/util/disableScreenCapture.js +0 -2
- package/es/api/biz/util/downloadFile.js +0 -2
- package/es/api/biz/util/entergroupCheck.js +0 -2
- package/es/api/biz/util/externalLinkPreviewFile.js +0 -2
- package/es/api/biz/util/feedback.js +0 -2
- package/es/api/biz/util/getConfig.d.ts +13 -0
- package/es/api/biz/util/getConfig.js +19 -0
- package/es/api/biz/util/getSingleWebviewData.js +0 -2
- package/es/api/biz/util/getTogetherConfig.js +0 -2
- package/es/api/biz/util/getToken.js +0 -2
- package/es/api/biz/util/injectScript.js +0 -2
- package/es/api/biz/util/invoice.js +0 -2
- package/es/api/biz/util/knowledgeBaseSelect.js +9 -3
- package/es/api/biz/util/knowledgeSelectParams.d.ts +14 -0
- package/es/api/biz/util/knowledgeSelectParams.js +19 -0
- package/es/api/biz/util/lorebaseRefreshNodeWebview.d.ts +11 -0
- package/es/api/biz/util/lorebaseRefreshNodeWebview.js +19 -0
- package/es/api/biz/util/lorebaseShowList.d.ts +11 -0
- package/es/api/biz/util/lorebaseShowList.js +19 -0
- package/es/api/biz/util/mediaFileUpload.js +0 -2
- package/es/api/biz/util/onlineDocmentOpenTeamChat.js +0 -2
- package/es/api/biz/util/open.js +0 -2
- package/es/api/biz/util/openFutureGroup.js +0 -2
- package/es/api/biz/util/openLink.js +0 -2
- package/es/api/biz/util/openMediaFileDialog.js +0 -2
- package/es/api/biz/util/openPublish.d.ts +22 -0
- package/es/api/biz/util/openPublish.js +15 -0
- package/es/api/biz/util/openSingleWebview.js +0 -2
- package/es/api/biz/util/openSlidePanel.js +0 -2
- package/es/api/biz/util/openTalYoungToTopic.js +0 -2
- package/es/api/biz/util/openTogetherEyeWebview.js +0 -2
- package/es/api/biz/util/openUserSchedule.js +0 -2
- package/es/api/biz/util/openVideoPlayer.js +0 -2
- package/es/api/biz/util/previewFile.js +0 -2
- package/es/api/biz/util/previewImage.js +0 -2
- package/es/api/biz/util/proxy.js +0 -2
- package/es/api/biz/util/pushWorkMsg.js +0 -2
- package/es/api/biz/util/remind.js +0 -2
- package/es/api/biz/util/resetSessionUnread.js +0 -2
- package/es/api/biz/util/rouseApp.js +0 -2
- package/es/api/biz/util/savePic.js +0 -2
- package/es/api/biz/util/scan.js +0 -2
- package/es/api/biz/util/screen.js +0 -2
- package/es/api/biz/util/selectDepartment.js +0 -2
- package/es/api/biz/util/share.js +0 -2
- package/es/api/biz/util/takePicture.js +0 -2
- package/es/api/biz/util/topicEvent.js +0 -2
- package/es/api/biz/util/uploadAttachment.js +0 -2
- package/es/api/biz/util/weeklyRead.js +0 -2
- package/es/api/biz/util/yachEvent.js +0 -2
- package/es/api/biz/util/zfbAuth.js +0 -2
- package/es/api/biz/webViewMessage/send.js +0 -2
- package/es/api/device/audio/download.js +0 -2
- package/es/api/device/audio/onPlayEnd.js +0 -2
- package/es/api/device/audio/onRecordEnd.js +0 -2
- package/es/api/device/audio/onRecordEnd_v2.js +0 -2
- package/es/api/device/audio/pause.js +0 -2
- package/es/api/device/audio/play.js +0 -2
- package/es/api/device/audio/resume.js +0 -2
- package/es/api/device/audio/startRecord.js +0 -2
- package/es/api/device/audio/startRecord_v2.js +0 -2
- package/es/api/device/audio/stop.js +0 -2
- package/es/api/device/audio/stopRecord.js +0 -2
- package/es/api/device/audio/stopRecord_v2.js +0 -2
- package/es/api/device/base/checkStepPermission.js +0 -2
- package/es/api/device/base/getPhoneInfo.js +0 -2
- package/es/api/device/base/getUUID.js +0 -2
- package/es/api/device/connection/getNetworkType.js +0 -2
- package/es/api/device/connection/isAtTal.js +2 -4
- package/es/api/device/geolocation/get.js +0 -2
- package/es/api/device/geolocation/getSwitch.js +0 -2
- package/es/api/device/notification/actionSheet.js +0 -2
- package/es/api/device/notification/alert.js +0 -2
- package/es/api/device/notification/confirm.js +0 -2
- package/es/api/device/notification/hidePreloader.js +0 -4
- package/es/api/device/notification/showPreloader.js +0 -4
- package/es/api/device/notification/toast.js +0 -2
- package/es/api/device/notification/vibrate.js +0 -2
- package/es/api/device/system/getLang.js +0 -2
- package/es/api/device/system/setLight.js +0 -2
- package/es/api/initAPI.js +3 -5
- package/es/api/primary/createTab.js +0 -2
- package/es/api/primary/exitFullScreen.js +0 -2
- package/es/api/primary/fullScreen.js +0 -2
- package/es/api/primary/updateTab.d.ts +9 -0
- package/es/api/primary/updateTab.js +15 -0
- package/es/api/primary/weeklyShare.js +0 -2
- package/es/api/runtime/permission/requestAuthCode.js +0 -2
- package/es/api/ui/pullToRefresh/disable.js +0 -2
- package/es/api/ui/pullToRefresh/enable.js +0 -2
- package/es/api/ui/pullToRefresh/stop.js +0 -2
- package/es/api/ui/webViewBounce/disable.js +0 -2
- package/es/api/util/domainStorage/getItem.js +0 -2
- package/es/api/util/domainStorage/removeItem.js +0 -2
- package/es/api/util/domainStorage/setItem.js +0 -2
- package/es/api/util/tool/flushLog.js +0 -2
- package/es/api/util/tool/log.js +0 -2
- package/es/index.d.ts +13 -1
- package/es/index.js +29 -28
- package/es/lib/bridge/mobile.js +22 -27
- package/es/lib/bridge/pc.js +11 -18
- package/es/lib/helper/apiHelper.js +0 -2
- package/es/lib/helper/codeMap.js +0 -2
- package/es/lib/helper/event.js +7 -19
- package/es/lib/helper/pcIframe.d.ts +8 -25
- package/es/lib/helper/pcIframe.js +48 -54
- package/es/lib/index.js +7 -21
- package/es/lib/sdk/index.js +16 -37
- package/es/lib/sdk/sdk.typings.d.ts +1 -0
- package/es/lib/sdk/sdk.typings.js +0 -1
- package/es/utils/bpitLog.js +4 -13
- package/es/utils/compareVersions.js +26 -53
- package/es/utils/console.js +1 -17
- package/es/utils/env.js +15 -20
- package/es/utils/index.js +1 -6
- package/libs/api/app/custom/talYoungFilesUpload.js +2 -7
- package/libs/api/biz/chat/chooseConversationByCorpId.js +1 -7
- package/libs/api/biz/chat/openSingleChat.js +1 -7
- package/libs/api/biz/chat/openSquad.js +1 -7
- package/libs/api/biz/chat/openTeamChat.js +1 -7
- package/libs/api/biz/chat/pickConversation.js +1 -7
- package/libs/api/biz/chat/sendP2PMsg.js +1 -7
- package/libs/api/biz/contact/complexPicker.js +1 -7
- package/libs/api/biz/contact/departmentsPicker.js +1 -7
- package/libs/api/biz/group/groupComplexPicker.js +1 -7
- package/libs/api/biz/map/multipointView.js +1 -7
- package/libs/api/biz/map/view.js +1 -7
- package/libs/api/biz/navigation/close.js +1 -7
- package/libs/api/biz/navigation/goBack.js +1 -7
- package/libs/api/biz/navigation/quit.js +1 -7
- package/libs/api/biz/navigation/replace.js +1 -7
- package/libs/api/biz/navigation/setIcon.js +1 -8
- package/libs/api/biz/navigation/setLeft.js +1 -8
- package/libs/api/biz/navigation/setMenu.js +1 -8
- package/libs/api/biz/navigation/setPanGestureEnable.js +1 -8
- package/libs/api/biz/navigation/setRight.js +1 -8
- package/libs/api/biz/navigation/setTitle.js +1 -7
- package/libs/api/biz/navigation/setTitleExpandIcon.js +1 -8
- package/libs/api/biz/navigation/setWindowBig.js +2 -7
- package/libs/api/biz/navigation/tencentMeeting.js +1 -7
- package/libs/api/biz/navigation/tencentMeetingBegin.js +1 -7
- package/libs/api/biz/navigation/updateExpandTitle.js +1 -7
- package/libs/api/biz/telephone/call.js +1 -7
- package/libs/api/biz/telephone/showCallMenu.js +1 -7
- package/libs/api/biz/util/addAppToNav.js +1 -7
- package/libs/api/biz/util/assistantCreate.js +1 -7
- package/libs/api/biz/util/authFinish.js +1 -7
- package/libs/api/biz/util/authStart.js +1 -7
- package/libs/api/biz/util/chosen.js +1 -7
- package/libs/api/biz/util/clipboardFileUpload.js +1 -7
- package/libs/api/biz/util/closeWindow.js +1 -7
- package/libs/api/biz/util/complain.js +1 -7
- package/libs/api/biz/util/copy.d.ts +11 -0
- package/libs/api/biz/util/copy.js +26 -0
- package/libs/api/biz/util/createModifySchedule.js +1 -7
- package/libs/api/biz/util/datepicker.js +1 -7
- package/libs/api/biz/util/datetimepicker.js +1 -7
- package/libs/api/biz/util/disableScreenCapture.js +1 -7
- package/libs/api/biz/util/downloadFile.js +1 -7
- package/libs/api/biz/util/entergroupCheck.js +1 -7
- package/libs/api/biz/util/externalLinkPreviewFile.js +1 -7
- package/libs/api/biz/util/feedback.js +1 -7
- package/libs/api/biz/util/getConfig.d.ts +13 -0
- package/libs/api/biz/util/getConfig.js +26 -0
- package/libs/api/biz/util/getSingleWebviewData.js +1 -7
- package/libs/api/biz/util/getTogetherConfig.js +1 -7
- package/libs/api/biz/util/getToken.js +1 -7
- package/libs/api/biz/util/injectScript.js +1 -7
- package/libs/api/biz/util/invoice.js +2 -7
- package/libs/api/biz/util/knowledgeBaseSelect.js +10 -8
- package/libs/api/biz/util/knowledgeSelectParams.d.ts +14 -0
- package/libs/api/biz/util/knowledgeSelectParams.js +26 -0
- package/libs/api/biz/util/lorebaseRefreshNodeWebview.d.ts +11 -0
- package/libs/api/biz/util/lorebaseRefreshNodeWebview.js +26 -0
- package/libs/api/biz/util/lorebaseShowList.d.ts +11 -0
- package/libs/api/biz/util/lorebaseShowList.js +26 -0
- package/libs/api/biz/util/mediaFileUpload.js +2 -7
- package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +1 -7
- package/libs/api/biz/util/open.js +1 -7
- package/libs/api/biz/util/openFutureGroup.js +1 -7
- package/libs/api/biz/util/openLink.js +1 -7
- package/libs/api/biz/util/openMediaFileDialog.js +2 -7
- package/libs/api/biz/util/openPublish.d.ts +22 -0
- package/libs/api/biz/util/openPublish.js +22 -0
- package/libs/api/biz/util/openSingleWebview.js +1 -7
- package/libs/api/biz/util/openSlidePanel.js +1 -7
- package/libs/api/biz/util/openTalYoungToTopic.js +2 -7
- package/libs/api/biz/util/openTogetherEyeWebview.js +1 -7
- package/libs/api/biz/util/openUserSchedule.js +1 -7
- package/libs/api/biz/util/openVideoPlayer.js +1 -7
- package/libs/api/biz/util/previewFile.js +1 -7
- package/libs/api/biz/util/previewImage.js +1 -7
- package/libs/api/biz/util/proxy.js +1 -7
- package/libs/api/biz/util/pushWorkMsg.js +2 -7
- package/libs/api/biz/util/remind.js +1 -7
- package/libs/api/biz/util/resetSessionUnread.js +1 -7
- package/libs/api/biz/util/rouseApp.js +2 -7
- package/libs/api/biz/util/savePic.js +1 -7
- package/libs/api/biz/util/scan.js +1 -7
- package/libs/api/biz/util/screen.js +1 -7
- package/libs/api/biz/util/selectDepartment.js +1 -7
- package/libs/api/biz/util/share.js +1 -7
- package/libs/api/biz/util/takePicture.js +1 -7
- package/libs/api/biz/util/topicEvent.js +1 -7
- package/libs/api/biz/util/uploadAttachment.js +1 -7
- package/libs/api/biz/util/weeklyRead.js +1 -7
- package/libs/api/biz/util/yachEvent.js +1 -7
- package/libs/api/biz/util/zfbAuth.js +1 -7
- package/libs/api/biz/webViewMessage/send.js +1 -7
- package/libs/api/device/audio/download.js +1 -7
- package/libs/api/device/audio/onPlayEnd.js +1 -7
- package/libs/api/device/audio/onRecordEnd.js +1 -7
- package/libs/api/device/audio/onRecordEnd_v2.js +1 -7
- package/libs/api/device/audio/pause.js +1 -7
- package/libs/api/device/audio/play.js +1 -7
- package/libs/api/device/audio/resume.js +1 -7
- package/libs/api/device/audio/startRecord.js +1 -7
- package/libs/api/device/audio/startRecord_v2.js +1 -7
- package/libs/api/device/audio/stop.js +1 -7
- package/libs/api/device/audio/stopRecord.js +1 -7
- package/libs/api/device/audio/stopRecord_v2.js +1 -7
- package/libs/api/device/base/checkStepPermission.js +1 -7
- package/libs/api/device/base/getPhoneInfo.js +1 -7
- package/libs/api/device/base/getUUID.js +1 -7
- package/libs/api/device/connection/getNetworkType.js +1 -7
- package/libs/api/device/connection/isAtTal.js +3 -9
- package/libs/api/device/geolocation/get.js +1 -7
- package/libs/api/device/geolocation/getSwitch.js +1 -7
- package/libs/api/device/notification/actionSheet.js +1 -7
- package/libs/api/device/notification/alert.js +1 -7
- package/libs/api/device/notification/confirm.js +1 -7
- package/libs/api/device/notification/hidePreloader.js +2 -10
- package/libs/api/device/notification/showPreloader.js +2 -10
- package/libs/api/device/notification/toast.js +1 -7
- package/libs/api/device/notification/vibrate.js +1 -7
- package/libs/api/device/system/getLang.js +1 -7
- package/libs/api/device/system/setLight.js +1 -7
- package/libs/api/initAPI.js +4 -13
- package/libs/api/primary/createTab.js +1 -7
- package/libs/api/primary/exitFullScreen.js +1 -7
- package/libs/api/primary/fullScreen.js +1 -7
- package/libs/api/primary/updateTab.d.ts +9 -0
- package/libs/api/primary/updateTab.js +22 -0
- package/libs/api/primary/weeklyShare.js +1 -7
- package/libs/api/runtime/permission/requestAuthCode.js +1 -7
- package/libs/api/ui/pullToRefresh/disable.js +1 -7
- package/libs/api/ui/pullToRefresh/enable.js +1 -7
- package/libs/api/ui/pullToRefresh/stop.js +1 -7
- package/libs/api/ui/webViewBounce/disable.js +1 -7
- package/libs/api/util/domainStorage/getItem.js +1 -7
- package/libs/api/util/domainStorage/removeItem.js +1 -7
- package/libs/api/util/domainStorage/setItem.js +1 -7
- package/libs/api/util/tool/flushLog.js +1 -7
- package/libs/api/util/tool/log.js +1 -7
- package/libs/index.d.ts +13 -1
- package/libs/index.js +316 -536
- package/libs/lib/bridge/index.js +6 -13
- package/libs/lib/bridge/mobile.js +26 -50
- package/libs/lib/bridge/pc.js +16 -37
- package/libs/lib/helper/apiHelper.js +1 -7
- package/libs/lib/helper/codeMap.js +1 -7
- package/libs/lib/helper/event.js +8 -28
- package/libs/lib/helper/pcIframe.d.ts +8 -25
- package/libs/lib/helper/pcIframe.js +47 -61
- package/libs/lib/index.js +9 -33
- package/libs/lib/sdk/index.js +17 -47
- package/libs/lib/sdk/sdk.typings.d.ts +1 -0
- package/libs/lib/sdk/sdk.typings.js +0 -4
- package/libs/utils/bpitLog.js +4 -16
- package/libs/utils/compareVersions.js +32 -77
- package/libs/utils/console.js +2 -18
- package/libs/utils/env.js +15 -22
- package/libs/utils/index.js +8 -21
- package/package.json +4 -6
- package/dist/yach_jssdk_4.4.3.js +0 -1
package/es/api/util/tool/log.js
CHANGED
package/es/index.d.ts
CHANGED
|
@@ -51,6 +51,11 @@ import { weeklyRead } from './api/biz/util/weeklyRead';
|
|
|
51
51
|
import { disableScreenCapture } from './api/biz/util/disableScreenCapture';
|
|
52
52
|
import { openFutureGroup } from './api/biz/util/openFutureGroup';
|
|
53
53
|
import { knowledgeBaseSelect } from './api/biz/util/knowledgeBaseSelect';
|
|
54
|
+
import { knowledgeSelectParams } from './api/biz/util/knowledgeSelectParams';
|
|
55
|
+
import { lorebaseShowList } from './api/biz/util/lorebaseShowList';
|
|
56
|
+
import { lorebaseRefreshNodeWebview } from './api/biz/util/lorebaseRefreshNodeWebview';
|
|
57
|
+
import { copy } from './api/biz/util/copy';
|
|
58
|
+
import { openPublish } from './api/biz/util/openPublish';
|
|
54
59
|
/**navigation*/
|
|
55
60
|
import { setIcon } from './api/biz/navigation/setIcon';
|
|
56
61
|
import { setTitle } from './api/biz/navigation/setTitle';
|
|
@@ -80,6 +85,7 @@ import { openTeamChat } from './api/biz/chat/openTeamChat';
|
|
|
80
85
|
import { openSquad } from './api/biz/chat/openSquad';
|
|
81
86
|
import { sendP2PMsg } from './api/biz/chat/sendP2PMsg';
|
|
82
87
|
import { createTab } from './api/primary/createTab';
|
|
88
|
+
import { updateTab } from './api/primary/updateTab';
|
|
83
89
|
import { weeklyShare } from './api/primary/weeklyShare';
|
|
84
90
|
import { fullScreen } from './api/primary/fullScreen';
|
|
85
91
|
import { exitFullScreen } from './api/primary/exitFullScreen';
|
|
@@ -131,7 +137,7 @@ import { send as webViewMessageSend } from './api/biz/webViewMessage/send';
|
|
|
131
137
|
import { talYoungFilesUpload } from './api/app/custom/talYoungFilesUpload';
|
|
132
138
|
import { addAppToNav } from './api/biz/util/addAppToNav';
|
|
133
139
|
declare const version: string, sdkVersion: string, env: import("./lib/sdk/sdk.typings").IENV, platform: import("./lib/sdk/sdk.typings").ENV_ENUM, platformV2: import("./lib/sdk/sdk.typings").PlatformV2Props, config: (configParams: import("./lib/sdk/sdk.typings").IConfigParams) => void, ready: (readyCallback: () => void) => void, error: (callback: (err: any) => void) => void, on: (methodName: string, listener: (e: any) => void) => void, off: (methodName: string, listener: (e: any) => void) => void;
|
|
134
|
-
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, capturePage, };
|
|
140
|
+
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, updateTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, knowledgeSelectParams, lorebaseShowList, lorebaseRefreshNodeWebview, openPublish, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, copy, capturePage, };
|
|
135
141
|
declare const _default: {
|
|
136
142
|
version: string;
|
|
137
143
|
sdkVersion: string;
|
|
@@ -196,6 +202,11 @@ declare const _default: {
|
|
|
196
202
|
disableScreenCapture: typeof disableScreenCapture;
|
|
197
203
|
addAppToNav: typeof addAppToNav;
|
|
198
204
|
knowledgeBaseSelect: typeof knowledgeBaseSelect;
|
|
205
|
+
knowledgeSelectParams: typeof knowledgeSelectParams;
|
|
206
|
+
lorebaseShowList: typeof lorebaseShowList;
|
|
207
|
+
lorebaseRefreshNodeWebview: typeof lorebaseRefreshNodeWebview;
|
|
208
|
+
copy: typeof copy;
|
|
209
|
+
openPublish: typeof openPublish;
|
|
199
210
|
capturePage: typeof capturePage;
|
|
200
211
|
};
|
|
201
212
|
telephone: {
|
|
@@ -249,6 +260,7 @@ declare const _default: {
|
|
|
249
260
|
};
|
|
250
261
|
primary: {
|
|
251
262
|
createTab: typeof createTab;
|
|
263
|
+
updateTab: typeof updateTab;
|
|
252
264
|
weeklyShare: typeof weeklyShare;
|
|
253
265
|
fullScreen: typeof fullScreen;
|
|
254
266
|
exitFullScreen: typeof exitFullScreen;
|
package/es/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { yachSdk } from './lib';
|
|
2
2
|
/*biz*****************************/
|
|
3
|
-
|
|
4
3
|
/**util*/
|
|
5
|
-
|
|
6
4
|
import { openLink } from './api/biz/util/openLink';
|
|
7
5
|
import { feedback } from './api/biz/util/feedback';
|
|
8
6
|
import { open } from './api/biz/util/open';
|
|
@@ -55,8 +53,12 @@ import { weeklyRead } from './api/biz/util/weeklyRead';
|
|
|
55
53
|
import { disableScreenCapture } from './api/biz/util/disableScreenCapture';
|
|
56
54
|
import { openFutureGroup } from './api/biz/util/openFutureGroup';
|
|
57
55
|
import { knowledgeBaseSelect } from './api/biz/util/knowledgeBaseSelect';
|
|
56
|
+
import { knowledgeSelectParams } from './api/biz/util/knowledgeSelectParams';
|
|
57
|
+
import { lorebaseShowList } from './api/biz/util/lorebaseShowList';
|
|
58
|
+
import { lorebaseRefreshNodeWebview } from './api/biz/util/lorebaseRefreshNodeWebview';
|
|
59
|
+
import { copy } from './api/biz/util/copy';
|
|
60
|
+
import { openPublish } from './api/biz/util/openPublish';
|
|
58
61
|
/**navigation*/
|
|
59
|
-
|
|
60
62
|
import { setIcon } from './api/biz/navigation/setIcon';
|
|
61
63
|
import { setTitle } from './api/biz/navigation/setTitle';
|
|
62
64
|
import { setMenu } from './api/biz/navigation/setMenu';
|
|
@@ -73,14 +75,11 @@ import { tencentMeeting } from './api/biz/navigation/tencentMeeting';
|
|
|
73
75
|
import { tencentMeetingBegin } from './api/biz/navigation/tencentMeetingBegin';
|
|
74
76
|
import { setPanGestureEnable } from './api/biz/navigation/setPanGestureEnable';
|
|
75
77
|
/**contact*/
|
|
76
|
-
|
|
77
78
|
import { complexPicker } from './api/biz/contact/complexPicker';
|
|
78
79
|
import { departmentsPicker } from './api/biz/contact/departmentsPicker';
|
|
79
80
|
/** group*/
|
|
80
|
-
|
|
81
81
|
import { groupComplexPicker } from './api/biz/group/groupComplexPicker';
|
|
82
82
|
/** chat*/
|
|
83
|
-
|
|
84
83
|
import { chooseConversationByCorpId } from './api/biz/chat/chooseConversationByCorpId';
|
|
85
84
|
import { pickConversation } from './api/biz/chat/pickConversation';
|
|
86
85
|
import { openSingleChat } from './api/biz/chat/openSingleChat';
|
|
@@ -88,16 +87,14 @@ import { openTeamChat } from './api/biz/chat/openTeamChat';
|
|
|
88
87
|
import { openSquad } from './api/biz/chat/openSquad';
|
|
89
88
|
import { sendP2PMsg } from './api/biz/chat/sendP2PMsg';
|
|
90
89
|
/* primary*****************************/
|
|
91
|
-
|
|
92
90
|
import { createTab } from './api/primary/createTab';
|
|
91
|
+
import { updateTab } from './api/primary/updateTab';
|
|
93
92
|
import { weeklyShare } from './api/primary/weeklyShare';
|
|
94
93
|
import { fullScreen } from './api/primary/fullScreen';
|
|
95
94
|
import { exitFullScreen } from './api/primary/exitFullScreen';
|
|
96
95
|
/* runtime*****************************/
|
|
97
|
-
|
|
98
96
|
import { requestAuthCode } from './api/runtime/permission/requestAuthCode';
|
|
99
97
|
/** device */
|
|
100
|
-
|
|
101
98
|
import { showPreloader, showCustomOverlayContent } from './api/device/notification/showPreloader';
|
|
102
99
|
import { hidePreloader, hideCustomOverlayContent } from './api/device/notification/hidePreloader';
|
|
103
100
|
import { vibrate } from './api/device/notification/vibrate';
|
|
@@ -127,40 +124,38 @@ import { startRecord_v2 } from './api/device/audio/startRecord_v2';
|
|
|
127
124
|
import { stopRecord_v2 } from './api/device/audio/stopRecord_v2';
|
|
128
125
|
import { setLight } from './api/device/system/setLight';
|
|
129
126
|
/** telephone */
|
|
130
|
-
|
|
131
127
|
import { showCallMenu } from './api/biz/telephone/showCallMenu';
|
|
132
128
|
import { call } from './api/biz/telephone/call';
|
|
133
129
|
/** ui */
|
|
134
|
-
|
|
135
130
|
import { disable as webViewBounceDisable } from './api/ui/webViewBounce/disable';
|
|
136
131
|
import { enable as pullToRefreshEnable } from './api/ui/pullToRefresh/enable';
|
|
137
132
|
import { stop as pullToRefreshStop } from './api/ui/pullToRefresh/stop';
|
|
138
|
-
import { disable as pullToRefreshDisable } from './api/ui/pullToRefresh/disable';
|
|
139
|
-
|
|
133
|
+
import { disable as pullToRefreshDisable } from './api/ui/pullToRefresh/disable';
|
|
134
|
+
// demainStorage
|
|
140
135
|
import { getItem } from './api/util/domainStorage/getItem';
|
|
141
136
|
import { setItem } from './api/util/domainStorage/setItem';
|
|
142
|
-
import { removeItem } from './api/util/domainStorage/removeItem';
|
|
143
|
-
|
|
137
|
+
import { removeItem } from './api/util/domainStorage/removeItem';
|
|
138
|
+
// log
|
|
144
139
|
import { writeLog } from './api/util/tool/log';
|
|
145
|
-
import { flushLog } from './api/util/tool/flushLog';
|
|
146
|
-
|
|
140
|
+
import { flushLog } from './api/util/tool/flushLog';
|
|
141
|
+
// screen
|
|
147
142
|
import { capturePage } from './api/biz/util/screen';
|
|
148
143
|
import { send as webViewMessageSend } from './api/biz/webViewMessage/send';
|
|
149
144
|
import { talYoungFilesUpload } from './api/app/custom/talYoungFilesUpload';
|
|
150
145
|
import { addAppToNav } from './api/biz/util/addAppToNav';
|
|
151
146
|
console.log('add rouseApp ------------>', rouseApp);
|
|
152
147
|
var _yachSdk$exportSdk = yachSdk.exportSdk,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, capturePage };
|
|
148
|
+
version = _yachSdk$exportSdk.version,
|
|
149
|
+
sdkVersion = _yachSdk$exportSdk.sdkVersion,
|
|
150
|
+
env = _yachSdk$exportSdk.env,
|
|
151
|
+
platform = _yachSdk$exportSdk.platform,
|
|
152
|
+
platformV2 = _yachSdk$exportSdk.platformV2,
|
|
153
|
+
config = _yachSdk$exportSdk.config,
|
|
154
|
+
ready = _yachSdk$exportSdk.ready,
|
|
155
|
+
error = _yachSdk$exportSdk.error,
|
|
156
|
+
on = _yachSdk$exportSdk.on,
|
|
157
|
+
off = _yachSdk$exportSdk.off;
|
|
158
|
+
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, updateTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, knowledgeSelectParams, lorebaseShowList, lorebaseRefreshNodeWebview, openPublish, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, copy, capturePage };
|
|
164
159
|
export default {
|
|
165
160
|
version: version,
|
|
166
161
|
sdkVersion: sdkVersion,
|
|
@@ -225,6 +220,11 @@ export default {
|
|
|
225
220
|
disableScreenCapture: disableScreenCapture,
|
|
226
221
|
addAppToNav: addAppToNav,
|
|
227
222
|
knowledgeBaseSelect: knowledgeBaseSelect,
|
|
223
|
+
knowledgeSelectParams: knowledgeSelectParams,
|
|
224
|
+
lorebaseShowList: lorebaseShowList,
|
|
225
|
+
lorebaseRefreshNodeWebview: lorebaseRefreshNodeWebview,
|
|
226
|
+
copy: copy,
|
|
227
|
+
openPublish: openPublish,
|
|
228
228
|
capturePage: capturePage
|
|
229
229
|
},
|
|
230
230
|
telephone: {
|
|
@@ -278,6 +278,7 @@ export default {
|
|
|
278
278
|
},
|
|
279
279
|
primary: {
|
|
280
280
|
createTab: createTab,
|
|
281
|
+
updateTab: updateTab,
|
|
281
282
|
weeklyShare: weeklyShare,
|
|
282
283
|
fullScreen: fullScreen,
|
|
283
284
|
exitFullScreen: exitFullScreen
|
package/es/lib/bridge/mobile.js
CHANGED
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
2
|
-
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
3
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
4
|
-
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
5
1
|
import _setTimeout from "@babel/runtime-corejs3/core-js/set-timeout";
|
|
2
|
+
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
3
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
4
|
+
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
5
|
+
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
6
6
|
import Event from '../helper/event';
|
|
7
7
|
import { electronResCodeMap } from '../helper/codeMap';
|
|
8
8
|
import { log, bpitLog } from '../../utils';
|
|
9
|
-
|
|
10
9
|
function setupWebViewJavascriptBridge(callback) {
|
|
11
10
|
if (window.WebViewJavascriptBridge) {
|
|
12
11
|
return callback(WebViewJavascriptBridge);
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
if (window.WKWebViewJavascriptBridge) {
|
|
16
14
|
return callback(WKWebViewJavascriptBridge);
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
if (window.WVJBCallbacks) {
|
|
20
17
|
return window.WVJBCallbacks.push(callback);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
window.WVJBCallbacks = [callback];
|
|
24
20
|
var WVJBIframe = document.createElement('iframe');
|
|
25
21
|
WVJBIframe.style.display = 'none';
|
|
26
22
|
WVJBIframe.src = 'https://__bridge_loaded__';
|
|
27
23
|
document.documentElement.appendChild(WVJBIframe);
|
|
28
|
-
|
|
29
24
|
_setTimeout(function () {
|
|
30
25
|
document.documentElement.removeChild(WVJBIframe);
|
|
31
26
|
}, 0);
|
|
32
27
|
}
|
|
33
|
-
|
|
34
28
|
var mobileBridgeInit = function mobileBridgeInit() {
|
|
35
29
|
return new _Promise(function (resolve, reject) {
|
|
36
30
|
setupWebViewJavascriptBridge(function (bridge) {
|
|
@@ -73,21 +67,28 @@ var mobileBridgeInit = function mobileBridgeInit() {
|
|
|
73
67
|
});
|
|
74
68
|
Event.execEvent('sendMsgCommon', resData);
|
|
75
69
|
});
|
|
70
|
+
bridge.registerHandler('toolbarClickEvent', function (resData, responseCallback) {
|
|
71
|
+
log("toolbarClickEvent ", {
|
|
72
|
+
resData: resData
|
|
73
|
+
});
|
|
74
|
+
var responseData = {
|
|
75
|
+
data: resData,
|
|
76
|
+
callback: responseCallback
|
|
77
|
+
};
|
|
78
|
+
Event.execEvent('toolbarClickEvent', responseData);
|
|
79
|
+
});
|
|
76
80
|
resolve();
|
|
77
81
|
});
|
|
78
82
|
});
|
|
79
83
|
};
|
|
80
|
-
|
|
81
84
|
var mobileBridge = function mobileBridge(method, param) {
|
|
82
85
|
return new _Promise(function (resolve, reject) {
|
|
83
86
|
var p = _Object$assign({}, param);
|
|
84
|
-
|
|
85
87
|
setupWebViewJavascriptBridge(function (bridge) {
|
|
86
88
|
if (param.control) {
|
|
87
89
|
bridge.registerHandler(method, function (data) {
|
|
88
90
|
var onSuccess = param.onSuccess;
|
|
89
91
|
delete p.onSuccess;
|
|
90
|
-
|
|
91
92
|
if ('function' === typeof onSuccess) {
|
|
92
93
|
onSuccess(data);
|
|
93
94
|
resolve({
|
|
@@ -97,14 +98,11 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
97
98
|
}
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
|
-
|
|
101
101
|
bridge.callHandler(method, param, function (e) {
|
|
102
102
|
var code = e.code,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
message = e.message,
|
|
104
|
+
data = e.data;
|
|
106
105
|
var _code = _parseInt(code);
|
|
107
|
-
|
|
108
106
|
var callbackStr = electronResCodeMap(_code);
|
|
109
107
|
var callbackFun = p[callbackStr];
|
|
110
108
|
log("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
@@ -114,40 +112,37 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
114
112
|
_code: _code,
|
|
115
113
|
message: message,
|
|
116
114
|
callbackFun: callbackFun
|
|
117
|
-
});
|
|
118
|
-
|
|
115
|
+
});
|
|
116
|
+
// 请求失败
|
|
119
117
|
if (callbackStr === 'onFail') {
|
|
120
118
|
bpitLog({
|
|
121
119
|
method: method,
|
|
122
120
|
errorcode: _code,
|
|
123
121
|
message: message || _JSON$stringify(data) || 'SDK执行失败回调,相关参数'
|
|
124
122
|
});
|
|
125
|
-
|
|
126
123
|
if ('function' === typeof callbackFun) {
|
|
127
124
|
message ? callbackFun({
|
|
128
125
|
code: code,
|
|
129
126
|
message: message
|
|
130
127
|
}) : callbackFun(data);
|
|
131
128
|
}
|
|
132
|
-
|
|
133
129
|
reject({
|
|
134
130
|
_code: _code,
|
|
135
131
|
message: message,
|
|
136
132
|
data: data
|
|
137
133
|
});
|
|
138
134
|
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
135
|
+
}
|
|
136
|
+
// 请求成功
|
|
142
137
|
if ('function' === typeof callbackFun) {
|
|
143
138
|
callbackFun(data || message);
|
|
144
139
|
}
|
|
145
|
-
|
|
146
140
|
resolve({
|
|
147
141
|
_code: _code,
|
|
148
142
|
message: message,
|
|
149
143
|
data: data
|
|
150
|
-
});
|
|
144
|
+
});
|
|
145
|
+
// if (_code === -2 || _code === 7) {
|
|
151
146
|
// bpitLog({
|
|
152
147
|
// method,
|
|
153
148
|
// errorcode: _code,
|
package/es/lib/bridge/pc.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
2
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
3
|
-
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
4
1
|
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
2
|
+
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
3
|
+
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
4
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
5
5
|
import PcIframe from '../helper/pcIframe';
|
|
6
6
|
import { electronResCodeMap } from '../helper/codeMap';
|
|
7
7
|
import { log, bpitLog } from '../../utils';
|
|
8
|
-
|
|
9
8
|
var PcBridgeInit = function PcBridgeInit() {
|
|
10
9
|
PcIframe.init();
|
|
11
10
|
};
|
|
12
|
-
|
|
13
11
|
var pcBridge = function pcBridge(method, param) {
|
|
14
12
|
return new _Promise(function (resolve, reject) {
|
|
15
13
|
return PcIframe.invokeAPI(method, param, function (_ref) {
|
|
16
14
|
var data = _ref.data,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
code = _ref.code,
|
|
16
|
+
message = _ref.message;
|
|
20
17
|
var _code = _parseInt(code);
|
|
21
|
-
|
|
22
18
|
var callbackStr = electronResCodeMap(_code);
|
|
23
19
|
var callbackFun = param[callbackStr];
|
|
24
20
|
log("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
@@ -28,15 +24,14 @@ var pcBridge = function pcBridge(method, param) {
|
|
|
28
24
|
_code: _code,
|
|
29
25
|
message: message,
|
|
30
26
|
callbackFun: callbackFun
|
|
31
|
-
});
|
|
32
|
-
|
|
27
|
+
});
|
|
28
|
+
// 请求失败
|
|
33
29
|
if (callbackStr === 'onFail') {
|
|
34
30
|
bpitLog({
|
|
35
31
|
method: method,
|
|
36
32
|
errorcode: _code,
|
|
37
33
|
message: message || _JSON$stringify(data) || 'SDK执行失败回调,相关参数'
|
|
38
34
|
});
|
|
39
|
-
|
|
40
35
|
if ('function' === typeof callbackFun) {
|
|
41
36
|
console.log('wenai-code', code, _code);
|
|
42
37
|
var callbackData = Object.prototype.toString.call(data) === "[object Object]" ? _Object$assign(_Object$assign({}, data), {
|
|
@@ -49,25 +44,23 @@ var pcBridge = function pcBridge(method, param) {
|
|
|
49
44
|
};
|
|
50
45
|
message ? callbackFun(callbackData) : callbackFun(data);
|
|
51
46
|
}
|
|
52
|
-
|
|
53
47
|
reject({
|
|
54
48
|
_code: _code,
|
|
55
49
|
message: message,
|
|
56
50
|
data: data
|
|
57
51
|
});
|
|
58
52
|
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
}
|
|
54
|
+
// 请求成功
|
|
62
55
|
if ('function' === typeof callbackFun) {
|
|
63
56
|
callbackFun(data || message);
|
|
64
57
|
}
|
|
65
|
-
|
|
66
58
|
resolve({
|
|
67
59
|
_code: _code,
|
|
68
60
|
message: message,
|
|
69
61
|
data: data
|
|
70
|
-
});
|
|
62
|
+
});
|
|
63
|
+
// if (_code === -2) {
|
|
71
64
|
// bpitLog({
|
|
72
65
|
// method,
|
|
73
66
|
// errorcode: _code,
|
package/es/lib/helper/codeMap.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _Map from "@babel/runtime-corejs3/core-js/map";
|
|
2
2
|
var resCodeMap = new _Map([[0, 'onSuccess'], [-1, 'onCancel'], [-2, 'onFail'], [-3, 'onProgress'], [-4, 'onSubmit']]);
|
|
3
|
-
|
|
4
3
|
function electronResCodeMap(code) {
|
|
5
4
|
return resCodeMap.get(code) || 'onFail';
|
|
6
5
|
}
|
|
7
|
-
|
|
8
6
|
export { electronResCodeMap };
|
package/es/lib/helper/event.js
CHANGED
|
@@ -1,41 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
3
|
-
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
|
|
4
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js/array/is-array";
|
|
1
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
2
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import _Array$isArray from "@babel/runtime-corejs3/core-js/array/is-array";
|
|
4
|
+
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
|
|
5
|
+
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
6
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js/instance/for-each";
|
|
7
|
+
var Event = /*#__PURE__*/_createClass(function Event() {
|
|
8
8
|
var _this = this;
|
|
9
|
-
|
|
10
9
|
_classCallCheck(this, Event);
|
|
11
|
-
|
|
12
10
|
this.on = function (event, fn) {
|
|
13
11
|
if (!event || 'function' !== typeof fn) throw 'eventName is null or handle is not a function, on fail';
|
|
14
12
|
if (!_Array$isArray(_this.eventsHandle[event])) _this.eventsHandle[event] = [];
|
|
15
|
-
|
|
16
13
|
_this.eventsHandle[event].push(fn);
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
this.off = function (event, fn) {
|
|
20
16
|
if (!event) throw 'eventName is null, invoke off fail';
|
|
21
|
-
|
|
22
17
|
if (!fn) {
|
|
23
18
|
_this.eventsHandle[event] = [];
|
|
24
19
|
return;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
if (_Array$isArray(_this.eventsHandle[event])) {
|
|
28
22
|
var _context, _context2;
|
|
29
|
-
|
|
30
23
|
var n = _indexOfInstanceProperty(_context = _this.eventsHandle[event]).call(_context, fn);
|
|
31
|
-
|
|
32
24
|
-1 !== n && _spliceInstanceProperty(_context2 = _this.eventsHandle[event]).call(_context2, n, 1);
|
|
33
25
|
}
|
|
34
26
|
};
|
|
35
|
-
|
|
36
27
|
this.execEvent = function (event, data) {
|
|
37
28
|
var _context3;
|
|
38
|
-
|
|
39
29
|
_Array$isArray(this.eventsHandle[event]) && _forEachInstanceProperty(_context3 = this.eventsHandle[event]).call(_context3, function (fn) {
|
|
40
30
|
try {
|
|
41
31
|
fn(data);
|
|
@@ -44,9 +34,7 @@ var Event = function Event() {
|
|
|
44
34
|
}
|
|
45
35
|
});
|
|
46
36
|
};
|
|
47
|
-
|
|
48
37
|
this.eventsHandle = {};
|
|
49
|
-
};
|
|
50
|
-
|
|
38
|
+
});
|
|
51
39
|
var event = new Event();
|
|
52
40
|
export default event;
|
|
@@ -3,41 +3,24 @@ declare global {
|
|
|
3
3
|
sendToHost: any;
|
|
4
4
|
sendTo: any;
|
|
5
5
|
receiveBrowserViewData: any;
|
|
6
|
+
remoteSendToHost?: (payload: string) => void;
|
|
7
|
+
remoteReceiveFromHost?: (callback: (result: Record<string, any>) => void, moduleId?: string) => void;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
invokeType?: 'browserView' | '';
|
|
10
|
-
[propName: string]: any;
|
|
11
|
-
}
|
|
12
|
-
declare class GenPostMsg {
|
|
13
|
-
private id;
|
|
14
|
-
private PromiseObj;
|
|
15
|
-
private methodName;
|
|
16
|
-
private plainMsg;
|
|
17
|
-
callback: (v: any) => void;
|
|
18
|
-
result: Promise<any>;
|
|
19
|
-
invokeType: 'browserView' | '';
|
|
20
|
-
constructor(method: string, param: APIParams, callback: any);
|
|
21
|
-
genid: () => string;
|
|
22
|
-
receiveResponse: (data: any) => void;
|
|
23
|
-
getPayload: () => {
|
|
24
|
-
msgId: string;
|
|
25
|
-
methodName: string;
|
|
26
|
-
body: object;
|
|
27
|
-
type: string;
|
|
28
|
-
invokeType: "" | "browserView";
|
|
29
|
-
};
|
|
30
|
-
}
|
|
10
|
+
declare type InvokeType = 'browserView' | 'moduleFederation' | '';
|
|
31
11
|
declare class Frame {
|
|
32
12
|
pendingMsgs: {};
|
|
13
|
+
invokeType?: InvokeType;
|
|
14
|
+
moduleId?: string;
|
|
33
15
|
constructor();
|
|
34
16
|
addPending: (e: any) => void;
|
|
35
17
|
deletePending: (e: any) => void;
|
|
36
18
|
getPending: (t: any) => any;
|
|
37
19
|
invokeAPIInBrowserView: (payload: string) => void;
|
|
38
20
|
invokeAPIInWebview: (payload: string) => void;
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
invokeAPIInModuleFederation: (payload: string) => void;
|
|
22
|
+
invokeAPI: (method: string, param: any, callback: any) => any;
|
|
23
|
+
handleCallback: (datas: any, invokeType?: InvokeType) => void;
|
|
41
24
|
init: () => void;
|
|
42
25
|
}
|
|
43
26
|
declare const frame: Frame;
|