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.
Files changed (542) hide show
  1. package/dist/yach_jssdk_4.3.3-beta1.js +1 -0
  2. package/es/api/app/custom/talYoungFilesUpload.d.ts +38 -0
  3. package/es/api/app/custom/talYoungFilesUpload.js +16 -0
  4. package/es/api/biz/chat/chooseConversationByCorpId.d.ts +36 -0
  5. package/es/api/biz/chat/chooseConversationByCorpId.js +8 -0
  6. package/es/api/biz/chat/openSingleChat.d.ts +10 -0
  7. package/es/api/biz/chat/openSingleChat.js +8 -0
  8. package/es/api/biz/chat/openSquad.d.ts +8 -0
  9. package/es/api/biz/chat/openSquad.js +8 -0
  10. package/es/api/biz/chat/openTeamChat.d.ts +10 -0
  11. package/es/api/biz/chat/openTeamChat.js +8 -0
  12. package/es/api/biz/chat/pickConversation.d.ts +19 -0
  13. package/es/api/biz/chat/pickConversation.js +19 -0
  14. package/es/api/biz/chat/sendP2PMsg.d.ts +10 -0
  15. package/es/api/biz/chat/sendP2PMsg.js +8 -0
  16. package/es/api/biz/contact/complexPicker.d.ts +62 -0
  17. package/es/api/biz/contact/complexPicker.js +8 -0
  18. package/es/api/biz/contact/departmentsPicker.d.ts +35 -0
  19. package/es/api/biz/contact/departmentsPicker.js +8 -0
  20. package/es/api/biz/group/groupComplexPicker.d.ts +33 -0
  21. package/es/api/biz/group/groupComplexPicker.js +8 -0
  22. package/es/api/biz/map/multipointView.d.ts +21 -0
  23. package/es/api/biz/map/multipointView.js +19 -0
  24. package/es/api/biz/map/view.d.ts +13 -0
  25. package/es/api/biz/map/view.js +19 -0
  26. package/es/api/biz/navigation/close.d.ts +7 -0
  27. package/es/api/biz/navigation/close.js +9 -0
  28. package/es/api/biz/navigation/goBack.d.ts +7 -0
  29. package/es/api/biz/navigation/goBack.js +19 -0
  30. package/es/api/biz/navigation/quit.d.ts +8 -0
  31. package/es/api/biz/navigation/quit.js +15 -0
  32. package/es/api/biz/navigation/replace.d.ts +8 -0
  33. package/es/api/biz/navigation/replace.js +8 -0
  34. package/es/api/biz/navigation/setIcon.d.ts +12 -0
  35. package/es/api/biz/navigation/setIcon.js +27 -0
  36. package/es/api/biz/navigation/setLeft.d.ts +9 -0
  37. package/es/api/biz/navigation/setLeft.js +31 -0
  38. package/es/api/biz/navigation/setMenu.d.ts +20 -0
  39. package/es/api/biz/navigation/setMenu.js +25 -0
  40. package/es/api/biz/navigation/setPanGestureEnable.d.ts +9 -0
  41. package/es/api/biz/navigation/setPanGestureEnable.js +26 -0
  42. package/es/api/biz/navigation/setRight.d.ts +13 -0
  43. package/es/api/biz/navigation/setRight.js +31 -0
  44. package/es/api/biz/navigation/setTitle.d.ts +11 -0
  45. package/es/api/biz/navigation/setTitle.js +8 -0
  46. package/es/api/biz/navigation/setTitleExpandIcon.d.ts +9 -0
  47. package/es/api/biz/navigation/setTitleExpandIcon.js +25 -0
  48. package/es/api/biz/navigation/setWindowBig.d.ts +9 -0
  49. package/es/api/biz/navigation/setWindowBig.js +16 -0
  50. package/es/api/biz/navigation/tencentMeeting.d.ts +22 -0
  51. package/es/api/biz/navigation/tencentMeeting.js +8 -0
  52. package/es/api/biz/navigation/tencentMeetingBegin.d.ts +7 -0
  53. package/es/api/biz/navigation/tencentMeetingBegin.js +8 -0
  54. package/es/api/biz/navigation/updateExpandTitle.d.ts +8 -0
  55. package/es/api/biz/navigation/updateExpandTitle.js +8 -0
  56. package/es/api/biz/telephone/call.d.ts +9 -0
  57. package/es/api/biz/telephone/call.js +19 -0
  58. package/es/api/biz/telephone/showCallMenu.d.ts +12 -0
  59. package/es/api/biz/telephone/showCallMenu.js +19 -0
  60. package/es/api/biz/util/assistantCreate.d.ts +11 -0
  61. package/es/api/biz/util/assistantCreate.js +23 -0
  62. package/es/api/biz/util/authFinish.d.ts +11 -0
  63. package/es/api/biz/util/authFinish.js +19 -0
  64. package/es/api/biz/util/authStart.d.ts +9 -0
  65. package/es/api/biz/util/authStart.js +19 -0
  66. package/es/api/biz/util/chosen.d.ts +15 -0
  67. package/es/api/biz/util/chosen.js +19 -0
  68. package/es/api/biz/util/clipboardFileUpload.d.ts +7 -0
  69. package/es/api/biz/util/clipboardFileUpload.js +8 -0
  70. package/es/api/biz/util/closeWindow.d.ts +8 -0
  71. package/es/api/biz/util/closeWindow.js +15 -0
  72. package/es/api/biz/util/complain.d.ts +12 -0
  73. package/es/api/biz/util/complain.js +8 -0
  74. package/es/api/biz/util/createModifySchedule.d.ts +26 -0
  75. package/es/api/biz/util/createModifySchedule.js +15 -0
  76. package/es/api/biz/util/datepicker.d.ts +14 -0
  77. package/es/api/biz/util/datepicker.js +19 -0
  78. package/es/api/biz/util/datetimepicker.d.ts +14 -0
  79. package/es/api/biz/util/datetimepicker.js +19 -0
  80. package/es/api/biz/util/disableScreenCapture.d.ts +8 -0
  81. package/es/api/biz/util/disableScreenCapture.js +19 -0
  82. package/es/api/biz/util/downloadFile.d.ts +9 -0
  83. package/es/api/biz/util/downloadFile.js +8 -0
  84. package/es/api/biz/util/entergroupCheck.d.ts +10 -0
  85. package/es/api/biz/util/entergroupCheck.js +23 -0
  86. package/es/api/biz/util/externalLinkPreviewFile.d.ts +11 -0
  87. package/es/api/biz/util/externalLinkPreviewFile.js +8 -0
  88. package/es/api/biz/util/feedback.d.ts +11 -0
  89. package/es/api/biz/util/feedback.js +8 -0
  90. package/es/api/biz/util/getSingleWebviewData.d.ts +8 -0
  91. package/es/api/biz/util/getSingleWebviewData.js +8 -0
  92. package/es/api/biz/util/getTogetherConfig.d.ts +11 -0
  93. package/es/api/biz/util/getTogetherConfig.js +23 -0
  94. package/es/api/biz/util/getToken.d.ts +11 -0
  95. package/es/api/biz/util/getToken.js +19 -0
  96. package/es/api/biz/util/injectScript.d.ts +9 -0
  97. package/es/api/biz/util/injectScript.js +8 -0
  98. package/es/api/biz/util/invoice.d.ts +12 -0
  99. package/es/api/biz/util/invoice.js +15 -0
  100. package/es/api/biz/util/mediaFileUpload.d.ts +26 -0
  101. package/es/api/biz/util/mediaFileUpload.js +15 -0
  102. package/es/api/biz/util/onlineDocmentOpenTeamChat.d.ts +10 -0
  103. package/es/api/biz/util/onlineDocmentOpenTeamChat.js +23 -0
  104. package/es/api/biz/util/open.d.ts +9 -0
  105. package/es/api/biz/util/open.js +8 -0
  106. package/es/api/biz/util/openLink.d.ts +8 -0
  107. package/es/api/biz/util/openLink.js +8 -0
  108. package/es/api/biz/util/openMediaFileDialog.d.ts +23 -0
  109. package/es/api/biz/util/openMediaFileDialog.js +15 -0
  110. package/es/api/biz/util/openSingleWebview.d.ts +23 -0
  111. package/es/api/biz/util/openSingleWebview.js +15 -0
  112. package/es/api/biz/util/openSlidePanel.d.ts +11 -0
  113. package/es/api/biz/util/openSlidePanel.js +15 -0
  114. package/es/api/biz/util/openTalYoungToTopic.d.ts +6 -0
  115. package/es/api/biz/util/openTalYoungToTopic.js +15 -0
  116. package/es/api/biz/util/openTogetherEyeWebview.d.ts +11 -0
  117. package/es/api/biz/util/openTogetherEyeWebview.js +23 -0
  118. package/es/api/biz/util/openUserSchedule.d.ts +11 -0
  119. package/es/api/biz/util/openUserSchedule.js +23 -0
  120. package/es/api/biz/util/openVideoPlayer.d.ts +27 -0
  121. package/es/api/biz/util/openVideoPlayer.js +23 -0
  122. package/es/api/biz/util/previewFile.d.ts +11 -0
  123. package/es/api/biz/util/previewFile.js +8 -0
  124. package/es/api/biz/util/previewImage.d.ts +9 -0
  125. package/es/api/biz/util/previewImage.js +8 -0
  126. package/es/api/biz/util/proxy.d.ts +13 -0
  127. package/es/api/biz/util/proxy.js +8 -0
  128. package/es/api/biz/util/pushWorkMsg.d.ts +10 -0
  129. package/es/api/biz/util/pushWorkMsg.js +15 -0
  130. package/es/api/biz/util/remind.d.ts +15 -0
  131. package/es/api/biz/util/remind.js +23 -0
  132. package/es/api/biz/util/rouseApp.d.ts +12 -0
  133. package/es/api/biz/util/rouseApp.js +15 -0
  134. package/es/api/biz/util/savePic.d.ts +8 -0
  135. package/es/api/biz/util/savePic.js +19 -0
  136. package/es/api/biz/util/scan.d.ts +11 -0
  137. package/es/api/biz/util/scan.js +19 -0
  138. package/es/api/biz/util/selectDepartment.d.ts +9 -0
  139. package/es/api/biz/util/selectDepartment.js +8 -0
  140. package/es/api/biz/util/share.d.ts +12 -0
  141. package/es/api/biz/util/share.js +19 -0
  142. package/es/api/biz/util/takePicture.d.ts +13 -0
  143. package/es/api/biz/util/takePicture.js +8 -0
  144. package/es/api/biz/util/uploadAttachment.d.ts +55 -0
  145. package/es/api/biz/util/uploadAttachment.js +8 -0
  146. package/es/api/biz/util/yachEvent.d.ts +12 -0
  147. package/es/api/biz/util/yachEvent.js +27 -0
  148. package/es/api/biz/util/zfbAuth.d.ts +10 -0
  149. package/es/api/biz/util/zfbAuth.js +19 -0
  150. package/es/api/biz/webViewMessage/send.d.ts +7 -0
  151. package/es/api/biz/webViewMessage/send.js +15 -0
  152. package/es/api/common.typings.d.ts +9 -0
  153. package/es/api/common.typings.js +0 -0
  154. package/es/api/device/audio/download.d.ts +8 -0
  155. package/es/api/device/audio/download.js +19 -0
  156. package/es/api/device/audio/onPlayEnd.d.ts +7 -0
  157. package/es/api/device/audio/onPlayEnd.js +19 -0
  158. package/es/api/device/audio/onRecordEnd.d.ts +7 -0
  159. package/es/api/device/audio/onRecordEnd.js +19 -0
  160. package/es/api/device/audio/onRecordEnd_v2.d.ts +7 -0
  161. package/es/api/device/audio/onRecordEnd_v2.js +19 -0
  162. package/es/api/device/audio/pause.d.ts +8 -0
  163. package/es/api/device/audio/pause.js +19 -0
  164. package/es/api/device/audio/play.d.ts +8 -0
  165. package/es/api/device/audio/play.js +19 -0
  166. package/es/api/device/audio/resume.d.ts +8 -0
  167. package/es/api/device/audio/resume.js +19 -0
  168. package/es/api/device/audio/startRecord.d.ts +8 -0
  169. package/es/api/device/audio/startRecord.js +19 -0
  170. package/es/api/device/audio/startRecord_v2.d.ts +8 -0
  171. package/es/api/device/audio/startRecord_v2.js +19 -0
  172. package/es/api/device/audio/stop.d.ts +8 -0
  173. package/es/api/device/audio/stop.js +19 -0
  174. package/es/api/device/audio/stopRecord.d.ts +7 -0
  175. package/es/api/device/audio/stopRecord.js +19 -0
  176. package/es/api/device/audio/stopRecord_v2.d.ts +7 -0
  177. package/es/api/device/audio/stopRecord_v2.js +19 -0
  178. package/es/api/device/base/checkStepPermission.d.ts +8 -0
  179. package/es/api/device/base/checkStepPermission.js +19 -0
  180. package/es/api/device/base/getPhoneInfo.d.ts +16 -0
  181. package/es/api/device/base/getPhoneInfo.js +19 -0
  182. package/es/api/device/base/getUUID.d.ts +10 -0
  183. package/es/api/device/base/getUUID.js +23 -0
  184. package/es/api/device/connection/getNetworkType.d.ts +10 -0
  185. package/es/api/device/connection/getNetworkType.js +19 -0
  186. package/es/api/device/connection/isAtTal.d.ts +10 -0
  187. package/es/api/device/connection/isAtTal.js +21 -0
  188. package/es/api/device/geolocation/get.d.ts +42 -0
  189. package/es/api/device/geolocation/get.js +19 -0
  190. package/es/api/device/geolocation/getSwitch.d.ts +10 -0
  191. package/es/api/device/geolocation/getSwitch.js +15 -0
  192. package/es/api/device/notification/actionSheet.d.ts +15 -0
  193. package/es/api/device/notification/actionSheet.js +19 -0
  194. package/es/api/device/notification/alert.d.ts +13 -0
  195. package/es/api/device/notification/alert.js +23 -0
  196. package/es/api/device/notification/confirm.d.ts +16 -0
  197. package/es/api/device/notification/confirm.js +23 -0
  198. package/es/api/device/notification/hidePreloader.d.ts +7 -0
  199. package/es/api/device/notification/hidePreloader.js +19 -0
  200. package/es/api/device/notification/showPreloader.d.ts +9 -0
  201. package/es/api/device/notification/showPreloader.js +19 -0
  202. package/es/api/device/notification/toast.d.ts +15 -0
  203. package/es/api/device/notification/toast.js +8 -0
  204. package/es/api/device/notification/vibrate.d.ts +8 -0
  205. package/es/api/device/notification/vibrate.js +19 -0
  206. package/es/api/device/system/getLang.d.ts +10 -0
  207. package/es/api/device/system/getLang.js +8 -0
  208. package/es/api/device/system/setLight.d.ts +8 -0
  209. package/es/api/device/system/setLight.js +19 -0
  210. package/es/api/initAPI.d.ts +6 -0
  211. package/es/api/initAPI.js +22 -0
  212. package/es/api/primary/createTab.d.ts +13 -0
  213. package/es/api/primary/createTab.js +15 -0
  214. package/es/api/primary/exitFullScreen.d.ts +7 -0
  215. package/es/api/primary/exitFullScreen.js +15 -0
  216. package/es/api/primary/fullScreen.d.ts +7 -0
  217. package/es/api/primary/fullScreen.js +15 -0
  218. package/es/api/primary/weeklyShare.d.ts +13 -0
  219. package/es/api/primary/weeklyShare.js +15 -0
  220. package/es/api/runtime/permission/requestAuthCode.d.ts +12 -0
  221. package/es/api/runtime/permission/requestAuthCode.js +8 -0
  222. package/es/api/ui/pullToRefresh/disable.d.ts +7 -0
  223. package/es/api/ui/pullToRefresh/disable.js +19 -0
  224. package/es/api/ui/pullToRefresh/enable.d.ts +7 -0
  225. package/es/api/ui/pullToRefresh/enable.js +19 -0
  226. package/es/api/ui/pullToRefresh/stop.d.ts +7 -0
  227. package/es/api/ui/pullToRefresh/stop.js +19 -0
  228. package/es/api/ui/webViewBounce/disable.d.ts +7 -0
  229. package/es/api/ui/webViewBounce/disable.js +15 -0
  230. package/es/api/util/domainStorage/getItem.d.ts +12 -0
  231. package/es/api/util/domainStorage/getItem.js +19 -0
  232. package/es/api/util/domainStorage/removeItem.d.ts +9 -0
  233. package/es/api/util/domainStorage/removeItem.js +19 -0
  234. package/es/api/util/domainStorage/setItem.d.ts +11 -0
  235. package/es/api/util/domainStorage/setItem.js +19 -0
  236. package/es/api/util/tool/flushLog.d.ts +7 -0
  237. package/es/api/util/tool/flushLog.js +15 -0
  238. package/es/api/util/tool/log.d.ts +9 -0
  239. package/es/api/util/tool/log.js +15 -0
  240. package/es/index.d.ts +311 -0
  241. package/es/index.js +327 -0
  242. package/es/lib/bridge/index.d.ts +2 -0
  243. package/es/lib/bridge/index.js +2 -0
  244. package/es/lib/bridge/mobile.d.ts +13 -0
  245. package/es/lib/bridge/mobile.js +169 -0
  246. package/es/lib/bridge/pc.d.ts +4 -0
  247. package/es/lib/bridge/pc.js +81 -0
  248. package/es/lib/helper/apiHelper.d.ts +2 -0
  249. package/es/lib/helper/apiHelper.js +8 -0
  250. package/es/lib/helper/codeMap.d.ts +2 -0
  251. package/es/lib/helper/codeMap.js +6 -0
  252. package/es/lib/helper/event.d.ts +9 -0
  253. package/es/lib/helper/event.js +40 -0
  254. package/es/lib/helper/pcIframe.d.ts +44 -0
  255. package/es/lib/helper/pcIframe.js +148 -0
  256. package/es/lib/index.d.ts +4 -0
  257. package/es/lib/index.js +78 -0
  258. package/es/lib/sdk/index.d.ts +19 -0
  259. package/es/lib/sdk/index.js +170 -0
  260. package/es/lib/sdk/sdk.typings.d.ts +85 -0
  261. package/es/lib/sdk/sdk.typings.js +7 -0
  262. package/es/utils/bpitLog.d.ts +16 -0
  263. package/es/utils/bpitLog.js +62 -0
  264. package/es/utils/compareVersions.d.ts +58 -0
  265. package/es/utils/compareVersions.js +165 -0
  266. package/es/utils/console.d.ts +4 -0
  267. package/es/utils/console.js +44 -0
  268. package/es/utils/env.d.ts +3 -0
  269. package/es/utils/env.js +45 -0
  270. package/es/utils/index.d.ts +4 -0
  271. package/es/utils/index.js +20 -0
  272. package/libs/api/app/custom/talYoungFilesUpload.d.ts +38 -0
  273. package/libs/api/app/custom/talYoungFilesUpload.js +24 -0
  274. package/libs/api/biz/chat/chooseConversationByCorpId.d.ts +36 -0
  275. package/libs/api/biz/chat/chooseConversationByCorpId.js +15 -0
  276. package/libs/api/biz/chat/openSingleChat.d.ts +10 -0
  277. package/libs/api/biz/chat/openSingleChat.js +15 -0
  278. package/libs/api/biz/chat/openSquad.d.ts +8 -0
  279. package/libs/api/biz/chat/openSquad.js +15 -0
  280. package/libs/api/biz/chat/openTeamChat.d.ts +10 -0
  281. package/libs/api/biz/chat/openTeamChat.js +15 -0
  282. package/libs/api/biz/chat/pickConversation.d.ts +19 -0
  283. package/libs/api/biz/chat/pickConversation.js +26 -0
  284. package/libs/api/biz/chat/sendP2PMsg.d.ts +10 -0
  285. package/libs/api/biz/chat/sendP2PMsg.js +15 -0
  286. package/libs/api/biz/contact/complexPicker.d.ts +62 -0
  287. package/libs/api/biz/contact/complexPicker.js +15 -0
  288. package/libs/api/biz/contact/departmentsPicker.d.ts +35 -0
  289. package/libs/api/biz/contact/departmentsPicker.js +15 -0
  290. package/libs/api/biz/group/groupComplexPicker.d.ts +33 -0
  291. package/libs/api/biz/group/groupComplexPicker.js +15 -0
  292. package/libs/api/biz/map/multipointView.d.ts +21 -0
  293. package/libs/api/biz/map/multipointView.js +26 -0
  294. package/libs/api/biz/map/view.d.ts +13 -0
  295. package/libs/api/biz/map/view.js +26 -0
  296. package/libs/api/biz/navigation/close.d.ts +7 -0
  297. package/libs/api/biz/navigation/close.js +16 -0
  298. package/libs/api/biz/navigation/goBack.d.ts +7 -0
  299. package/libs/api/biz/navigation/goBack.js +26 -0
  300. package/libs/api/biz/navigation/quit.d.ts +8 -0
  301. package/libs/api/biz/navigation/quit.js +22 -0
  302. package/libs/api/biz/navigation/replace.d.ts +8 -0
  303. package/libs/api/biz/navigation/replace.js +15 -0
  304. package/libs/api/biz/navigation/setIcon.d.ts +12 -0
  305. package/libs/api/biz/navigation/setIcon.js +34 -0
  306. package/libs/api/biz/navigation/setLeft.d.ts +9 -0
  307. package/libs/api/biz/navigation/setLeft.js +38 -0
  308. package/libs/api/biz/navigation/setMenu.d.ts +20 -0
  309. package/libs/api/biz/navigation/setMenu.js +32 -0
  310. package/libs/api/biz/navigation/setPanGestureEnable.d.ts +9 -0
  311. package/libs/api/biz/navigation/setPanGestureEnable.js +33 -0
  312. package/libs/api/biz/navigation/setRight.d.ts +13 -0
  313. package/libs/api/biz/navigation/setRight.js +38 -0
  314. package/libs/api/biz/navigation/setTitle.d.ts +11 -0
  315. package/libs/api/biz/navigation/setTitle.js +15 -0
  316. package/libs/api/biz/navigation/setTitleExpandIcon.d.ts +9 -0
  317. package/libs/api/biz/navigation/setTitleExpandIcon.js +32 -0
  318. package/libs/api/biz/navigation/setWindowBig.d.ts +9 -0
  319. package/libs/api/biz/navigation/setWindowBig.js +24 -0
  320. package/libs/api/biz/navigation/tencentMeeting.d.ts +22 -0
  321. package/libs/api/biz/navigation/tencentMeeting.js +15 -0
  322. package/libs/api/biz/navigation/tencentMeetingBegin.d.ts +7 -0
  323. package/libs/api/biz/navigation/tencentMeetingBegin.js +15 -0
  324. package/libs/api/biz/navigation/updateExpandTitle.d.ts +8 -0
  325. package/libs/api/biz/navigation/updateExpandTitle.js +15 -0
  326. package/libs/api/biz/telephone/call.d.ts +9 -0
  327. package/libs/api/biz/telephone/call.js +26 -0
  328. package/libs/api/biz/telephone/showCallMenu.d.ts +12 -0
  329. package/libs/api/biz/telephone/showCallMenu.js +26 -0
  330. package/libs/api/biz/util/assistantCreate.d.ts +11 -0
  331. package/libs/api/biz/util/assistantCreate.js +30 -0
  332. package/libs/api/biz/util/authFinish.d.ts +11 -0
  333. package/libs/api/biz/util/authFinish.js +26 -0
  334. package/libs/api/biz/util/authStart.d.ts +9 -0
  335. package/libs/api/biz/util/authStart.js +26 -0
  336. package/libs/api/biz/util/chosen.d.ts +15 -0
  337. package/libs/api/biz/util/chosen.js +26 -0
  338. package/libs/api/biz/util/clipboardFileUpload.d.ts +7 -0
  339. package/libs/api/biz/util/clipboardFileUpload.js +15 -0
  340. package/libs/api/biz/util/closeWindow.d.ts +8 -0
  341. package/libs/api/biz/util/closeWindow.js +22 -0
  342. package/libs/api/biz/util/complain.d.ts +12 -0
  343. package/libs/api/biz/util/complain.js +15 -0
  344. package/libs/api/biz/util/createModifySchedule.d.ts +26 -0
  345. package/libs/api/biz/util/createModifySchedule.js +22 -0
  346. package/libs/api/biz/util/datepicker.d.ts +14 -0
  347. package/libs/api/biz/util/datepicker.js +26 -0
  348. package/libs/api/biz/util/datetimepicker.d.ts +14 -0
  349. package/libs/api/biz/util/datetimepicker.js +26 -0
  350. package/libs/api/biz/util/disableScreenCapture.d.ts +8 -0
  351. package/libs/api/biz/util/disableScreenCapture.js +26 -0
  352. package/libs/api/biz/util/downloadFile.d.ts +9 -0
  353. package/libs/api/biz/util/downloadFile.js +15 -0
  354. package/libs/api/biz/util/entergroupCheck.d.ts +10 -0
  355. package/libs/api/biz/util/entergroupCheck.js +30 -0
  356. package/libs/api/biz/util/externalLinkPreviewFile.d.ts +11 -0
  357. package/libs/api/biz/util/externalLinkPreviewFile.js +15 -0
  358. package/libs/api/biz/util/feedback.d.ts +11 -0
  359. package/libs/api/biz/util/feedback.js +15 -0
  360. package/libs/api/biz/util/getSingleWebviewData.d.ts +8 -0
  361. package/libs/api/biz/util/getSingleWebviewData.js +15 -0
  362. package/libs/api/biz/util/getTogetherConfig.d.ts +11 -0
  363. package/libs/api/biz/util/getTogetherConfig.js +30 -0
  364. package/libs/api/biz/util/getToken.d.ts +11 -0
  365. package/libs/api/biz/util/getToken.js +26 -0
  366. package/libs/api/biz/util/injectScript.d.ts +9 -0
  367. package/libs/api/biz/util/injectScript.js +15 -0
  368. package/libs/api/biz/util/invoice.d.ts +12 -0
  369. package/libs/api/biz/util/invoice.js +23 -0
  370. package/libs/api/biz/util/mediaFileUpload.d.ts +26 -0
  371. package/libs/api/biz/util/mediaFileUpload.js +23 -0
  372. package/libs/api/biz/util/onlineDocmentOpenTeamChat.d.ts +10 -0
  373. package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +30 -0
  374. package/libs/api/biz/util/open.d.ts +9 -0
  375. package/libs/api/biz/util/open.js +15 -0
  376. package/libs/api/biz/util/openLink.d.ts +8 -0
  377. package/libs/api/biz/util/openLink.js +15 -0
  378. package/libs/api/biz/util/openMediaFileDialog.d.ts +23 -0
  379. package/libs/api/biz/util/openMediaFileDialog.js +23 -0
  380. package/libs/api/biz/util/openSingleWebview.d.ts +23 -0
  381. package/libs/api/biz/util/openSingleWebview.js +22 -0
  382. package/libs/api/biz/util/openSlidePanel.d.ts +11 -0
  383. package/libs/api/biz/util/openSlidePanel.js +22 -0
  384. package/libs/api/biz/util/openTalYoungToTopic.d.ts +6 -0
  385. package/libs/api/biz/util/openTalYoungToTopic.js +23 -0
  386. package/libs/api/biz/util/openTogetherEyeWebview.d.ts +11 -0
  387. package/libs/api/biz/util/openTogetherEyeWebview.js +30 -0
  388. package/libs/api/biz/util/openUserSchedule.d.ts +11 -0
  389. package/libs/api/biz/util/openUserSchedule.js +30 -0
  390. package/libs/api/biz/util/openVideoPlayer.d.ts +27 -0
  391. package/libs/api/biz/util/openVideoPlayer.js +30 -0
  392. package/libs/api/biz/util/previewFile.d.ts +11 -0
  393. package/libs/api/biz/util/previewFile.js +15 -0
  394. package/libs/api/biz/util/previewImage.d.ts +9 -0
  395. package/libs/api/biz/util/previewImage.js +15 -0
  396. package/libs/api/biz/util/proxy.d.ts +13 -0
  397. package/libs/api/biz/util/proxy.js +15 -0
  398. package/libs/api/biz/util/pushWorkMsg.d.ts +10 -0
  399. package/libs/api/biz/util/pushWorkMsg.js +23 -0
  400. package/libs/api/biz/util/remind.d.ts +15 -0
  401. package/libs/api/biz/util/remind.js +30 -0
  402. package/libs/api/biz/util/rouseApp.d.ts +12 -0
  403. package/libs/api/biz/util/rouseApp.js +23 -0
  404. package/libs/api/biz/util/savePic.d.ts +8 -0
  405. package/libs/api/biz/util/savePic.js +26 -0
  406. package/libs/api/biz/util/scan.d.ts +11 -0
  407. package/libs/api/biz/util/scan.js +26 -0
  408. package/libs/api/biz/util/selectDepartment.d.ts +9 -0
  409. package/libs/api/biz/util/selectDepartment.js +15 -0
  410. package/libs/api/biz/util/share.d.ts +12 -0
  411. package/libs/api/biz/util/share.js +26 -0
  412. package/libs/api/biz/util/takePicture.d.ts +13 -0
  413. package/libs/api/biz/util/takePicture.js +15 -0
  414. package/libs/api/biz/util/uploadAttachment.d.ts +55 -0
  415. package/libs/api/biz/util/uploadAttachment.js +15 -0
  416. package/libs/api/biz/util/yachEvent.d.ts +12 -0
  417. package/libs/api/biz/util/yachEvent.js +34 -0
  418. package/libs/api/biz/util/zfbAuth.d.ts +10 -0
  419. package/libs/api/biz/util/zfbAuth.js +26 -0
  420. package/libs/api/biz/webViewMessage/send.d.ts +7 -0
  421. package/libs/api/biz/webViewMessage/send.js +22 -0
  422. package/libs/api/common.typings.d.ts +9 -0
  423. package/libs/api/common.typings.js +1 -0
  424. package/libs/api/device/audio/download.d.ts +8 -0
  425. package/libs/api/device/audio/download.js +26 -0
  426. package/libs/api/device/audio/onPlayEnd.d.ts +7 -0
  427. package/libs/api/device/audio/onPlayEnd.js +26 -0
  428. package/libs/api/device/audio/onRecordEnd.d.ts +7 -0
  429. package/libs/api/device/audio/onRecordEnd.js +26 -0
  430. package/libs/api/device/audio/onRecordEnd_v2.d.ts +7 -0
  431. package/libs/api/device/audio/onRecordEnd_v2.js +26 -0
  432. package/libs/api/device/audio/pause.d.ts +8 -0
  433. package/libs/api/device/audio/pause.js +26 -0
  434. package/libs/api/device/audio/play.d.ts +8 -0
  435. package/libs/api/device/audio/play.js +26 -0
  436. package/libs/api/device/audio/resume.d.ts +8 -0
  437. package/libs/api/device/audio/resume.js +26 -0
  438. package/libs/api/device/audio/startRecord.d.ts +8 -0
  439. package/libs/api/device/audio/startRecord.js +26 -0
  440. package/libs/api/device/audio/startRecord_v2.d.ts +8 -0
  441. package/libs/api/device/audio/startRecord_v2.js +26 -0
  442. package/libs/api/device/audio/stop.d.ts +8 -0
  443. package/libs/api/device/audio/stop.js +26 -0
  444. package/libs/api/device/audio/stopRecord.d.ts +7 -0
  445. package/libs/api/device/audio/stopRecord.js +26 -0
  446. package/libs/api/device/audio/stopRecord_v2.d.ts +7 -0
  447. package/libs/api/device/audio/stopRecord_v2.js +26 -0
  448. package/libs/api/device/base/checkStepPermission.d.ts +8 -0
  449. package/libs/api/device/base/checkStepPermission.js +26 -0
  450. package/libs/api/device/base/getPhoneInfo.d.ts +16 -0
  451. package/libs/api/device/base/getPhoneInfo.js +26 -0
  452. package/libs/api/device/base/getUUID.d.ts +10 -0
  453. package/libs/api/device/base/getUUID.js +30 -0
  454. package/libs/api/device/connection/getNetworkType.d.ts +10 -0
  455. package/libs/api/device/connection/getNetworkType.js +26 -0
  456. package/libs/api/device/connection/isAtTal.d.ts +10 -0
  457. package/libs/api/device/connection/isAtTal.js +28 -0
  458. package/libs/api/device/geolocation/get.d.ts +42 -0
  459. package/libs/api/device/geolocation/get.js +26 -0
  460. package/libs/api/device/geolocation/getSwitch.d.ts +10 -0
  461. package/libs/api/device/geolocation/getSwitch.js +22 -0
  462. package/libs/api/device/notification/actionSheet.d.ts +15 -0
  463. package/libs/api/device/notification/actionSheet.js +26 -0
  464. package/libs/api/device/notification/alert.d.ts +13 -0
  465. package/libs/api/device/notification/alert.js +30 -0
  466. package/libs/api/device/notification/confirm.d.ts +16 -0
  467. package/libs/api/device/notification/confirm.js +30 -0
  468. package/libs/api/device/notification/hidePreloader.d.ts +7 -0
  469. package/libs/api/device/notification/hidePreloader.js +26 -0
  470. package/libs/api/device/notification/showPreloader.d.ts +9 -0
  471. package/libs/api/device/notification/showPreloader.js +26 -0
  472. package/libs/api/device/notification/toast.d.ts +15 -0
  473. package/libs/api/device/notification/toast.js +15 -0
  474. package/libs/api/device/notification/vibrate.d.ts +8 -0
  475. package/libs/api/device/notification/vibrate.js +26 -0
  476. package/libs/api/device/system/getLang.d.ts +10 -0
  477. package/libs/api/device/system/getLang.js +15 -0
  478. package/libs/api/device/system/setLight.d.ts +8 -0
  479. package/libs/api/device/system/setLight.js +26 -0
  480. package/libs/api/initAPI.d.ts +6 -0
  481. package/libs/api/initAPI.js +29 -0
  482. package/libs/api/primary/createTab.d.ts +13 -0
  483. package/libs/api/primary/createTab.js +22 -0
  484. package/libs/api/primary/exitFullScreen.d.ts +7 -0
  485. package/libs/api/primary/exitFullScreen.js +22 -0
  486. package/libs/api/primary/fullScreen.d.ts +7 -0
  487. package/libs/api/primary/fullScreen.js +22 -0
  488. package/libs/api/primary/weeklyShare.d.ts +13 -0
  489. package/libs/api/primary/weeklyShare.js +22 -0
  490. package/libs/api/runtime/permission/requestAuthCode.d.ts +12 -0
  491. package/libs/api/runtime/permission/requestAuthCode.js +15 -0
  492. package/libs/api/ui/pullToRefresh/disable.d.ts +7 -0
  493. package/libs/api/ui/pullToRefresh/disable.js +26 -0
  494. package/libs/api/ui/pullToRefresh/enable.d.ts +7 -0
  495. package/libs/api/ui/pullToRefresh/enable.js +26 -0
  496. package/libs/api/ui/pullToRefresh/stop.d.ts +7 -0
  497. package/libs/api/ui/pullToRefresh/stop.js +26 -0
  498. package/libs/api/ui/webViewBounce/disable.d.ts +7 -0
  499. package/libs/api/ui/webViewBounce/disable.js +22 -0
  500. package/libs/api/util/domainStorage/getItem.d.ts +12 -0
  501. package/libs/api/util/domainStorage/getItem.js +26 -0
  502. package/libs/api/util/domainStorage/removeItem.d.ts +9 -0
  503. package/libs/api/util/domainStorage/removeItem.js +26 -0
  504. package/libs/api/util/domainStorage/setItem.d.ts +11 -0
  505. package/libs/api/util/domainStorage/setItem.js +26 -0
  506. package/libs/api/util/tool/flushLog.d.ts +7 -0
  507. package/libs/api/util/tool/flushLog.js +22 -0
  508. package/libs/api/util/tool/log.d.ts +9 -0
  509. package/libs/api/util/tool/log.js +22 -0
  510. package/libs/index.d.ts +311 -0
  511. package/libs/index.js +1042 -0
  512. package/libs/lib/bridge/index.d.ts +2 -0
  513. package/libs/lib/bridge/index.js +32 -0
  514. package/libs/lib/bridge/mobile.d.ts +13 -0
  515. package/libs/lib/bridge/mobile.js +175 -0
  516. package/libs/lib/bridge/pc.d.ts +4 -0
  517. package/libs/lib/bridge/pc.js +87 -0
  518. package/libs/lib/helper/apiHelper.d.ts +2 -0
  519. package/libs/lib/helper/apiHelper.js +15 -0
  520. package/libs/lib/helper/codeMap.d.ts +2 -0
  521. package/libs/lib/helper/codeMap.js +13 -0
  522. package/libs/lib/helper/event.d.ts +9 -0
  523. package/libs/lib/helper/event.js +48 -0
  524. package/libs/lib/helper/pcIframe.d.ts +44 -0
  525. package/libs/lib/helper/pcIframe.js +156 -0
  526. package/libs/lib/index.d.ts +4 -0
  527. package/libs/lib/index.js +86 -0
  528. package/libs/lib/sdk/index.d.ts +19 -0
  529. package/libs/lib/sdk/index.js +178 -0
  530. package/libs/lib/sdk/sdk.typings.d.ts +85 -0
  531. package/libs/lib/sdk/sdk.typings.js +14 -0
  532. package/libs/utils/bpitLog.d.ts +16 -0
  533. package/libs/utils/bpitLog.js +69 -0
  534. package/libs/utils/compareVersions.d.ts +58 -0
  535. package/libs/utils/compareVersions.js +173 -0
  536. package/libs/utils/console.d.ts +4 -0
  537. package/libs/utils/console.js +53 -0
  538. package/libs/utils/env.d.ts +3 -0
  539. package/libs/utils/env.js +51 -0
  540. package/libs/utils/index.d.ts +4 -0
  541. package/libs/utils/index.js +51 -0
  542. package/package.json +1 -1
@@ -0,0 +1,170 @@
1
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
3
+ import _Promise from "@babel/runtime-corejs3/core-js/promise";
4
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
5
+ import { bpitLog, log } from '../../utils';
6
+ import { compareVersions } from '../../utils/compareVersions';
7
+ import packageInfo from '../../../package.json';
8
+ var Sdk = /*#__PURE__*/function () {
9
+ function Sdk(env) {
10
+ var _this = this;
11
+ _classCallCheck(this, Sdk);
12
+ this.invokeAPIConfigMapByMethod = {};
13
+ this.configJsApiList = [];
14
+ this.platformConfigMap = {};
15
+ this.hadConfig = false;
16
+ this.bridgeInitFnPromise = null;
17
+ this.cacheP = {};
18
+ this.config$ = new _Promise(function (a, b) {
19
+ _this.cacheP.resolve = a;
20
+ _this.cacheP.reject = b;
21
+ });
22
+ this.env = env;
23
+ this.exportSdk = {
24
+ version: env.version,
25
+ sdkVersion: packageInfo.version,
26
+ // sdkVersion: '0.0.0',
27
+ env: env,
28
+ platform: env.platform,
29
+ platformV2: env.platformV2,
30
+ config: function config() {
31
+ var _config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
32
+ // 鉴权
33
+ var _config$jsApiList = _config.jsApiList,
34
+ jsApiList = _config$jsApiList === void 0 ? [] : _config$jsApiList;
35
+ if (_this.hadConfig) {
36
+ console.log('Config has been executed');
37
+ } else {
38
+ _this.bridgeInitFn().then(function (fn) {
39
+ fn('config', _config).then(function (value) {
40
+ // 鉴权成功
41
+ _this.cacheP.resolve(value);
42
+ _this.hadConfig = true;
43
+ _this.configJsApiList = jsApiList;
44
+ })["catch"](function (error) {
45
+ // 后台鉴权失败
46
+ _this.cacheP.reject(error);
47
+ });
48
+ });
49
+ }
50
+ },
51
+ ready: function ready(fn) {
52
+ _this.bridgeInitFn().then(function () {
53
+ fn();
54
+ });
55
+ },
56
+ error: function error(fn) {
57
+ _this.config$["catch"](function (error) {
58
+ fn(error);
59
+ });
60
+ },
61
+ on: function on(o, n) {
62
+ _this.bridgeInitFn().then(function () {
63
+ _this.platformConfigMap[env.platform].event.on(o, n);
64
+ });
65
+ },
66
+ off: function off(o, n) {
67
+ _this.bridgeInitFn().then(function () {
68
+ _this.platformConfigMap[env.platform].event.off(o, n);
69
+ });
70
+ }
71
+ };
72
+ }
73
+ _createClass(Sdk, [{
74
+ key: "setAPI",
75
+ value: function setAPI(method, config) {
76
+ this.invokeAPIConfigMapByMethod[method] = config;
77
+ }
78
+ // 确定端的同事初始化bridge
79
+ }, {
80
+ key: "setPlatform",
81
+ value: function setPlatform(value) {
82
+ var platform = value.platform,
83
+ bridgeInit = value.bridgeInit;
84
+ this.platformConfigMap[platform] = value;
85
+ // if (this.env.platform === platform) bridgeInit();
86
+ }
87
+ }, {
88
+ key: "bridgeInitFn",
89
+ value: function bridgeInitFn() {
90
+ // 平台环境不对再调用api就肯定失败
91
+ if (this.bridgeInitFnPromise) {
92
+ return this.bridgeInitFnPromise;
93
+ }
94
+ var o = this.platformConfigMap[this.env.platform];
95
+ if (o) {
96
+ this.bridgeInitFnPromise = o.bridgeInit();
97
+ } else {
98
+ var n = 'Do not support the current environment�' + this.env.platform;
99
+ this.bridgeInitFnPromise = _Promise.reject(new Error(n));
100
+ }
101
+ return this.bridgeInitFnPromise;
102
+ }
103
+ }, {
104
+ key: "_onFail",
105
+ value: function _onFail(method, errorcode, message, onFail) {
106
+ bpitLog({
107
+ method: method,
108
+ errorcode: errorcode,
109
+ message: message
110
+ });
111
+ onFail && typeof onFail == 'function' && onFail({
112
+ code: errorcode,
113
+ message: message
114
+ });
115
+ }
116
+ }, {
117
+ key: "invokeAPI",
118
+ value: function invokeAPI(method, params) {
119
+ var _context2;
120
+ if (!params) params = {};
121
+ if (!method) return;
122
+ // 验证方法是否可用
123
+ var apiConfigs = this.invokeAPIConfigMapByMethod[method];
124
+ if (!apiConfigs) {
125
+ return this._onFail(method, '-1', "[".concat(method, "] method is not exist"), params.onFail);
126
+ }
127
+ var apiConfig = apiConfigs[this.env.platform];
128
+ if (apiConfig) {
129
+ var supportVersion = apiConfig.vs || '0.0.0';
130
+ if (compareVersions(this.env.version, supportVersion) < 0) {
131
+ var _context;
132
+ return this._onFail(method, '-1', _concatInstanceProperty(_context = "The current application version is ".concat(this.env.version, ". This method does not support versions less than ")).call(_context, supportVersion), params.onFail);
133
+ }
134
+ // 确定参数
135
+ var p = apiConfig.paramsDeal ? apiConfig.paramsDeal(params) : params;
136
+ // 确定回调
137
+ if ('function' == typeof p.onSuccess) {
138
+ var v = p.onSuccess;
139
+ p.onSuccess = function (e) {
140
+ v(e);
141
+ };
142
+ }
143
+ // 主方法
144
+ this.bridgeInitFn().then(function (fn) {
145
+ fn(method, p).then(function (res) {
146
+ // 调用成功
147
+ log("SDK \u8FD4\u56DE\u7ED3\u679C\u6210\u529F ", {
148
+ method: method,
149
+ params: p,
150
+ result: res
151
+ });
152
+ })["catch"](function (error) {
153
+ // 调用失败
154
+ log("SDK \u8FD4\u56DE\u7ED3\u679C\u5931\u8D25", {
155
+ method: method,
156
+ params: p,
157
+ error: error
158
+ });
159
+ });
160
+ })["catch"](function (err) {
161
+ console.log('wenai err', err);
162
+ });
163
+ return;
164
+ }
165
+ this._onFail(method, '-1', _concatInstanceProperty(_context2 = "[".concat(method, "] method do not support the current platform (")).call(_context2, this.env.platform, ")"), params.onFail);
166
+ }
167
+ }]);
168
+ return Sdk;
169
+ }();
170
+ export default Sdk;
@@ -0,0 +1,85 @@
1
+ export declare enum ENV_ENUM {
2
+ pc = "pc",
3
+ android = "android",
4
+ ios = "ios",
5
+ notInYach = "notInYach"
6
+ }
7
+ export declare enum ERROR_CODE {
8
+ cancel = "-1",
9
+ not_exist = "1",
10
+ no_permission = "7",
11
+ jsapi_internal_error = "22"
12
+ }
13
+ export interface PlatformV2Props {
14
+ inYach: boolean;
15
+ inIOS: boolean;
16
+ inAndroid: boolean;
17
+ inPC: boolean;
18
+ inIpad: boolean;
19
+ inIPhone: boolean;
20
+ }
21
+ export interface IENV {
22
+ /** current platform (ios or android or pc or notInYach) */
23
+ platform: ENV_ENUM;
24
+ /** current client version */
25
+ version?: string;
26
+ /** @deprecated recommend use navigator.language to get current language */
27
+ language?: string;
28
+ platformV2: PlatformV2Props;
29
+ env: 'test' | 'online';
30
+ }
31
+ export interface IInvokeAPIConfigMap {
32
+ [platform: string]: IAPIConfig | undefined;
33
+ }
34
+ export interface IAPIConfig {
35
+ /** version */
36
+ vs: string;
37
+ paramsDeal?: (params: object) => object;
38
+ }
39
+ export interface IInvokeAPIConfigMapByMethod {
40
+ [method: string]: IInvokeAPIConfigMap | undefined;
41
+ }
42
+ /** config参数 */
43
+ export interface IConfigParams {
44
+ jsApiList?: string[];
45
+ [key: string]: any;
46
+ }
47
+ export interface IPlatformConfig {
48
+ platform: string;
49
+ authMethod: string;
50
+ authParamsDeal?: (params: object) => object;
51
+ bridgeInit: () => Promise<IJSBridge>;
52
+ event: {
53
+ on: (type: string, handler: (e: any) => void) => void;
54
+ off: (type: string, handler: (e: any) => void) => void;
55
+ };
56
+ }
57
+ /** jsbridgehui回调函数 */
58
+ export declare type mobileCallback = (e: {
59
+ code: string;
60
+ message: string;
61
+ data?: Record<string, any>;
62
+ }) => void;
63
+ /** 定义主方法 */
64
+ export interface IUNCore {
65
+ config: (configParams: IConfigParams) => void;
66
+ env: IENV;
67
+ ready: (readyCallback: () => void) => void;
68
+ error: (callback: (err: any) => void) => void;
69
+ version: string;
70
+ sdkVersion: string;
71
+ platform: ENV_ENUM;
72
+ platformV2: PlatformV2Props;
73
+ on: (methodName: string, listener: (e: any) => void) => void;
74
+ off: (methodName: string, listener: (e: any) => void) => void;
75
+ }
76
+ /** all platform map */
77
+ export interface IConfigCoreMap {
78
+ [platform: string]: IPlatformConfig | undefined;
79
+ }
80
+ /** bridge主方法 */
81
+ export declare type IJSBridge = (method: string, params: any) => Promise<any>;
82
+ export interface IcacheP {
83
+ resolve?: (value: any) => void;
84
+ reject?: (error: any) => void;
85
+ }
@@ -0,0 +1,7 @@
1
+ export var ENV_ENUM;
2
+ (function (ENV_ENUM) {
3
+ ENV_ENUM["pc"] = "pc";
4
+ ENV_ENUM["android"] = "android";
5
+ ENV_ENUM["ios"] = "ios";
6
+ ENV_ENUM["notInYach"] = "notInYach";
7
+ })(ENV_ENUM || (ENV_ENUM = {}));
@@ -0,0 +1,16 @@
1
+ interface Options {
2
+ group: string;
3
+ project: string;
4
+ env: string;
5
+ version: string;
6
+ method?: string;
7
+ yachid?: string;
8
+ workcode?: string;
9
+ timestamp?: number;
10
+ api?: string;
11
+ time?: number;
12
+ errorcode?: string;
13
+ message?: string;
14
+ }
15
+ export default function bpitLog(options: Options): void;
16
+ export {};
@@ -0,0 +1,62 @@
1
+ function loadScript(url) {
2
+ var script = document.createElement('script');
3
+ script.type = 'text/javascript';
4
+ if (script.readyState) {
5
+ // ie 浏览器
6
+ script.onreadystatechange = function () {
7
+ if (script.readyState == 'loaded' || script.readyState == 'complete') {
8
+ script.onreadystatechange = null;
9
+ document.getElementsByTagName('head')[0].removeChild(script);
10
+ }
11
+ };
12
+ } else {
13
+ //其他
14
+ script.onload = function () {
15
+ document.getElementsByTagName('head')[0].removeChild(script);
16
+ };
17
+ }
18
+ script.src = url;
19
+ document.getElementsByTagName('head')[0].appendChild(script);
20
+ }
21
+ export default function bpitLog(options) {
22
+ if (!options) {
23
+ console.log('bpit error: need options');
24
+ return;
25
+ }
26
+ if (!options.group) {
27
+ console.log('bpit error: need options.group');
28
+ return;
29
+ }
30
+ if (!options.project) {
31
+ console.log('bpit error: need options.project');
32
+ return;
33
+ }
34
+ if (!options.hasOwnProperty('env')) {
35
+ console.log('bpit error: need options.env');
36
+ return;
37
+ }
38
+ if (!options.hasOwnProperty('version')) {
39
+ console.log('bpit error: need options.version');
40
+ return;
41
+ }
42
+ // upload data
43
+ var uploadData = ['https://es.zhiyinlou.com/log.js?'];
44
+ uploadData.push('group=' + options.group);
45
+ uploadData.push('&project=' + options.project);
46
+ uploadData.push('&env=' + options.env);
47
+ uploadData.push('&version=' + options.version);
48
+ uploadData.push('&method=' + options.method);
49
+ if (options.yachid) uploadData.push('&yachid=' + options.yachid);
50
+ if (options.workcode) uploadData.push('&workcode=' + options.workcode);
51
+ if (options.timestamp) uploadData.push('&timestamp=' + options.timestamp);
52
+ if (options.errorcode) uploadData.push('&errorcode=' + options.errorcode);
53
+ if (options.message) uploadData.push('&message=' + options.message);
54
+ // api load time
55
+ if (options.api && options.time) {
56
+ uploadData.push('&api=' + options.api);
57
+ uploadData.push('&load_time=' + options.time);
58
+ }
59
+ var uploadDataUrl = uploadData.join('');
60
+ loadScript(uploadDataUrl);
61
+ if (options.env != 'online') console.log(uploadDataUrl);
62
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
3
+ * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
4
+ * @param v1 - First version to compare
5
+ * @param v2 - Second version to compare
6
+ * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
7
+ */
8
+ export declare const compareVersions: (v1: string, v2: string) => 0 | 1 | -1;
9
+ /**
10
+ * Validate [semver](https://semver.org/) version strings.
11
+ *
12
+ * @param version Version number to validate
13
+ * @returns `true` if the version number is a valid semver version number, `false` otherwise.
14
+ *
15
+ * @example
16
+ * ```
17
+ * validate('1.0.0-rc.1'); // return true
18
+ * validate('1.0-rc.1'); // return false
19
+ * validate('foo'); // return false
20
+ * ```
21
+ */
22
+ export declare const validate: (version: string) => boolean;
23
+ /**
24
+ * Allowed arithmetic operators
25
+ */
26
+ export declare type CompareOperator = '>' | '>=' | '=' | '<' | '<=';
27
+ /**
28
+ * Compare [semver](https://semver.org/) version strings using the specified operator.
29
+ *
30
+ * @param v1 First version to compare
31
+ * @param v2 Second version to compare
32
+ * @param operator Allowed arithmetic operator to use
33
+ * @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.
34
+ *
35
+ * @example
36
+ * ```
37
+ * compare('10.1.8', '10.0.4', '>'); // return true
38
+ * compare('10.0.1', '10.0.1', '='); // return true
39
+ * compare('10.1.1', '10.2.2', '<'); // return true
40
+ * compare('10.1.1', '10.2.2', '<='); // return true
41
+ * compare('10.1.1', '10.2.2', '>='); // return false
42
+ * ```
43
+ */
44
+ export declare const compare: (v1: string, v2: string, operator: CompareOperator) => boolean;
45
+ /**
46
+ * Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
47
+ *
48
+ * @param version Version number to match
49
+ * @param range Range pattern for version
50
+ * @returns `true` if the version number is within the range, `false` otherwise.
51
+ *
52
+ * @example
53
+ * ```
54
+ * satisfies('1.1.0', '^1.0.0'); // return true
55
+ * satisfies('1.1.0', '~1.0.0'); // return false
56
+ * ```
57
+ */
58
+ export declare const satisfies: (version: string, range: string) => boolean;
@@ -0,0 +1,165 @@
1
+ import _typeof from "@babel/runtime-corejs3/helpers/typeof";
2
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
3
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
4
+ import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
5
+ import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
6
+ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
7
+ /**
8
+ * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
9
+ * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
10
+ * @param v1 - First version to compare
11
+ * @param v2 - Second version to compare
12
+ * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
13
+ */
14
+ export var compareVersions = function compareVersions(v1, v2) {
15
+ // validate input and split into segments
16
+ var n1 = validateAndParse(v1);
17
+ var n2 = validateAndParse(v2);
18
+ // pop off the patch
19
+ var p1 = n1.pop();
20
+ var p2 = n2.pop();
21
+ // validate numbers
22
+ var r = compareSegments(n1, n2);
23
+ if (r !== 0) return r;
24
+ // validate pre-release
25
+ if (p1 && p2) {
26
+ return compareSegments(p1.split('.'), p2.split('.'));
27
+ } else if (p1 || p2) {
28
+ return p1 ? -1 : 1;
29
+ }
30
+ return 0;
31
+ };
32
+ /**
33
+ * Validate [semver](https://semver.org/) version strings.
34
+ *
35
+ * @param version Version number to validate
36
+ * @returns `true` if the version number is a valid semver version number, `false` otherwise.
37
+ *
38
+ * @example
39
+ * ```
40
+ * validate('1.0.0-rc.1'); // return true
41
+ * validate('1.0-rc.1'); // return false
42
+ * validate('foo'); // return false
43
+ * ```
44
+ */
45
+ export var validate = function validate(version) {
46
+ return typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
47
+ };
48
+ /**
49
+ * Compare [semver](https://semver.org/) version strings using the specified operator.
50
+ *
51
+ * @param v1 First version to compare
52
+ * @param v2 Second version to compare
53
+ * @param operator Allowed arithmetic operator to use
54
+ * @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.
55
+ *
56
+ * @example
57
+ * ```
58
+ * compare('10.1.8', '10.0.4', '>'); // return true
59
+ * compare('10.0.1', '10.0.1', '='); // return true
60
+ * compare('10.1.1', '10.2.2', '<'); // return true
61
+ * compare('10.1.1', '10.2.2', '<='); // return true
62
+ * compare('10.1.1', '10.2.2', '>='); // return false
63
+ * ```
64
+ */
65
+ export var compare = function compare(v1, v2, operator) {
66
+ var _context;
67
+ // validate input operator
68
+ assertValidOperator(operator);
69
+ // since result of compareVersions can only be -1 or 0 or 1
70
+ // a simple map can be used to replace switch
71
+ var res = compareVersions(v1, v2);
72
+ return _includesInstanceProperty(_context = operatorResMap[operator]).call(_context, res);
73
+ };
74
+ /**
75
+ * Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
76
+ *
77
+ * @param version Version number to match
78
+ * @param range Range pattern for version
79
+ * @returns `true` if the version number is within the range, `false` otherwise.
80
+ *
81
+ * @example
82
+ * ```
83
+ * satisfies('1.1.0', '^1.0.0'); // return true
84
+ * satisfies('1.1.0', '~1.0.0'); // return false
85
+ * ```
86
+ */
87
+ export var satisfies = function satisfies(version, range) {
88
+ // if no range operator then "="
89
+ var m = range.match(/^([<>=~^]+)/);
90
+ var op = m ? m[1] : '=';
91
+ // if gt/lt/eq then operator compare
92
+ if (op !== '^' && op !== '~') return compare(version, range, op);
93
+ // else range of either "~" or "^" is assumed
94
+ var _validateAndParse = validateAndParse(version),
95
+ _validateAndParse2 = _slicedToArray(_validateAndParse, 3),
96
+ v1 = _validateAndParse2[0],
97
+ v2 = _validateAndParse2[1],
98
+ v3 = _validateAndParse2[2];
99
+ var _validateAndParse3 = validateAndParse(range),
100
+ _validateAndParse4 = _slicedToArray(_validateAndParse3, 3),
101
+ r1 = _validateAndParse4[0],
102
+ r2 = _validateAndParse4[1],
103
+ r3 = _validateAndParse4[2];
104
+ if (compareStrings(v1, r1) !== 0) return false;
105
+ if (op === '^') {
106
+ return compareSegments([v2, v3], [r2, r3]) >= 0;
107
+ }
108
+ if (compareStrings(v2, r2) !== 0) return false;
109
+ return compareStrings(v3, r3) >= 0;
110
+ };
111
+ var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
112
+ var validateAndParse = function validateAndParse(version) {
113
+ if (typeof version !== 'string') {
114
+ throw new TypeError('Invalid argument expected string');
115
+ }
116
+ var match = version.match(semver);
117
+ if (!match) {
118
+ throw new Error("Invalid argument not valid semver ('".concat(version, "' received)"));
119
+ }
120
+ match.shift();
121
+ return match;
122
+ };
123
+ var isWildcard = function isWildcard(s) {
124
+ return s === '*' || s === 'x' || s === 'X';
125
+ };
126
+ var tryParse = function tryParse(v) {
127
+ var n = _parseInt(v, 10);
128
+ return isNaN(n) ? v : n;
129
+ };
130
+ var forceType = function forceType(a, b) {
131
+ return _typeof(a) !== _typeof(b) ? [String(a), String(b)] : [a, b];
132
+ };
133
+ var compareStrings = function compareStrings(a, b) {
134
+ if (isWildcard(a) || isWildcard(b)) return 0;
135
+ var _forceType = forceType(tryParse(a), tryParse(b)),
136
+ _forceType2 = _slicedToArray(_forceType, 2),
137
+ ap = _forceType2[0],
138
+ bp = _forceType2[1];
139
+ if (ap > bp) return 1;
140
+ if (ap < bp) return -1;
141
+ return 0;
142
+ };
143
+ var compareSegments = function compareSegments(a, b) {
144
+ for (var i = 0; i < Math.max(a.length, b.length); i++) {
145
+ var r = compareStrings(a[i] || '0', b[i] || '0');
146
+ if (r !== 0) return r;
147
+ }
148
+ return 0;
149
+ };
150
+ var operatorResMap = {
151
+ '>': [1],
152
+ '>=': [0, 1],
153
+ '=': [0],
154
+ '<=': [-1, 0],
155
+ '<': [-1]
156
+ };
157
+ var allowedOperators = _Object$keys(operatorResMap);
158
+ var assertValidOperator = function assertValidOperator(op) {
159
+ if (typeof op !== 'string') {
160
+ throw new TypeError("Invalid operator type, expected string but got ".concat(_typeof(op)));
161
+ }
162
+ if (_indexOfInstanceProperty(allowedOperators).call(allowedOperators, op) === -1) {
163
+ throw new Error("Invalid operator, expected one of ".concat(allowedOperators.join('|')));
164
+ }
165
+ };
@@ -0,0 +1,4 @@
1
+ declare function log(...args: any): any;
2
+ declare function error(...args: any): any;
3
+ declare function warn(...args: any): any;
4
+ export { log, error, warn, };
@@ -0,0 +1,44 @@
1
+ var _context, _context2, _context3;
2
+ import _bindInstanceProperty from "@babel/runtime-corejs3/core-js/instance/bind";
3
+ // 防止被应用复写console
4
+ var myconsole = {
5
+ log: function log() {},
6
+ warn: function warn() {},
7
+ error: function error() {}
8
+ };
9
+ if (window && window.console) {
10
+ myconsole = window.console;
11
+ }
12
+ if (document && document.body) {
13
+ var iframe = document.createElement('iframe');
14
+ if (iframe && iframe.contentWindow && iframe.contentWindow.console) {
15
+ iframe.style.display = 'none';
16
+ document.body.appendChild(iframe);
17
+ myconsole = iframe.contentWindow.console;
18
+ }
19
+ }
20
+ var myLog = _bindInstanceProperty(_context = myconsole.log).call(_context, myconsole);
21
+ var myWarn = _bindInstanceProperty(_context2 = myconsole.warn).call(_context2, myconsole);
22
+ var myError = _bindInstanceProperty(_context3 = myconsole.error).call(_context3, myconsole);
23
+ var style = 'color:#fff;font-weight:bold;border-radius:5px;background:#67c23a;';
24
+ var styleError = "".concat(style, "background-color:red;");
25
+ var styleWarn = "".concat(style, "background-color:orange;");
26
+ function log() {
27
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
+ args[_key] = arguments[_key];
29
+ }
30
+ return myLog("%c Yach-jssdk log: ", style, args);
31
+ }
32
+ function error() {
33
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
34
+ args[_key2] = arguments[_key2];
35
+ }
36
+ return myWarn("%c Yach-jssdk log: ", styleError, args);
37
+ }
38
+ function warn() {
39
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
40
+ args[_key3] = arguments[_key3];
41
+ }
42
+ return myError("%c Yach-jssdk log: ", styleWarn, args);
43
+ }
44
+ export { log, error, warn };
@@ -0,0 +1,3 @@
1
+ import { IENV } from '../lib/sdk/sdk.typings';
2
+ declare function getENV(): IENV;
3
+ export { getENV };
@@ -0,0 +1,45 @@
1
+ import { ENV_ENUM } from '../lib/sdk/sdk.typings';
2
+ function getUA() {
3
+ return typeof navigator !== 'undefined' ? navigator.userAgent : '';
4
+ }
5
+ function getENV() {
6
+ var ua = getUA(),
7
+ inYach = /Yach/i.test(ua),
8
+ inIOS = /iPhone|iPad|iPod|iOS/i.test(ua) && inYach,
9
+ inAndroid = /Android/i.test(ua) && inYach,
10
+ inPC = /YachPc/i.test(ua),
11
+ inIpad = /iPad/i.test(ua) && inYach,
12
+ inIPhone = /iPhone/i.test(ua) && inYach,
13
+ isTest = /Yachtest/.test(ua) && inYach;
14
+ // platform
15
+ var platform = ENV_ENUM.notInYach;
16
+ if (inIOS) {
17
+ platform = ENV_ENUM.ios;
18
+ }
19
+ if (inAndroid) {
20
+ platform = ENV_ENUM.android;
21
+ }
22
+ if (inPC) {
23
+ platform = ENV_ENUM.pc;
24
+ }
25
+ // version
26
+ var versionArr = ua.match(/Yach\/[a-zA-Z0-9.-]+/) || [];
27
+ var version = (versionArr[0] || '').split('/')[1] || '';
28
+ // language
29
+ var language = typeof navigator !== 'undefined' ? navigator.language : '*';
30
+ return {
31
+ platform: platform,
32
+ platformV2: {
33
+ inYach: inYach,
34
+ inIOS: inIOS,
35
+ inAndroid: inAndroid,
36
+ inPC: inPC,
37
+ inIpad: inIpad,
38
+ inIPhone: inIPhone
39
+ },
40
+ version: version,
41
+ language: language,
42
+ env: isTest ? 'test' : 'online'
43
+ };
44
+ }
45
+ export { getENV };
@@ -0,0 +1,4 @@
1
+ import { getENV } from './env';
2
+ import { log, error, warn } from './console';
3
+ declare function staticsLog(config: object): void;
4
+ export { log, error, warn, staticsLog as bpitLog, getENV, };