yach.open.jssdk 4.3.2 → 4.3.3-beta1
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.3.3-beta1.js +1 -0
- package/es/api/app/custom/talYoungFilesUpload.d.ts +38 -0
- package/es/api/app/custom/talYoungFilesUpload.js +16 -0
- package/es/api/biz/chat/chooseConversationByCorpId.d.ts +36 -0
- package/es/api/biz/chat/chooseConversationByCorpId.js +8 -0
- package/es/api/biz/chat/openSingleChat.d.ts +10 -0
- package/es/api/biz/chat/openSingleChat.js +8 -0
- package/es/api/biz/chat/openSquad.d.ts +8 -0
- package/es/api/biz/chat/openSquad.js +8 -0
- package/es/api/biz/chat/openTeamChat.d.ts +10 -0
- package/es/api/biz/chat/openTeamChat.js +8 -0
- package/es/api/biz/chat/pickConversation.d.ts +19 -0
- package/es/api/biz/chat/pickConversation.js +19 -0
- package/es/api/biz/chat/sendP2PMsg.d.ts +10 -0
- package/es/api/biz/chat/sendP2PMsg.js +8 -0
- package/es/api/biz/contact/complexPicker.d.ts +62 -0
- package/es/api/biz/contact/complexPicker.js +8 -0
- package/es/api/biz/contact/departmentsPicker.d.ts +35 -0
- package/es/api/biz/contact/departmentsPicker.js +8 -0
- package/es/api/biz/group/groupComplexPicker.d.ts +33 -0
- package/es/api/biz/group/groupComplexPicker.js +8 -0
- package/es/api/biz/map/multipointView.d.ts +21 -0
- package/es/api/biz/map/multipointView.js +19 -0
- package/es/api/biz/map/view.d.ts +13 -0
- package/es/api/biz/map/view.js +19 -0
- package/es/api/biz/navigation/close.d.ts +7 -0
- package/es/api/biz/navigation/close.js +9 -0
- package/es/api/biz/navigation/goBack.d.ts +7 -0
- package/es/api/biz/navigation/goBack.js +19 -0
- package/es/api/biz/navigation/quit.d.ts +8 -0
- package/es/api/biz/navigation/quit.js +15 -0
- package/es/api/biz/navigation/replace.d.ts +8 -0
- package/es/api/biz/navigation/replace.js +8 -0
- package/es/api/biz/navigation/setIcon.d.ts +12 -0
- package/es/api/biz/navigation/setIcon.js +27 -0
- package/es/api/biz/navigation/setLeft.d.ts +9 -0
- package/es/api/biz/navigation/setLeft.js +31 -0
- package/es/api/biz/navigation/setMenu.d.ts +20 -0
- package/es/api/biz/navigation/setMenu.js +25 -0
- package/es/api/biz/navigation/setPanGestureEnable.d.ts +9 -0
- package/es/api/biz/navigation/setPanGestureEnable.js +26 -0
- package/es/api/biz/navigation/setRight.d.ts +13 -0
- package/es/api/biz/navigation/setRight.js +31 -0
- package/es/api/biz/navigation/setTitle.d.ts +11 -0
- package/es/api/biz/navigation/setTitle.js +8 -0
- package/es/api/biz/navigation/setTitleExpandIcon.d.ts +9 -0
- package/es/api/biz/navigation/setTitleExpandIcon.js +25 -0
- package/es/api/biz/navigation/setWindowBig.d.ts +9 -0
- package/es/api/biz/navigation/setWindowBig.js +16 -0
- package/es/api/biz/navigation/tencentMeeting.d.ts +22 -0
- package/es/api/biz/navigation/tencentMeeting.js +8 -0
- package/es/api/biz/navigation/tencentMeetingBegin.d.ts +7 -0
- package/es/api/biz/navigation/tencentMeetingBegin.js +8 -0
- package/es/api/biz/navigation/updateExpandTitle.d.ts +8 -0
- package/es/api/biz/navigation/updateExpandTitle.js +8 -0
- package/es/api/biz/telephone/call.d.ts +9 -0
- package/es/api/biz/telephone/call.js +19 -0
- package/es/api/biz/telephone/showCallMenu.d.ts +12 -0
- package/es/api/biz/telephone/showCallMenu.js +19 -0
- package/es/api/biz/util/assistantCreate.d.ts +11 -0
- package/es/api/biz/util/assistantCreate.js +23 -0
- package/es/api/biz/util/authFinish.d.ts +11 -0
- package/es/api/biz/util/authFinish.js +19 -0
- package/es/api/biz/util/authStart.d.ts +9 -0
- package/es/api/biz/util/authStart.js +19 -0
- package/es/api/biz/util/chosen.d.ts +15 -0
- package/es/api/biz/util/chosen.js +19 -0
- package/es/api/biz/util/clipboardFileUpload.d.ts +7 -0
- package/es/api/biz/util/clipboardFileUpload.js +8 -0
- package/es/api/biz/util/closeWindow.d.ts +8 -0
- package/es/api/biz/util/closeWindow.js +15 -0
- package/es/api/biz/util/complain.d.ts +12 -0
- package/es/api/biz/util/complain.js +8 -0
- package/es/api/biz/util/createModifySchedule.d.ts +26 -0
- package/es/api/biz/util/createModifySchedule.js +15 -0
- package/es/api/biz/util/datepicker.d.ts +14 -0
- package/es/api/biz/util/datepicker.js +19 -0
- package/es/api/biz/util/datetimepicker.d.ts +14 -0
- package/es/api/biz/util/datetimepicker.js +19 -0
- package/es/api/biz/util/disableScreenCapture.d.ts +8 -0
- package/es/api/biz/util/disableScreenCapture.js +19 -0
- package/es/api/biz/util/downloadFile.d.ts +9 -0
- package/es/api/biz/util/downloadFile.js +8 -0
- package/es/api/biz/util/entergroupCheck.d.ts +10 -0
- package/es/api/biz/util/entergroupCheck.js +23 -0
- package/es/api/biz/util/externalLinkPreviewFile.d.ts +11 -0
- package/es/api/biz/util/externalLinkPreviewFile.js +8 -0
- package/es/api/biz/util/feedback.d.ts +11 -0
- package/es/api/biz/util/feedback.js +8 -0
- package/es/api/biz/util/getSingleWebviewData.d.ts +8 -0
- package/es/api/biz/util/getSingleWebviewData.js +8 -0
- package/es/api/biz/util/getTogetherConfig.d.ts +11 -0
- package/es/api/biz/util/getTogetherConfig.js +23 -0
- package/es/api/biz/util/getToken.d.ts +11 -0
- package/es/api/biz/util/getToken.js +19 -0
- package/es/api/biz/util/injectScript.d.ts +9 -0
- package/es/api/biz/util/injectScript.js +8 -0
- package/es/api/biz/util/invoice.d.ts +12 -0
- package/es/api/biz/util/invoice.js +15 -0
- package/es/api/biz/util/mediaFileUpload.d.ts +26 -0
- package/es/api/biz/util/mediaFileUpload.js +15 -0
- package/es/api/biz/util/onlineDocmentOpenTeamChat.d.ts +10 -0
- package/es/api/biz/util/onlineDocmentOpenTeamChat.js +23 -0
- package/es/api/biz/util/open.d.ts +9 -0
- package/es/api/biz/util/open.js +8 -0
- package/es/api/biz/util/openLink.d.ts +8 -0
- package/es/api/biz/util/openLink.js +8 -0
- package/es/api/biz/util/openMediaFileDialog.d.ts +23 -0
- package/es/api/biz/util/openMediaFileDialog.js +15 -0
- package/es/api/biz/util/openSingleWebview.d.ts +23 -0
- package/es/api/biz/util/openSingleWebview.js +15 -0
- package/es/api/biz/util/openSlidePanel.d.ts +11 -0
- package/es/api/biz/util/openSlidePanel.js +15 -0
- package/es/api/biz/util/openTalYoungToTopic.d.ts +6 -0
- package/es/api/biz/util/openTalYoungToTopic.js +15 -0
- package/es/api/biz/util/openTogetherEyeWebview.d.ts +11 -0
- package/es/api/biz/util/openTogetherEyeWebview.js +23 -0
- package/es/api/biz/util/openUserSchedule.d.ts +11 -0
- package/es/api/biz/util/openUserSchedule.js +23 -0
- package/es/api/biz/util/openVideoPlayer.d.ts +27 -0
- package/es/api/biz/util/openVideoPlayer.js +23 -0
- package/es/api/biz/util/previewFile.d.ts +11 -0
- package/es/api/biz/util/previewFile.js +8 -0
- package/es/api/biz/util/previewImage.d.ts +9 -0
- package/es/api/biz/util/previewImage.js +8 -0
- package/es/api/biz/util/proxy.d.ts +13 -0
- package/es/api/biz/util/proxy.js +8 -0
- package/es/api/biz/util/pushWorkMsg.d.ts +10 -0
- package/es/api/biz/util/pushWorkMsg.js +15 -0
- package/es/api/biz/util/remind.d.ts +15 -0
- package/es/api/biz/util/remind.js +23 -0
- package/es/api/biz/util/rouseApp.d.ts +12 -0
- package/es/api/biz/util/rouseApp.js +15 -0
- package/es/api/biz/util/savePic.d.ts +8 -0
- package/es/api/biz/util/savePic.js +19 -0
- package/es/api/biz/util/scan.d.ts +11 -0
- package/es/api/biz/util/scan.js +19 -0
- package/es/api/biz/util/selectDepartment.d.ts +9 -0
- package/es/api/biz/util/selectDepartment.js +8 -0
- package/es/api/biz/util/share.d.ts +12 -0
- package/es/api/biz/util/share.js +19 -0
- package/es/api/biz/util/takePicture.d.ts +13 -0
- package/es/api/biz/util/takePicture.js +8 -0
- package/es/api/biz/util/uploadAttachment.d.ts +55 -0
- package/es/api/biz/util/uploadAttachment.js +8 -0
- package/es/api/biz/util/yachEvent.d.ts +12 -0
- package/es/api/biz/util/yachEvent.js +27 -0
- package/es/api/biz/util/zfbAuth.d.ts +10 -0
- package/es/api/biz/util/zfbAuth.js +19 -0
- package/es/api/biz/webViewMessage/send.d.ts +7 -0
- package/es/api/biz/webViewMessage/send.js +15 -0
- package/es/api/common.typings.d.ts +9 -0
- package/es/api/common.typings.js +0 -0
- package/es/api/device/audio/download.d.ts +8 -0
- package/es/api/device/audio/download.js +19 -0
- package/es/api/device/audio/onPlayEnd.d.ts +7 -0
- package/es/api/device/audio/onPlayEnd.js +19 -0
- package/es/api/device/audio/onRecordEnd.d.ts +7 -0
- package/es/api/device/audio/onRecordEnd.js +19 -0
- package/es/api/device/audio/onRecordEnd_v2.d.ts +7 -0
- package/es/api/device/audio/onRecordEnd_v2.js +19 -0
- package/es/api/device/audio/pause.d.ts +8 -0
- package/es/api/device/audio/pause.js +19 -0
- package/es/api/device/audio/play.d.ts +8 -0
- package/es/api/device/audio/play.js +19 -0
- package/es/api/device/audio/resume.d.ts +8 -0
- package/es/api/device/audio/resume.js +19 -0
- package/es/api/device/audio/startRecord.d.ts +8 -0
- package/es/api/device/audio/startRecord.js +19 -0
- package/es/api/device/audio/startRecord_v2.d.ts +8 -0
- package/es/api/device/audio/startRecord_v2.js +19 -0
- package/es/api/device/audio/stop.d.ts +8 -0
- package/es/api/device/audio/stop.js +19 -0
- package/es/api/device/audio/stopRecord.d.ts +7 -0
- package/es/api/device/audio/stopRecord.js +19 -0
- package/es/api/device/audio/stopRecord_v2.d.ts +7 -0
- package/es/api/device/audio/stopRecord_v2.js +19 -0
- package/es/api/device/base/checkStepPermission.d.ts +8 -0
- package/es/api/device/base/checkStepPermission.js +19 -0
- package/es/api/device/base/getPhoneInfo.d.ts +16 -0
- package/es/api/device/base/getPhoneInfo.js +19 -0
- package/es/api/device/base/getUUID.d.ts +10 -0
- package/es/api/device/base/getUUID.js +23 -0
- package/es/api/device/connection/getNetworkType.d.ts +10 -0
- package/es/api/device/connection/getNetworkType.js +19 -0
- package/es/api/device/connection/isAtTal.d.ts +10 -0
- package/es/api/device/connection/isAtTal.js +21 -0
- package/es/api/device/geolocation/get.d.ts +42 -0
- package/es/api/device/geolocation/get.js +19 -0
- package/es/api/device/geolocation/getSwitch.d.ts +10 -0
- package/es/api/device/geolocation/getSwitch.js +15 -0
- package/es/api/device/notification/actionSheet.d.ts +15 -0
- package/es/api/device/notification/actionSheet.js +19 -0
- package/es/api/device/notification/alert.d.ts +13 -0
- package/es/api/device/notification/alert.js +23 -0
- package/es/api/device/notification/confirm.d.ts +16 -0
- package/es/api/device/notification/confirm.js +23 -0
- package/es/api/device/notification/hidePreloader.d.ts +7 -0
- package/es/api/device/notification/hidePreloader.js +19 -0
- package/es/api/device/notification/showPreloader.d.ts +9 -0
- package/es/api/device/notification/showPreloader.js +19 -0
- package/es/api/device/notification/toast.d.ts +15 -0
- package/es/api/device/notification/toast.js +8 -0
- package/es/api/device/notification/vibrate.d.ts +8 -0
- package/es/api/device/notification/vibrate.js +19 -0
- package/es/api/device/system/getLang.d.ts +10 -0
- package/es/api/device/system/getLang.js +8 -0
- package/es/api/device/system/setLight.d.ts +8 -0
- package/es/api/device/system/setLight.js +19 -0
- package/es/api/initAPI.d.ts +6 -0
- package/es/api/initAPI.js +22 -0
- package/es/api/primary/createTab.d.ts +13 -0
- package/es/api/primary/createTab.js +15 -0
- package/es/api/primary/exitFullScreen.d.ts +7 -0
- package/es/api/primary/exitFullScreen.js +15 -0
- package/es/api/primary/fullScreen.d.ts +7 -0
- package/es/api/primary/fullScreen.js +15 -0
- package/es/api/primary/weeklyShare.d.ts +13 -0
- package/es/api/primary/weeklyShare.js +15 -0
- package/es/api/runtime/permission/requestAuthCode.d.ts +12 -0
- package/es/api/runtime/permission/requestAuthCode.js +8 -0
- package/es/api/ui/pullToRefresh/disable.d.ts +7 -0
- package/es/api/ui/pullToRefresh/disable.js +19 -0
- package/es/api/ui/pullToRefresh/enable.d.ts +7 -0
- package/es/api/ui/pullToRefresh/enable.js +19 -0
- package/es/api/ui/pullToRefresh/stop.d.ts +7 -0
- package/es/api/ui/pullToRefresh/stop.js +19 -0
- package/es/api/ui/webViewBounce/disable.d.ts +7 -0
- package/es/api/ui/webViewBounce/disable.js +15 -0
- package/es/api/util/domainStorage/getItem.d.ts +12 -0
- package/es/api/util/domainStorage/getItem.js +19 -0
- package/es/api/util/domainStorage/removeItem.d.ts +9 -0
- package/es/api/util/domainStorage/removeItem.js +19 -0
- package/es/api/util/domainStorage/setItem.d.ts +11 -0
- package/es/api/util/domainStorage/setItem.js +19 -0
- package/es/api/util/tool/flushLog.d.ts +7 -0
- package/es/api/util/tool/flushLog.js +15 -0
- package/es/api/util/tool/log.d.ts +9 -0
- package/es/api/util/tool/log.js +15 -0
- package/es/index.d.ts +311 -0
- package/es/index.js +327 -0
- package/es/lib/bridge/index.d.ts +2 -0
- package/es/lib/bridge/index.js +2 -0
- package/es/lib/bridge/mobile.d.ts +13 -0
- package/es/lib/bridge/mobile.js +169 -0
- package/es/lib/bridge/pc.d.ts +4 -0
- package/es/lib/bridge/pc.js +81 -0
- package/es/lib/helper/apiHelper.d.ts +2 -0
- package/es/lib/helper/apiHelper.js +8 -0
- package/es/lib/helper/codeMap.d.ts +2 -0
- package/es/lib/helper/codeMap.js +6 -0
- package/es/lib/helper/event.d.ts +9 -0
- package/es/lib/helper/event.js +40 -0
- package/es/lib/helper/pcIframe.d.ts +44 -0
- package/es/lib/helper/pcIframe.js +148 -0
- package/es/lib/index.d.ts +4 -0
- package/es/lib/index.js +78 -0
- package/es/lib/sdk/index.d.ts +19 -0
- package/es/lib/sdk/index.js +170 -0
- package/es/lib/sdk/sdk.typings.d.ts +85 -0
- package/es/lib/sdk/sdk.typings.js +7 -0
- package/es/utils/bpitLog.d.ts +16 -0
- package/es/utils/bpitLog.js +62 -0
- package/es/utils/compareVersions.d.ts +58 -0
- package/es/utils/compareVersions.js +165 -0
- package/es/utils/console.d.ts +4 -0
- package/es/utils/console.js +44 -0
- package/es/utils/env.d.ts +3 -0
- package/es/utils/env.js +45 -0
- package/es/utils/index.d.ts +4 -0
- package/es/utils/index.js +20 -0
- package/libs/api/app/custom/talYoungFilesUpload.d.ts +38 -0
- package/libs/api/app/custom/talYoungFilesUpload.js +24 -0
- package/libs/api/biz/chat/chooseConversationByCorpId.d.ts +36 -0
- package/libs/api/biz/chat/chooseConversationByCorpId.js +15 -0
- package/libs/api/biz/chat/openSingleChat.d.ts +10 -0
- package/libs/api/biz/chat/openSingleChat.js +15 -0
- package/libs/api/biz/chat/openSquad.d.ts +8 -0
- package/libs/api/biz/chat/openSquad.js +15 -0
- package/libs/api/biz/chat/openTeamChat.d.ts +10 -0
- package/libs/api/biz/chat/openTeamChat.js +15 -0
- package/libs/api/biz/chat/pickConversation.d.ts +19 -0
- package/libs/api/biz/chat/pickConversation.js +26 -0
- package/libs/api/biz/chat/sendP2PMsg.d.ts +10 -0
- package/libs/api/biz/chat/sendP2PMsg.js +15 -0
- package/libs/api/biz/contact/complexPicker.d.ts +62 -0
- package/libs/api/biz/contact/complexPicker.js +15 -0
- package/libs/api/biz/contact/departmentsPicker.d.ts +35 -0
- package/libs/api/biz/contact/departmentsPicker.js +15 -0
- package/libs/api/biz/group/groupComplexPicker.d.ts +33 -0
- package/libs/api/biz/group/groupComplexPicker.js +15 -0
- package/libs/api/biz/map/multipointView.d.ts +21 -0
- package/libs/api/biz/map/multipointView.js +26 -0
- package/libs/api/biz/map/view.d.ts +13 -0
- package/libs/api/biz/map/view.js +26 -0
- package/libs/api/biz/navigation/close.d.ts +7 -0
- package/libs/api/biz/navigation/close.js +16 -0
- package/libs/api/biz/navigation/goBack.d.ts +7 -0
- package/libs/api/biz/navigation/goBack.js +26 -0
- package/libs/api/biz/navigation/quit.d.ts +8 -0
- package/libs/api/biz/navigation/quit.js +22 -0
- package/libs/api/biz/navigation/replace.d.ts +8 -0
- package/libs/api/biz/navigation/replace.js +15 -0
- package/libs/api/biz/navigation/setIcon.d.ts +12 -0
- package/libs/api/biz/navigation/setIcon.js +34 -0
- package/libs/api/biz/navigation/setLeft.d.ts +9 -0
- package/libs/api/biz/navigation/setLeft.js +38 -0
- package/libs/api/biz/navigation/setMenu.d.ts +20 -0
- package/libs/api/biz/navigation/setMenu.js +32 -0
- package/libs/api/biz/navigation/setPanGestureEnable.d.ts +9 -0
- package/libs/api/biz/navigation/setPanGestureEnable.js +33 -0
- package/libs/api/biz/navigation/setRight.d.ts +13 -0
- package/libs/api/biz/navigation/setRight.js +38 -0
- package/libs/api/biz/navigation/setTitle.d.ts +11 -0
- package/libs/api/biz/navigation/setTitle.js +15 -0
- package/libs/api/biz/navigation/setTitleExpandIcon.d.ts +9 -0
- package/libs/api/biz/navigation/setTitleExpandIcon.js +32 -0
- package/libs/api/biz/navigation/setWindowBig.d.ts +9 -0
- package/libs/api/biz/navigation/setWindowBig.js +24 -0
- package/libs/api/biz/navigation/tencentMeeting.d.ts +22 -0
- package/libs/api/biz/navigation/tencentMeeting.js +15 -0
- package/libs/api/biz/navigation/tencentMeetingBegin.d.ts +7 -0
- package/libs/api/biz/navigation/tencentMeetingBegin.js +15 -0
- package/libs/api/biz/navigation/updateExpandTitle.d.ts +8 -0
- package/libs/api/biz/navigation/updateExpandTitle.js +15 -0
- package/libs/api/biz/telephone/call.d.ts +9 -0
- package/libs/api/biz/telephone/call.js +26 -0
- package/libs/api/biz/telephone/showCallMenu.d.ts +12 -0
- package/libs/api/biz/telephone/showCallMenu.js +26 -0
- package/libs/api/biz/util/assistantCreate.d.ts +11 -0
- package/libs/api/biz/util/assistantCreate.js +30 -0
- package/libs/api/biz/util/authFinish.d.ts +11 -0
- package/libs/api/biz/util/authFinish.js +26 -0
- package/libs/api/biz/util/authStart.d.ts +9 -0
- package/libs/api/biz/util/authStart.js +26 -0
- package/libs/api/biz/util/chosen.d.ts +15 -0
- package/libs/api/biz/util/chosen.js +26 -0
- package/libs/api/biz/util/clipboardFileUpload.d.ts +7 -0
- package/libs/api/biz/util/clipboardFileUpload.js +15 -0
- package/libs/api/biz/util/closeWindow.d.ts +8 -0
- package/libs/api/biz/util/closeWindow.js +22 -0
- package/libs/api/biz/util/complain.d.ts +12 -0
- package/libs/api/biz/util/complain.js +15 -0
- package/libs/api/biz/util/createModifySchedule.d.ts +26 -0
- package/libs/api/biz/util/createModifySchedule.js +22 -0
- package/libs/api/biz/util/datepicker.d.ts +14 -0
- package/libs/api/biz/util/datepicker.js +26 -0
- package/libs/api/biz/util/datetimepicker.d.ts +14 -0
- package/libs/api/biz/util/datetimepicker.js +26 -0
- package/libs/api/biz/util/disableScreenCapture.d.ts +8 -0
- package/libs/api/biz/util/disableScreenCapture.js +26 -0
- package/libs/api/biz/util/downloadFile.d.ts +9 -0
- package/libs/api/biz/util/downloadFile.js +15 -0
- package/libs/api/biz/util/entergroupCheck.d.ts +10 -0
- package/libs/api/biz/util/entergroupCheck.js +30 -0
- package/libs/api/biz/util/externalLinkPreviewFile.d.ts +11 -0
- package/libs/api/biz/util/externalLinkPreviewFile.js +15 -0
- package/libs/api/biz/util/feedback.d.ts +11 -0
- package/libs/api/biz/util/feedback.js +15 -0
- package/libs/api/biz/util/getSingleWebviewData.d.ts +8 -0
- package/libs/api/biz/util/getSingleWebviewData.js +15 -0
- package/libs/api/biz/util/getTogetherConfig.d.ts +11 -0
- package/libs/api/biz/util/getTogetherConfig.js +30 -0
- package/libs/api/biz/util/getToken.d.ts +11 -0
- package/libs/api/biz/util/getToken.js +26 -0
- package/libs/api/biz/util/injectScript.d.ts +9 -0
- package/libs/api/biz/util/injectScript.js +15 -0
- package/libs/api/biz/util/invoice.d.ts +12 -0
- package/libs/api/biz/util/invoice.js +23 -0
- package/libs/api/biz/util/mediaFileUpload.d.ts +26 -0
- package/libs/api/biz/util/mediaFileUpload.js +23 -0
- package/libs/api/biz/util/onlineDocmentOpenTeamChat.d.ts +10 -0
- package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +30 -0
- package/libs/api/biz/util/open.d.ts +9 -0
- package/libs/api/biz/util/open.js +15 -0
- package/libs/api/biz/util/openLink.d.ts +8 -0
- package/libs/api/biz/util/openLink.js +15 -0
- package/libs/api/biz/util/openMediaFileDialog.d.ts +23 -0
- package/libs/api/biz/util/openMediaFileDialog.js +23 -0
- package/libs/api/biz/util/openSingleWebview.d.ts +23 -0
- package/libs/api/biz/util/openSingleWebview.js +22 -0
- package/libs/api/biz/util/openSlidePanel.d.ts +11 -0
- package/libs/api/biz/util/openSlidePanel.js +22 -0
- package/libs/api/biz/util/openTalYoungToTopic.d.ts +6 -0
- package/libs/api/biz/util/openTalYoungToTopic.js +23 -0
- package/libs/api/biz/util/openTogetherEyeWebview.d.ts +11 -0
- package/libs/api/biz/util/openTogetherEyeWebview.js +30 -0
- package/libs/api/biz/util/openUserSchedule.d.ts +11 -0
- package/libs/api/biz/util/openUserSchedule.js +30 -0
- package/libs/api/biz/util/openVideoPlayer.d.ts +27 -0
- package/libs/api/biz/util/openVideoPlayer.js +30 -0
- package/libs/api/biz/util/previewFile.d.ts +11 -0
- package/libs/api/biz/util/previewFile.js +15 -0
- package/libs/api/biz/util/previewImage.d.ts +9 -0
- package/libs/api/biz/util/previewImage.js +15 -0
- package/libs/api/biz/util/proxy.d.ts +13 -0
- package/libs/api/biz/util/proxy.js +15 -0
- package/libs/api/biz/util/pushWorkMsg.d.ts +10 -0
- package/libs/api/biz/util/pushWorkMsg.js +23 -0
- package/libs/api/biz/util/remind.d.ts +15 -0
- package/libs/api/biz/util/remind.js +30 -0
- package/libs/api/biz/util/rouseApp.d.ts +12 -0
- package/libs/api/biz/util/rouseApp.js +23 -0
- package/libs/api/biz/util/savePic.d.ts +8 -0
- package/libs/api/biz/util/savePic.js +26 -0
- package/libs/api/biz/util/scan.d.ts +11 -0
- package/libs/api/biz/util/scan.js +26 -0
- package/libs/api/biz/util/selectDepartment.d.ts +9 -0
- package/libs/api/biz/util/selectDepartment.js +15 -0
- package/libs/api/biz/util/share.d.ts +12 -0
- package/libs/api/biz/util/share.js +26 -0
- package/libs/api/biz/util/takePicture.d.ts +13 -0
- package/libs/api/biz/util/takePicture.js +15 -0
- package/libs/api/biz/util/uploadAttachment.d.ts +55 -0
- package/libs/api/biz/util/uploadAttachment.js +15 -0
- package/libs/api/biz/util/yachEvent.d.ts +12 -0
- package/libs/api/biz/util/yachEvent.js +34 -0
- package/libs/api/biz/util/zfbAuth.d.ts +10 -0
- package/libs/api/biz/util/zfbAuth.js +26 -0
- package/libs/api/biz/webViewMessage/send.d.ts +7 -0
- package/libs/api/biz/webViewMessage/send.js +22 -0
- package/libs/api/common.typings.d.ts +9 -0
- package/libs/api/common.typings.js +1 -0
- package/libs/api/device/audio/download.d.ts +8 -0
- package/libs/api/device/audio/download.js +26 -0
- package/libs/api/device/audio/onPlayEnd.d.ts +7 -0
- package/libs/api/device/audio/onPlayEnd.js +26 -0
- package/libs/api/device/audio/onRecordEnd.d.ts +7 -0
- package/libs/api/device/audio/onRecordEnd.js +26 -0
- package/libs/api/device/audio/onRecordEnd_v2.d.ts +7 -0
- package/libs/api/device/audio/onRecordEnd_v2.js +26 -0
- package/libs/api/device/audio/pause.d.ts +8 -0
- package/libs/api/device/audio/pause.js +26 -0
- package/libs/api/device/audio/play.d.ts +8 -0
- package/libs/api/device/audio/play.js +26 -0
- package/libs/api/device/audio/resume.d.ts +8 -0
- package/libs/api/device/audio/resume.js +26 -0
- package/libs/api/device/audio/startRecord.d.ts +8 -0
- package/libs/api/device/audio/startRecord.js +26 -0
- package/libs/api/device/audio/startRecord_v2.d.ts +8 -0
- package/libs/api/device/audio/startRecord_v2.js +26 -0
- package/libs/api/device/audio/stop.d.ts +8 -0
- package/libs/api/device/audio/stop.js +26 -0
- package/libs/api/device/audio/stopRecord.d.ts +7 -0
- package/libs/api/device/audio/stopRecord.js +26 -0
- package/libs/api/device/audio/stopRecord_v2.d.ts +7 -0
- package/libs/api/device/audio/stopRecord_v2.js +26 -0
- package/libs/api/device/base/checkStepPermission.d.ts +8 -0
- package/libs/api/device/base/checkStepPermission.js +26 -0
- package/libs/api/device/base/getPhoneInfo.d.ts +16 -0
- package/libs/api/device/base/getPhoneInfo.js +26 -0
- package/libs/api/device/base/getUUID.d.ts +10 -0
- package/libs/api/device/base/getUUID.js +30 -0
- package/libs/api/device/connection/getNetworkType.d.ts +10 -0
- package/libs/api/device/connection/getNetworkType.js +26 -0
- package/libs/api/device/connection/isAtTal.d.ts +10 -0
- package/libs/api/device/connection/isAtTal.js +28 -0
- package/libs/api/device/geolocation/get.d.ts +42 -0
- package/libs/api/device/geolocation/get.js +26 -0
- package/libs/api/device/geolocation/getSwitch.d.ts +10 -0
- package/libs/api/device/geolocation/getSwitch.js +22 -0
- package/libs/api/device/notification/actionSheet.d.ts +15 -0
- package/libs/api/device/notification/actionSheet.js +26 -0
- package/libs/api/device/notification/alert.d.ts +13 -0
- package/libs/api/device/notification/alert.js +30 -0
- package/libs/api/device/notification/confirm.d.ts +16 -0
- package/libs/api/device/notification/confirm.js +30 -0
- package/libs/api/device/notification/hidePreloader.d.ts +7 -0
- package/libs/api/device/notification/hidePreloader.js +26 -0
- package/libs/api/device/notification/showPreloader.d.ts +9 -0
- package/libs/api/device/notification/showPreloader.js +26 -0
- package/libs/api/device/notification/toast.d.ts +15 -0
- package/libs/api/device/notification/toast.js +15 -0
- package/libs/api/device/notification/vibrate.d.ts +8 -0
- package/libs/api/device/notification/vibrate.js +26 -0
- package/libs/api/device/system/getLang.d.ts +10 -0
- package/libs/api/device/system/getLang.js +15 -0
- package/libs/api/device/system/setLight.d.ts +8 -0
- package/libs/api/device/system/setLight.js +26 -0
- package/libs/api/initAPI.d.ts +6 -0
- package/libs/api/initAPI.js +29 -0
- package/libs/api/primary/createTab.d.ts +13 -0
- package/libs/api/primary/createTab.js +22 -0
- package/libs/api/primary/exitFullScreen.d.ts +7 -0
- package/libs/api/primary/exitFullScreen.js +22 -0
- package/libs/api/primary/fullScreen.d.ts +7 -0
- package/libs/api/primary/fullScreen.js +22 -0
- package/libs/api/primary/weeklyShare.d.ts +13 -0
- package/libs/api/primary/weeklyShare.js +22 -0
- package/libs/api/runtime/permission/requestAuthCode.d.ts +12 -0
- package/libs/api/runtime/permission/requestAuthCode.js +15 -0
- package/libs/api/ui/pullToRefresh/disable.d.ts +7 -0
- package/libs/api/ui/pullToRefresh/disable.js +26 -0
- package/libs/api/ui/pullToRefresh/enable.d.ts +7 -0
- package/libs/api/ui/pullToRefresh/enable.js +26 -0
- package/libs/api/ui/pullToRefresh/stop.d.ts +7 -0
- package/libs/api/ui/pullToRefresh/stop.js +26 -0
- package/libs/api/ui/webViewBounce/disable.d.ts +7 -0
- package/libs/api/ui/webViewBounce/disable.js +22 -0
- package/libs/api/util/domainStorage/getItem.d.ts +12 -0
- package/libs/api/util/domainStorage/getItem.js +26 -0
- package/libs/api/util/domainStorage/removeItem.d.ts +9 -0
- package/libs/api/util/domainStorage/removeItem.js +26 -0
- package/libs/api/util/domainStorage/setItem.d.ts +11 -0
- package/libs/api/util/domainStorage/setItem.js +26 -0
- package/libs/api/util/tool/flushLog.d.ts +7 -0
- package/libs/api/util/tool/flushLog.js +22 -0
- package/libs/api/util/tool/log.d.ts +9 -0
- package/libs/api/util/tool/log.js +22 -0
- package/libs/index.d.ts +311 -0
- package/libs/index.js +1042 -0
- package/libs/lib/bridge/index.d.ts +2 -0
- package/libs/lib/bridge/index.js +32 -0
- package/libs/lib/bridge/mobile.d.ts +13 -0
- package/libs/lib/bridge/mobile.js +175 -0
- package/libs/lib/bridge/pc.d.ts +4 -0
- package/libs/lib/bridge/pc.js +87 -0
- package/libs/lib/helper/apiHelper.d.ts +2 -0
- package/libs/lib/helper/apiHelper.js +15 -0
- package/libs/lib/helper/codeMap.d.ts +2 -0
- package/libs/lib/helper/codeMap.js +13 -0
- package/libs/lib/helper/event.d.ts +9 -0
- package/libs/lib/helper/event.js +48 -0
- package/libs/lib/helper/pcIframe.d.ts +44 -0
- package/libs/lib/helper/pcIframe.js +156 -0
- package/libs/lib/index.d.ts +4 -0
- package/libs/lib/index.js +86 -0
- package/libs/lib/sdk/index.d.ts +19 -0
- package/libs/lib/sdk/index.js +178 -0
- package/libs/lib/sdk/sdk.typings.d.ts +85 -0
- package/libs/lib/sdk/sdk.typings.js +14 -0
- package/libs/utils/bpitLog.d.ts +16 -0
- package/libs/utils/bpitLog.js +69 -0
- package/libs/utils/compareVersions.d.ts +58 -0
- package/libs/utils/compareVersions.js +173 -0
- package/libs/utils/console.d.ts +4 -0
- package/libs/utils/console.js +53 -0
- package/libs/utils/env.d.ts +3 -0
- package/libs/utils/env.js +51 -0
- package/libs/utils/index.d.ts +4 -0
- package/libs/utils/index.js +51 -0
- package/package.json +1 -1
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
import Event from '../helper/event';
|
|
7
|
+
import { electronResCodeMap } from '../helper/codeMap';
|
|
8
|
+
import { log, bpitLog } from '../../utils';
|
|
9
|
+
function setupWebViewJavascriptBridge(callback) {
|
|
10
|
+
if (window.WebViewJavascriptBridge) {
|
|
11
|
+
return callback(WebViewJavascriptBridge);
|
|
12
|
+
}
|
|
13
|
+
if (window.WKWebViewJavascriptBridge) {
|
|
14
|
+
return callback(WKWebViewJavascriptBridge);
|
|
15
|
+
}
|
|
16
|
+
if (window.WVJBCallbacks) {
|
|
17
|
+
return window.WVJBCallbacks.push(callback);
|
|
18
|
+
}
|
|
19
|
+
window.WVJBCallbacks = [callback];
|
|
20
|
+
var WVJBIframe = document.createElement('iframe');
|
|
21
|
+
WVJBIframe.style.display = 'none';
|
|
22
|
+
WVJBIframe.src = 'https://__bridge_loaded__';
|
|
23
|
+
document.documentElement.appendChild(WVJBIframe);
|
|
24
|
+
_setTimeout(function () {
|
|
25
|
+
document.documentElement.removeChild(WVJBIframe);
|
|
26
|
+
}, 0);
|
|
27
|
+
}
|
|
28
|
+
var mobileBridgeInit = function mobileBridgeInit() {
|
|
29
|
+
return new _Promise(function (resolve, reject) {
|
|
30
|
+
setupWebViewJavascriptBridge(function (bridge) {
|
|
31
|
+
log("\u6CE8\u518Cresume\u4E8B\u4EF6 ");
|
|
32
|
+
bridge.registerHandler('resume', function (resData) {
|
|
33
|
+
log("resume\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
34
|
+
resData: resData
|
|
35
|
+
});
|
|
36
|
+
Event.execEvent('resume', resData);
|
|
37
|
+
});
|
|
38
|
+
log("\u6CE8\u518CunreadMsgAction\u4E8B\u4EF6 ");
|
|
39
|
+
bridge.registerHandler('unreadMsgAction', function (resData) {
|
|
40
|
+
log("unreadMsgAction\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
41
|
+
resData: resData
|
|
42
|
+
});
|
|
43
|
+
Event.execEvent('unreadMsgAction', resData);
|
|
44
|
+
});
|
|
45
|
+
log("\u6CE8\u518CwebViewMsgReceive\u4E8B\u4EF6 ");
|
|
46
|
+
bridge.registerHandler('webViewMsgReceive', function (resData) {
|
|
47
|
+
log("webViewMsgReceive\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
48
|
+
resData: resData
|
|
49
|
+
});
|
|
50
|
+
Event.execEvent('webViewMsgReceive', resData);
|
|
51
|
+
});
|
|
52
|
+
bridge.registerHandler('pushWorkMsg', function (resData) {
|
|
53
|
+
log("pushWorkMsg\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
54
|
+
resData: resData
|
|
55
|
+
});
|
|
56
|
+
Event.execEvent('pushWorkMsg', resData);
|
|
57
|
+
});
|
|
58
|
+
bridge.registerHandler('getTogetherCallback', function (resData) {
|
|
59
|
+
log("getTogetherCallback\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
60
|
+
resData: resData
|
|
61
|
+
});
|
|
62
|
+
Event.execEvent('getTogetherCallback', resData);
|
|
63
|
+
});
|
|
64
|
+
bridge.registerHandler('sendMsgCommon', function (resData) {
|
|
65
|
+
log("sendMsgCommon ", {
|
|
66
|
+
resData: resData
|
|
67
|
+
});
|
|
68
|
+
Event.execEvent('sendMsgCommon', resData);
|
|
69
|
+
});
|
|
70
|
+
resolve();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
var mobileBridge = function mobileBridge(method, param) {
|
|
75
|
+
return new _Promise(function (resolve, reject) {
|
|
76
|
+
var p = _Object$assign({}, param);
|
|
77
|
+
setupWebViewJavascriptBridge(function (bridge) {
|
|
78
|
+
if (param.control) {
|
|
79
|
+
bridge.registerHandler(method, function (data) {
|
|
80
|
+
var onSuccess = param.onSuccess;
|
|
81
|
+
delete p.onSuccess;
|
|
82
|
+
if ('function' === typeof onSuccess) {
|
|
83
|
+
onSuccess(data);
|
|
84
|
+
resolve({
|
|
85
|
+
code: '0',
|
|
86
|
+
message: 'success'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
bridge.callHandler(method, param, function (e) {
|
|
92
|
+
var code = e.code,
|
|
93
|
+
message = e.message,
|
|
94
|
+
data = e.data;
|
|
95
|
+
var _code = _parseInt(code);
|
|
96
|
+
var callbackStr = electronResCodeMap(_code);
|
|
97
|
+
var callbackFun = p[callbackStr];
|
|
98
|
+
log("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
99
|
+
method: method,
|
|
100
|
+
param: param,
|
|
101
|
+
data: data,
|
|
102
|
+
_code: _code,
|
|
103
|
+
message: message,
|
|
104
|
+
callbackFun: callbackFun
|
|
105
|
+
});
|
|
106
|
+
// 请求失败
|
|
107
|
+
if (callbackStr === 'onFail') {
|
|
108
|
+
bpitLog({
|
|
109
|
+
method: method,
|
|
110
|
+
errorcode: _code,
|
|
111
|
+
message: message || _JSON$stringify(data) || 'SDK执行失败回调,相关参数'
|
|
112
|
+
});
|
|
113
|
+
if ('function' === typeof callbackFun) {
|
|
114
|
+
message ? callbackFun({
|
|
115
|
+
code: code,
|
|
116
|
+
message: message
|
|
117
|
+
}) : callbackFun(data);
|
|
118
|
+
}
|
|
119
|
+
reject({
|
|
120
|
+
_code: _code,
|
|
121
|
+
message: message,
|
|
122
|
+
data: data
|
|
123
|
+
});
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
// 请求成功
|
|
127
|
+
if ('function' === typeof callbackFun) {
|
|
128
|
+
callbackFun(data || message);
|
|
129
|
+
}
|
|
130
|
+
resolve({
|
|
131
|
+
_code: _code,
|
|
132
|
+
message: message,
|
|
133
|
+
data: data
|
|
134
|
+
});
|
|
135
|
+
// if (_code === -2 || _code === 7) {
|
|
136
|
+
// bpitLog({
|
|
137
|
+
// method,
|
|
138
|
+
// errorcode: _code,
|
|
139
|
+
// message: message || 'SDK执行失败回调,相关参数',
|
|
140
|
+
// });
|
|
141
|
+
// log(`SDK执行后回调,相关参数 `, {
|
|
142
|
+
// method,
|
|
143
|
+
// param,
|
|
144
|
+
// data,
|
|
145
|
+
// _code,
|
|
146
|
+
// message,
|
|
147
|
+
// });
|
|
148
|
+
// reject({_code, message});
|
|
149
|
+
// // return;
|
|
150
|
+
// }
|
|
151
|
+
// const callbackFun = p[callbackStr];
|
|
152
|
+
// log(`SDK执行后回调,相关参数 `, {
|
|
153
|
+
// method,
|
|
154
|
+
// param,
|
|
155
|
+
// data,
|
|
156
|
+
// _code,
|
|
157
|
+
// message,
|
|
158
|
+
// callbackFun,
|
|
159
|
+
// });
|
|
160
|
+
// if ('function' === typeof callbackFun) {
|
|
161
|
+
// callbackFun(data || message);
|
|
162
|
+
// }
|
|
163
|
+
// resolve({_code, message, data});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export { mobileBridge, mobileBridgeInit };
|
|
@@ -0,0 +1,81 @@
|
|
|
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 PcIframe from '../helper/pcIframe';
|
|
5
|
+
import { electronResCodeMap } from '../helper/codeMap';
|
|
6
|
+
import { log, bpitLog } from '../../utils';
|
|
7
|
+
var PcBridgeInit = function PcBridgeInit() {
|
|
8
|
+
PcIframe.init();
|
|
9
|
+
};
|
|
10
|
+
var pcBridge = function pcBridge(method, param) {
|
|
11
|
+
return new _Promise(function (resolve, reject) {
|
|
12
|
+
return PcIframe.invokeAPI(method, param, function (_ref) {
|
|
13
|
+
var data = _ref.data,
|
|
14
|
+
code = _ref.code,
|
|
15
|
+
message = _ref.message;
|
|
16
|
+
var _code = _parseInt(code);
|
|
17
|
+
var callbackStr = electronResCodeMap(_code);
|
|
18
|
+
var callbackFun = param[callbackStr];
|
|
19
|
+
log("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
20
|
+
method: method,
|
|
21
|
+
param: param,
|
|
22
|
+
data: data,
|
|
23
|
+
_code: _code,
|
|
24
|
+
message: message,
|
|
25
|
+
callbackFun: callbackFun
|
|
26
|
+
});
|
|
27
|
+
// 请求失败
|
|
28
|
+
if (callbackStr === 'onFail') {
|
|
29
|
+
bpitLog({
|
|
30
|
+
method: method,
|
|
31
|
+
errorcode: _code,
|
|
32
|
+
message: message || _JSON$stringify(data) || 'SDK执行失败回调,相关参数'
|
|
33
|
+
});
|
|
34
|
+
if ('function' === typeof callbackFun) {
|
|
35
|
+
console.log('wenai-code', code, _code);
|
|
36
|
+
message ? callbackFun({
|
|
37
|
+
code: code,
|
|
38
|
+
message: message
|
|
39
|
+
}) : callbackFun(data);
|
|
40
|
+
}
|
|
41
|
+
reject({
|
|
42
|
+
_code: _code,
|
|
43
|
+
message: message,
|
|
44
|
+
data: data
|
|
45
|
+
});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// 请求成功
|
|
49
|
+
if ('function' === typeof callbackFun) {
|
|
50
|
+
callbackFun(data || message);
|
|
51
|
+
}
|
|
52
|
+
resolve({
|
|
53
|
+
_code: _code,
|
|
54
|
+
message: message,
|
|
55
|
+
data: data
|
|
56
|
+
});
|
|
57
|
+
// if (_code === -2) {
|
|
58
|
+
// bpitLog({
|
|
59
|
+
// method,
|
|
60
|
+
// errorcode: _code,
|
|
61
|
+
// message: message || 'SDK执行失败回调,相关参数',
|
|
62
|
+
// });
|
|
63
|
+
// }
|
|
64
|
+
// const callbackFun = param[callbackStr];
|
|
65
|
+
// log(`SDK执行后回调,相关参数 `, {
|
|
66
|
+
// method,
|
|
67
|
+
// param,
|
|
68
|
+
// data,
|
|
69
|
+
// _code,
|
|
70
|
+
// message,
|
|
71
|
+
// callbackFun
|
|
72
|
+
// });
|
|
73
|
+
// if ('function' === typeof callbackFun) {
|
|
74
|
+
// callbackFun(data || message);
|
|
75
|
+
// }
|
|
76
|
+
// resolve({ _code, message, data });
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export { pcBridge, PcBridgeInit };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _Map from "@babel/runtime-corejs3/core-js/map";
|
|
2
|
+
var resCodeMap = new _Map([[0, 'onSuccess'], [-1, 'onCancel'], [-2, 'onFail'], [-3, 'onProgress'], [-4, 'onSubmit']]);
|
|
3
|
+
function electronResCodeMap(code) {
|
|
4
|
+
return resCodeMap.get(code) || 'onFail';
|
|
5
|
+
}
|
|
6
|
+
export { electronResCodeMap };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
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
|
+
var _this = this;
|
|
9
|
+
_classCallCheck(this, Event);
|
|
10
|
+
this.on = function (event, fn) {
|
|
11
|
+
if (!event || 'function' !== typeof fn) throw 'eventName is null or handle is not a function, on fail';
|
|
12
|
+
if (!_Array$isArray(_this.eventsHandle[event])) _this.eventsHandle[event] = [];
|
|
13
|
+
_this.eventsHandle[event].push(fn);
|
|
14
|
+
};
|
|
15
|
+
this.off = function (event, fn) {
|
|
16
|
+
if (!event) throw 'eventName is null, invoke off fail';
|
|
17
|
+
if (!fn) {
|
|
18
|
+
_this.eventsHandle[event] = [];
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (_Array$isArray(_this.eventsHandle[event])) {
|
|
22
|
+
var _context, _context2;
|
|
23
|
+
var n = _indexOfInstanceProperty(_context = _this.eventsHandle[event]).call(_context, fn);
|
|
24
|
+
-1 !== n && _spliceInstanceProperty(_context2 = _this.eventsHandle[event]).call(_context2, n, 1);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.execEvent = function (event, data) {
|
|
28
|
+
var _context3;
|
|
29
|
+
_Array$isArray(this.eventsHandle[event]) && _forEachInstanceProperty(_context3 = this.eventsHandle[event]).call(_context3, function (fn) {
|
|
30
|
+
try {
|
|
31
|
+
fn(data);
|
|
32
|
+
} catch (t) {
|
|
33
|
+
console.error(data);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
this.eventsHandle = {};
|
|
38
|
+
});
|
|
39
|
+
var event = new Event();
|
|
40
|
+
export default event;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
sendToHost: any;
|
|
4
|
+
sendTo: any;
|
|
5
|
+
receiveBrowserViewData: any;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
interface APIParams {
|
|
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
|
+
}
|
|
31
|
+
declare class Frame {
|
|
32
|
+
pendingMsgs: {};
|
|
33
|
+
constructor();
|
|
34
|
+
addPending: (e: any) => void;
|
|
35
|
+
deletePending: (e: any) => void;
|
|
36
|
+
getPending: (t: any) => any;
|
|
37
|
+
invokeAPIInBrowserView: (payload: string) => void;
|
|
38
|
+
invokeAPIInWebview: (payload: string) => void;
|
|
39
|
+
invokeAPI: (method: string, param: any, callback: any) => GenPostMsg;
|
|
40
|
+
handleCallback: (datas: any, invokeType?: 'browserView' | '') => void;
|
|
41
|
+
init: () => void;
|
|
42
|
+
}
|
|
43
|
+
declare const frame: Frame;
|
|
44
|
+
export default frame;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
|
+
import _Date$now from "@babel/runtime-corejs3/core-js/date/now";
|
|
4
|
+
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
5
|
+
import { log } from '../../utils';
|
|
6
|
+
import Event from './event';
|
|
7
|
+
// 处理posmessage参数
|
|
8
|
+
var GenPostMsg = /*#__PURE__*/_createClass(function GenPostMsg(method, param, callback) {
|
|
9
|
+
var _this = this;
|
|
10
|
+
_classCallCheck(this, GenPostMsg);
|
|
11
|
+
this.genid = function () {
|
|
12
|
+
var idStr = _Date$now().toString(36);
|
|
13
|
+
idStr += Math.random().toString(36).substr(3);
|
|
14
|
+
return idStr;
|
|
15
|
+
};
|
|
16
|
+
this.receiveResponse = function (data) {
|
|
17
|
+
//this.PromiseObj.resolve(data);
|
|
18
|
+
_this.callback(data);
|
|
19
|
+
};
|
|
20
|
+
this.getPayload = function () {
|
|
21
|
+
return {
|
|
22
|
+
msgId: _this.id,
|
|
23
|
+
methodName: _this.methodName,
|
|
24
|
+
body: _this.plainMsg,
|
|
25
|
+
type: 'request',
|
|
26
|
+
invokeType: _this.invokeType
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
this.id = this.genid();
|
|
30
|
+
this.PromiseObj = {
|
|
31
|
+
resolve: null,
|
|
32
|
+
reject: null
|
|
33
|
+
};
|
|
34
|
+
this.methodName = method;
|
|
35
|
+
this.plainMsg = param;
|
|
36
|
+
this.invokeType = param === null || param === void 0 ? void 0 : param.invokeType;
|
|
37
|
+
this.callback = callback;
|
|
38
|
+
// this.result = new Promise(
|
|
39
|
+
// function (resolve, reject) {
|
|
40
|
+
// this.PromiseObj = {
|
|
41
|
+
// resolve,
|
|
42
|
+
// reject,
|
|
43
|
+
// };
|
|
44
|
+
// }.bind(this)
|
|
45
|
+
// );
|
|
46
|
+
});
|
|
47
|
+
var Frame = /*#__PURE__*/_createClass(function Frame() {
|
|
48
|
+
var _this2 = this;
|
|
49
|
+
_classCallCheck(this, Frame);
|
|
50
|
+
this.addPending = function (e) {
|
|
51
|
+
_this2.pendingMsgs[e.id] = e;
|
|
52
|
+
};
|
|
53
|
+
this.deletePending = function (e) {
|
|
54
|
+
delete _this2.pendingMsgs[e.id];
|
|
55
|
+
};
|
|
56
|
+
this.getPending = function (t) {
|
|
57
|
+
return this.pendingMsgs[t];
|
|
58
|
+
};
|
|
59
|
+
this.invokeAPIInBrowserView = function (payload) {
|
|
60
|
+
window.sendTo(payload);
|
|
61
|
+
};
|
|
62
|
+
this.invokeAPIInWebview = function (payload) {
|
|
63
|
+
window.sendToHost(payload);
|
|
64
|
+
};
|
|
65
|
+
this.invokeAPI = function (method, param, callback) {
|
|
66
|
+
var genPostMsg = new GenPostMsg(method, param, callback);
|
|
67
|
+
var payload = _JSON$stringify(genPostMsg.getPayload());
|
|
68
|
+
var _param$invokeType = param.invokeType,
|
|
69
|
+
invokeType = _param$invokeType === void 0 ? '' : _param$invokeType;
|
|
70
|
+
invokeType === 'browserView' ? _this2.invokeAPIInBrowserView(payload) : _this2.invokeAPIInWebview(payload);
|
|
71
|
+
_this2.addPending(genPostMsg);
|
|
72
|
+
return genPostMsg;
|
|
73
|
+
};
|
|
74
|
+
this.handleCallback = function (datas, invokeType) {
|
|
75
|
+
var type = datas.type,
|
|
76
|
+
methodName = datas.methodName,
|
|
77
|
+
eventName = datas.eventName,
|
|
78
|
+
msgId = datas.msgId,
|
|
79
|
+
data = datas.data,
|
|
80
|
+
code = datas.code,
|
|
81
|
+
message = datas.message;
|
|
82
|
+
if (type === 'request') {
|
|
83
|
+
// 壳子的调用
|
|
84
|
+
switch (methodName) {
|
|
85
|
+
case 'refresh':
|
|
86
|
+
window.location.reload();
|
|
87
|
+
break;
|
|
88
|
+
case 'back':
|
|
89
|
+
window.history.back();
|
|
90
|
+
break;
|
|
91
|
+
case 'forward':
|
|
92
|
+
window.history.forward();
|
|
93
|
+
break;
|
|
94
|
+
case 'event':
|
|
95
|
+
Event.execEvent(eventName, data);
|
|
96
|
+
break;
|
|
97
|
+
case 'zoomInClick':
|
|
98
|
+
var scrollTopVal = document.documentElement.scrollTop || document.body.scrollTop,
|
|
99
|
+
url = window.location.href;
|
|
100
|
+
if (invokeType === 'browserView') {
|
|
101
|
+
window.sendTo(_JSON$stringify({
|
|
102
|
+
type: type,
|
|
103
|
+
methodName: methodName,
|
|
104
|
+
body: {
|
|
105
|
+
scrollTopVal: scrollTopVal,
|
|
106
|
+
url: url,
|
|
107
|
+
title: data && data.title
|
|
108
|
+
}
|
|
109
|
+
}));
|
|
110
|
+
} else {
|
|
111
|
+
window.sendToHost(_JSON$stringify({
|
|
112
|
+
type: type,
|
|
113
|
+
methodName: methodName,
|
|
114
|
+
body: {
|
|
115
|
+
scrollTopVal: scrollTopVal,
|
|
116
|
+
url: url,
|
|
117
|
+
title: data && data.title
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
} else if (type === 'response') {
|
|
126
|
+
// 响应壳子的回调
|
|
127
|
+
var pending = _this2.getPending(msgId);
|
|
128
|
+
pending && pending.receiveResponse({
|
|
129
|
+
data: data,
|
|
130
|
+
code: code,
|
|
131
|
+
message: message || data.msg || data.message
|
|
132
|
+
});
|
|
133
|
+
code != -3 && _this2.deletePending(msgId);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
this.init = function () {
|
|
137
|
+
window.addEventListener('message', function (msg) {
|
|
138
|
+
log('electron res: ', msg);
|
|
139
|
+
_this2.handleCallback(msg.data || {});
|
|
140
|
+
});
|
|
141
|
+
window.receiveBrowserViewData && window.receiveBrowserViewData(function (e, response) {
|
|
142
|
+
return _this2.handleCallback(response);
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
this.pendingMsgs = {};
|
|
146
|
+
});
|
|
147
|
+
var frame = new Frame();
|
|
148
|
+
export default frame;
|
package/es/lib/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
2
|
+
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
3
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
6
|
+
resolve(value);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
return new (P || (P = _Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.next(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function rejected(value) {
|
|
18
|
+
try {
|
|
19
|
+
step(generator["throw"](value));
|
|
20
|
+
} catch (e) {
|
|
21
|
+
reject(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function step(result) {
|
|
25
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
26
|
+
}
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
import { getENV } from '../utils';
|
|
31
|
+
import Sdk from './sdk';
|
|
32
|
+
import { mobileBridge, mobileBridgeInit, PcBridgeInit, pcBridge } from './bridge';
|
|
33
|
+
import Event from './helper/event';
|
|
34
|
+
var env = getENV();
|
|
35
|
+
var platform = env.platform;
|
|
36
|
+
var yachSdk = new Sdk(env);
|
|
37
|
+
function initSdk() {
|
|
38
|
+
var _this = this;
|
|
39
|
+
var bridgeInit;
|
|
40
|
+
if (platform === 'pc') {
|
|
41
|
+
bridgeInit = function bridgeInit() {
|
|
42
|
+
return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
43
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
44
|
+
while (1) switch (_context.prev = _context.next) {
|
|
45
|
+
case 0:
|
|
46
|
+
PcBridgeInit();
|
|
47
|
+
return _context.abrupt("return", pcBridge);
|
|
48
|
+
case 2:
|
|
49
|
+
case "end":
|
|
50
|
+
return _context.stop();
|
|
51
|
+
}
|
|
52
|
+
}, _callee);
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
} else {
|
|
56
|
+
bridgeInit = function bridgeInit() {
|
|
57
|
+
return mobileBridgeInit().then(function () {
|
|
58
|
+
return mobileBridge;
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var config = {
|
|
63
|
+
platform: platform,
|
|
64
|
+
authMethod: 'config',
|
|
65
|
+
bridgeInit: bridgeInit,
|
|
66
|
+
event: {
|
|
67
|
+
on: function on(event, fn) {
|
|
68
|
+
Event.on(event, fn);
|
|
69
|
+
},
|
|
70
|
+
off: function off(event, fn) {
|
|
71
|
+
Event.off(event, fn);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
yachSdk.setPlatform(config);
|
|
76
|
+
}
|
|
77
|
+
initSdk();
|
|
78
|
+
export { yachSdk, initSdk };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IInvokeAPIConfigMap, IPlatformConfig, IENV, IUNCore } from './sdk.typings';
|
|
2
|
+
declare class Sdk {
|
|
3
|
+
private invokeAPIConfigMapByMethod;
|
|
4
|
+
private configJsApiList;
|
|
5
|
+
private platformConfigMap;
|
|
6
|
+
private hadConfig;
|
|
7
|
+
private env;
|
|
8
|
+
private bridgeInitFnPromise;
|
|
9
|
+
private cacheP;
|
|
10
|
+
private config$;
|
|
11
|
+
constructor(env: IENV);
|
|
12
|
+
exportSdk: IUNCore;
|
|
13
|
+
setAPI(method: string, config: IInvokeAPIConfigMap): void;
|
|
14
|
+
setPlatform(value: IPlatformConfig): void;
|
|
15
|
+
bridgeInitFn(): any;
|
|
16
|
+
_onFail(method: any, errorcode: any, message: any, onFail: any): void;
|
|
17
|
+
invokeAPI(method: string, params?: any): void;
|
|
18
|
+
}
|
|
19
|
+
export default Sdk;
|