yach.open.jssdk 4.3.0-beta2 → 4.3.1-beta

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 (276) hide show
  1. package/dist/yach_jssdk_4.1.32-bata.1.js +1 -0
  2. package/es/api/app/custom/talYoungFilesUpload.js +2 -0
  3. package/es/api/biz/chat/chooseConversationByCorpId.js +2 -0
  4. package/es/api/biz/chat/openSingleChat.js +2 -0
  5. package/es/api/biz/chat/openSquad.js +2 -0
  6. package/es/api/biz/chat/openTeamChat.js +2 -0
  7. package/es/api/biz/chat/pickConversation.js +2 -0
  8. package/es/api/biz/chat/sendP2PMsg.js +2 -0
  9. package/es/api/biz/contact/complexPicker.js +2 -0
  10. package/es/api/biz/contact/departmentsPicker.js +2 -0
  11. package/es/api/biz/group/groupComplexPicker.js +2 -0
  12. package/es/api/biz/map/multipointView.js +2 -0
  13. package/es/api/biz/map/view.js +2 -0
  14. package/es/api/biz/navigation/close.js +2 -0
  15. package/es/api/biz/navigation/goBack.js +2 -0
  16. package/es/api/biz/navigation/quit.js +2 -0
  17. package/es/api/biz/navigation/replace.js +2 -0
  18. package/es/api/biz/navigation/setIcon.js +2 -0
  19. package/es/api/biz/navigation/setLeft.js +2 -0
  20. package/es/api/biz/navigation/setMenu.js +2 -0
  21. package/es/api/biz/navigation/setRight.js +2 -0
  22. package/es/api/biz/navigation/setTitle.js +2 -0
  23. package/es/api/biz/navigation/setTitleExpandIcon.js +2 -0
  24. package/es/api/biz/navigation/setWindowBig.js +2 -0
  25. package/es/api/biz/navigation/tencentMeeting.js +2 -0
  26. package/es/api/biz/navigation/tencentMeetingBegin.js +2 -0
  27. package/es/api/biz/navigation/updateExpandTitle.js +2 -0
  28. package/es/api/biz/telephone/call.js +2 -0
  29. package/es/api/biz/telephone/showCallMenu.js +2 -0
  30. package/es/api/biz/util/authFinish.js +2 -0
  31. package/es/api/biz/util/authStart.js +2 -0
  32. package/es/api/biz/util/chosen.js +2 -0
  33. package/es/api/biz/util/clipboardFileUpload.js +2 -0
  34. package/es/api/biz/util/closeWindow.js +2 -0
  35. package/es/api/biz/util/complain.js +2 -0
  36. package/es/api/biz/util/createModifySchedule.js +2 -0
  37. package/es/api/biz/util/datepicker.js +2 -0
  38. package/es/api/biz/util/datetimepicker.js +2 -0
  39. package/es/api/biz/util/downloadFile.js +2 -0
  40. package/es/api/biz/util/entergroupCheck.js +3 -1
  41. package/es/api/biz/util/externalLinkPreviewFile.js +2 -0
  42. package/es/api/biz/util/feedback.js +2 -0
  43. package/es/api/biz/util/getSingleWebviewData.js +2 -0
  44. package/es/api/biz/util/getTogetherConfig.js +2 -0
  45. package/es/api/biz/util/getToken.js +2 -0
  46. package/es/api/biz/util/injectScript.js +2 -0
  47. package/es/api/biz/util/invoice.js +2 -0
  48. package/es/api/biz/util/mediaFileUpload.js +2 -0
  49. package/es/api/biz/util/onlineDocmentOpenTeamChat.js +2 -0
  50. package/es/api/biz/util/open.js +2 -0
  51. package/es/api/biz/util/openLink.js +2 -0
  52. package/es/api/biz/util/openMediaFileDialog.js +2 -0
  53. package/es/api/biz/util/openSingleWebview.js +2 -0
  54. package/es/api/biz/util/openSlidePanel.js +2 -0
  55. package/es/api/biz/util/openTalYoungToTopic.js +2 -0
  56. package/es/api/biz/util/openTogetherEyeWebview.js +2 -0
  57. package/es/api/biz/util/openUserSchedule.js +2 -0
  58. package/es/api/biz/util/openVideoPlayer.js +2 -0
  59. package/es/api/biz/util/previewFile.js +2 -0
  60. package/es/api/biz/util/previewImage.js +2 -0
  61. package/es/api/biz/util/proxy.js +2 -0
  62. package/es/api/biz/util/pushWorkMsg.js +2 -0
  63. package/es/api/biz/util/remind.js +2 -0
  64. package/es/api/biz/util/rouseApp.js +2 -0
  65. package/es/api/biz/util/savePic.js +2 -0
  66. package/es/api/biz/util/scan.js +2 -0
  67. package/es/api/biz/util/selectDepartment.js +2 -0
  68. package/es/api/biz/util/share.js +2 -0
  69. package/es/api/biz/util/takePicture.js +2 -0
  70. package/es/api/biz/util/uploadAttachment.js +2 -0
  71. package/es/api/biz/util/zfbAuth.js +2 -0
  72. package/es/api/biz/webViewMessage/send.js +2 -0
  73. package/es/api/device/audio/download.js +2 -0
  74. package/es/api/device/audio/onPlayEnd.js +2 -0
  75. package/es/api/device/audio/onRecordEnd.js +2 -0
  76. package/es/api/device/audio/onRecordEnd_v2.js +2 -0
  77. package/es/api/device/audio/pause.js +2 -0
  78. package/es/api/device/audio/play.js +2 -0
  79. package/es/api/device/audio/resume.js +2 -0
  80. package/es/api/device/audio/startRecord.js +2 -0
  81. package/es/api/device/audio/startRecord_v2.js +2 -0
  82. package/es/api/device/audio/stop.js +2 -0
  83. package/es/api/device/audio/stopRecord.js +2 -0
  84. package/es/api/device/audio/stopRecord_v2.js +2 -0
  85. package/es/api/device/base/checkStepPermission.js +2 -0
  86. package/es/api/device/base/getPhoneInfo.js +2 -0
  87. package/es/api/device/base/getUUID.js +3 -5
  88. package/es/api/device/connection/getNetworkType.js +2 -0
  89. package/es/api/device/connection/isAtTal.js +4 -2
  90. package/es/api/device/geolocation/get.js +2 -0
  91. package/es/api/device/geolocation/getSwitch.js +2 -0
  92. package/es/api/device/notification/actionSheet.js +2 -0
  93. package/es/api/device/notification/alert.js +2 -0
  94. package/es/api/device/notification/confirm.js +2 -0
  95. package/es/api/device/notification/hidePreloader.js +2 -0
  96. package/es/api/device/notification/showPreloader.js +2 -0
  97. package/es/api/device/notification/toast.js +2 -0
  98. package/es/api/device/notification/vibrate.js +2 -0
  99. package/es/api/device/system/getLang.js +2 -0
  100. package/es/api/device/system/setLight.js +2 -0
  101. package/es/api/initAPI.js +5 -3
  102. package/es/api/primary/createTab.js +2 -0
  103. package/es/api/primary/exitFullScreen.js +2 -0
  104. package/es/api/primary/fullScreen.js +2 -0
  105. package/es/api/primary/weeklyShare.js +2 -0
  106. package/es/api/runtime/permission/requestAuthCode.js +2 -0
  107. package/es/api/ui/pullToRefresh/disable.js +2 -0
  108. package/es/api/ui/pullToRefresh/enable.js +2 -0
  109. package/es/api/ui/pullToRefresh/stop.js +2 -0
  110. package/es/api/ui/webViewBounce/disable.js +2 -0
  111. package/es/api/util/domainStorage/getItem.js +2 -0
  112. package/es/api/util/domainStorage/removeItem.js +2 -0
  113. package/es/api/util/domainStorage/setItem.js +2 -0
  114. package/es/api/util/tool/flushLog.js +2 -0
  115. package/es/api/util/tool/log.js +2 -0
  116. package/es/index.d.ts +1 -7
  117. package/es/index.js +27 -22
  118. package/es/lib/bridge/mobile.js +19 -4
  119. package/es/lib/bridge/pc.js +11 -2
  120. package/es/lib/helper/apiHelper.js +2 -0
  121. package/es/lib/helper/codeMap.js +2 -0
  122. package/es/lib/helper/event.js +13 -0
  123. package/es/lib/helper/pcIframe.js +43 -12
  124. package/es/lib/index.js +21 -7
  125. package/es/lib/sdk/index.js +37 -18
  126. package/es/lib/sdk/sdk.typings.js +1 -0
  127. package/es/utils/bpitLog.js +13 -4
  128. package/es/utils/compareVersions.js +50 -23
  129. package/es/utils/console.js +15 -0
  130. package/es/utils/env.js +18 -11
  131. package/es/utils/index.js +5 -0
  132. package/libs/api/app/custom/talYoungFilesUpload.js +6 -1
  133. package/libs/api/biz/chat/chooseConversationByCorpId.js +6 -0
  134. package/libs/api/biz/chat/openSingleChat.js +6 -0
  135. package/libs/api/biz/chat/openSquad.js +6 -0
  136. package/libs/api/biz/chat/openTeamChat.js +6 -0
  137. package/libs/api/biz/chat/pickConversation.js +6 -0
  138. package/libs/api/biz/chat/sendP2PMsg.js +6 -0
  139. package/libs/api/biz/contact/complexPicker.js +6 -0
  140. package/libs/api/biz/contact/departmentsPicker.js +6 -0
  141. package/libs/api/biz/group/groupComplexPicker.js +6 -0
  142. package/libs/api/biz/map/multipointView.js +6 -0
  143. package/libs/api/biz/map/view.js +6 -0
  144. package/libs/api/biz/navigation/close.js +6 -0
  145. package/libs/api/biz/navigation/goBack.js +6 -0
  146. package/libs/api/biz/navigation/quit.js +6 -0
  147. package/libs/api/biz/navigation/replace.js +6 -0
  148. package/libs/api/biz/navigation/setIcon.js +7 -0
  149. package/libs/api/biz/navigation/setLeft.js +7 -0
  150. package/libs/api/biz/navigation/setMenu.js +7 -0
  151. package/libs/api/biz/navigation/setRight.js +7 -0
  152. package/libs/api/biz/navigation/setTitle.js +6 -0
  153. package/libs/api/biz/navigation/setTitleExpandIcon.js +7 -0
  154. package/libs/api/biz/navigation/setWindowBig.js +6 -1
  155. package/libs/api/biz/navigation/tencentMeeting.js +6 -0
  156. package/libs/api/biz/navigation/tencentMeetingBegin.js +6 -0
  157. package/libs/api/biz/navigation/updateExpandTitle.js +6 -0
  158. package/libs/api/biz/telephone/call.js +6 -0
  159. package/libs/api/biz/telephone/showCallMenu.js +6 -0
  160. package/libs/api/biz/util/authFinish.js +6 -0
  161. package/libs/api/biz/util/authStart.js +6 -0
  162. package/libs/api/biz/util/chosen.js +6 -0
  163. package/libs/api/biz/util/clipboardFileUpload.js +6 -0
  164. package/libs/api/biz/util/closeWindow.js +6 -0
  165. package/libs/api/biz/util/complain.js +6 -0
  166. package/libs/api/biz/util/createModifySchedule.js +6 -0
  167. package/libs/api/biz/util/datepicker.js +6 -0
  168. package/libs/api/biz/util/datetimepicker.js +6 -0
  169. package/libs/api/biz/util/downloadFile.js +6 -0
  170. package/libs/api/biz/util/entergroupCheck.js +7 -1
  171. package/libs/api/biz/util/externalLinkPreviewFile.js +6 -0
  172. package/libs/api/biz/util/feedback.js +6 -0
  173. package/libs/api/biz/util/getSingleWebviewData.js +6 -0
  174. package/libs/api/biz/util/getTogetherConfig.js +6 -0
  175. package/libs/api/biz/util/getToken.js +6 -0
  176. package/libs/api/biz/util/injectScript.js +6 -0
  177. package/libs/api/biz/util/invoice.js +6 -1
  178. package/libs/api/biz/util/mediaFileUpload.js +6 -1
  179. package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +6 -0
  180. package/libs/api/biz/util/open.js +6 -0
  181. package/libs/api/biz/util/openLink.js +6 -0
  182. package/libs/api/biz/util/openMediaFileDialog.js +6 -1
  183. package/libs/api/biz/util/openSingleWebview.js +6 -0
  184. package/libs/api/biz/util/openSlidePanel.js +6 -0
  185. package/libs/api/biz/util/openTalYoungToTopic.js +6 -1
  186. package/libs/api/biz/util/openTogetherEyeWebview.js +6 -0
  187. package/libs/api/biz/util/openUserSchedule.js +6 -0
  188. package/libs/api/biz/util/openVideoPlayer.js +6 -0
  189. package/libs/api/biz/util/previewFile.js +6 -0
  190. package/libs/api/biz/util/previewImage.js +6 -0
  191. package/libs/api/biz/util/proxy.js +6 -0
  192. package/libs/api/biz/util/pushWorkMsg.js +6 -1
  193. package/libs/api/biz/util/remind.js +6 -0
  194. package/libs/api/biz/util/rouseApp.js +6 -1
  195. package/libs/api/biz/util/savePic.js +6 -0
  196. package/libs/api/biz/util/scan.js +6 -0
  197. package/libs/api/biz/util/selectDepartment.js +6 -0
  198. package/libs/api/biz/util/share.js +6 -0
  199. package/libs/api/biz/util/takePicture.js +6 -0
  200. package/libs/api/biz/util/uploadAttachment.js +6 -0
  201. package/libs/api/biz/util/zfbAuth.js +6 -0
  202. package/libs/api/biz/webViewMessage/send.js +6 -0
  203. package/libs/api/device/audio/download.js +6 -0
  204. package/libs/api/device/audio/onPlayEnd.js +6 -0
  205. package/libs/api/device/audio/onRecordEnd.js +6 -0
  206. package/libs/api/device/audio/onRecordEnd_v2.js +6 -0
  207. package/libs/api/device/audio/pause.js +6 -0
  208. package/libs/api/device/audio/play.js +6 -0
  209. package/libs/api/device/audio/resume.js +6 -0
  210. package/libs/api/device/audio/startRecord.js +6 -0
  211. package/libs/api/device/audio/startRecord_v2.js +6 -0
  212. package/libs/api/device/audio/stop.js +6 -0
  213. package/libs/api/device/audio/stopRecord.js +6 -0
  214. package/libs/api/device/audio/stopRecord_v2.js +6 -0
  215. package/libs/api/device/base/checkStepPermission.js +6 -0
  216. package/libs/api/device/base/getPhoneInfo.js +6 -0
  217. package/libs/api/device/base/getUUID.js +7 -5
  218. package/libs/api/device/connection/getNetworkType.js +6 -0
  219. package/libs/api/device/connection/isAtTal.js +8 -2
  220. package/libs/api/device/geolocation/get.js +6 -0
  221. package/libs/api/device/geolocation/getSwitch.js +6 -0
  222. package/libs/api/device/notification/actionSheet.js +6 -0
  223. package/libs/api/device/notification/alert.js +6 -0
  224. package/libs/api/device/notification/confirm.js +6 -0
  225. package/libs/api/device/notification/hidePreloader.js +6 -0
  226. package/libs/api/device/notification/showPreloader.js +6 -0
  227. package/libs/api/device/notification/toast.js +6 -0
  228. package/libs/api/device/notification/vibrate.js +6 -0
  229. package/libs/api/device/system/getLang.js +6 -0
  230. package/libs/api/device/system/setLight.js +6 -0
  231. package/libs/api/initAPI.js +13 -4
  232. package/libs/api/primary/createTab.js +6 -0
  233. package/libs/api/primary/exitFullScreen.js +6 -0
  234. package/libs/api/primary/fullScreen.js +6 -0
  235. package/libs/api/primary/weeklyShare.js +6 -0
  236. package/libs/api/runtime/permission/requestAuthCode.js +6 -0
  237. package/libs/api/ui/pullToRefresh/disable.js +6 -0
  238. package/libs/api/ui/pullToRefresh/enable.js +6 -0
  239. package/libs/api/ui/pullToRefresh/stop.js +6 -0
  240. package/libs/api/ui/webViewBounce/disable.js +6 -0
  241. package/libs/api/util/domainStorage/getItem.js +6 -0
  242. package/libs/api/util/domainStorage/removeItem.js +6 -0
  243. package/libs/api/util/domainStorage/setItem.js +6 -0
  244. package/libs/api/util/tool/flushLog.js +6 -0
  245. package/libs/api/util/tool/log.js +6 -0
  246. package/libs/index.d.ts +1 -7
  247. package/libs/index.js +271 -37
  248. package/libs/lib/bridge/index.js +7 -0
  249. package/libs/lib/bridge/mobile.js +39 -7
  250. package/libs/lib/bridge/pc.js +25 -5
  251. package/libs/lib/helper/apiHelper.js +6 -0
  252. package/libs/lib/helper/codeMap.js +6 -0
  253. package/libs/lib/helper/event.js +22 -1
  254. package/libs/lib/helper/pcIframe.js +49 -11
  255. package/libs/lib/index.js +32 -8
  256. package/libs/lib/sdk/index.js +47 -19
  257. package/libs/lib/sdk/sdk.typings.js +4 -0
  258. package/libs/utils/bpitLog.js +16 -4
  259. package/libs/utils/compareVersions.js +72 -27
  260. package/libs/utils/console.js +16 -0
  261. package/libs/utils/env.js +20 -11
  262. package/libs/utils/index.js +13 -0
  263. package/package.json +1 -1
  264. package/dist/yach_jssdk_4.3.0-beta2.js +0 -1
  265. package/es/api/biz/util/assistantCreate.d.ts +0 -11
  266. package/es/api/biz/util/assistantCreate.js +0 -23
  267. package/es/api/biz/util/disableScreenCapture.d.ts +0 -8
  268. package/es/api/biz/util/disableScreenCapture.js +0 -19
  269. package/es/api/biz/util/yachEvent.d.ts +0 -12
  270. package/es/api/biz/util/yachEvent.js +0 -27
  271. package/libs/api/biz/util/assistantCreate.d.ts +0 -11
  272. package/libs/api/biz/util/assistantCreate.js +0 -30
  273. package/libs/api/biz/util/disableScreenCapture.d.ts +0 -8
  274. package/libs/api/biz/util/disableScreenCapture.js +0 -26
  275. package/libs/api/biz/util/yachEvent.d.ts +0 -12
  276. package/libs/api/biz/util/yachEvent.js +0 -34
@@ -4,6 +4,7 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/i
4
4
  import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
5
5
  import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
6
6
  import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
7
+
7
8
  /**
8
9
  * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
9
10
  * 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`.
@@ -14,19 +15,20 @@ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/in
14
15
  export var compareVersions = function compareVersions(v1, v2) {
15
16
  // validate input and split into segments
16
17
  var n1 = validateAndParse(v1);
17
- var n2 = validateAndParse(v2);
18
- // pop off the patch
18
+ var n2 = validateAndParse(v2); // pop off the patch
19
+
19
20
  var p1 = n1.pop();
20
- var p2 = n2.pop();
21
- // validate numbers
21
+ var p2 = n2.pop(); // validate numbers
22
+
22
23
  var r = compareSegments(n1, n2);
23
- if (r !== 0) return r;
24
- // validate pre-release
24
+ if (r !== 0) return r; // validate pre-release
25
+
25
26
  if (p1 && p2) {
26
27
  return compareSegments(p1.split('.'), p2.split('.'));
27
28
  } else if (p1 || p2) {
28
29
  return p1 ? -1 : 1;
29
30
  }
31
+
30
32
  return 0;
31
33
  };
32
34
  /**
@@ -42,6 +44,7 @@ export var compareVersions = function compareVersions(v1, v2) {
42
44
  * validate('foo'); // return false
43
45
  * ```
44
46
  */
47
+
45
48
  export var validate = function validate(version) {
46
49
  return typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
47
50
  };
@@ -62,12 +65,14 @@ export var validate = function validate(version) {
62
65
  * compare('10.1.1', '10.2.2', '>='); // return false
63
66
  * ```
64
67
  */
68
+
65
69
  export var compare = function compare(v1, v2, operator) {
66
70
  var _context;
71
+
67
72
  // validate input operator
68
- assertValidOperator(operator);
69
- // since result of compareVersions can only be -1 or 0 or 1
73
+ assertValidOperator(operator); // since result of compareVersions can only be -1 or 0 or 1
70
74
  // a simple map can be used to replace switch
75
+
71
76
  var res = compareVersions(v1, v2);
72
77
  return _includesInstanceProperty(_context = operatorResMap[operator]).call(_context, res);
73
78
  };
@@ -84,69 +89,88 @@ export var compare = function compare(v1, v2, operator) {
84
89
  * satisfies('1.1.0', '~1.0.0'); // return false
85
90
  * ```
86
91
  */
92
+
87
93
  export var satisfies = function satisfies(version, range) {
88
94
  // if no range operator then "="
89
95
  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
96
+ var op = m ? m[1] : '='; // if gt/lt/eq then operator compare
97
+
98
+ if (op !== '^' && op !== '~') return compare(version, range, op); // else range of either "~" or "^" is assumed
99
+
94
100
  var _validateAndParse = validateAndParse(version),
95
- _validateAndParse2 = _slicedToArray(_validateAndParse, 3),
96
- v1 = _validateAndParse2[0],
97
- v2 = _validateAndParse2[1],
98
- v3 = _validateAndParse2[2];
101
+ _validateAndParse2 = _slicedToArray(_validateAndParse, 3),
102
+ v1 = _validateAndParse2[0],
103
+ v2 = _validateAndParse2[1],
104
+ v3 = _validateAndParse2[2];
105
+
99
106
  var _validateAndParse3 = validateAndParse(range),
100
- _validateAndParse4 = _slicedToArray(_validateAndParse3, 3),
101
- r1 = _validateAndParse4[0],
102
- r2 = _validateAndParse4[1],
103
- r3 = _validateAndParse4[2];
107
+ _validateAndParse4 = _slicedToArray(_validateAndParse3, 3),
108
+ r1 = _validateAndParse4[0],
109
+ r2 = _validateAndParse4[1],
110
+ r3 = _validateAndParse4[2];
111
+
104
112
  if (compareStrings(v1, r1) !== 0) return false;
113
+
105
114
  if (op === '^') {
106
115
  return compareSegments([v2, v3], [r2, r3]) >= 0;
107
116
  }
117
+
108
118
  if (compareStrings(v2, r2) !== 0) return false;
109
119
  return compareStrings(v3, r3) >= 0;
110
120
  };
111
121
  var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
122
+
112
123
  var validateAndParse = function validateAndParse(version) {
113
124
  if (typeof version !== 'string') {
114
125
  throw new TypeError('Invalid argument expected string');
115
126
  }
127
+
116
128
  var match = version.match(semver);
129
+
117
130
  if (!match) {
118
131
  throw new Error("Invalid argument not valid semver ('".concat(version, "' received)"));
119
132
  }
133
+
120
134
  match.shift();
121
135
  return match;
122
136
  };
137
+
123
138
  var isWildcard = function isWildcard(s) {
124
139
  return s === '*' || s === 'x' || s === 'X';
125
140
  };
141
+
126
142
  var tryParse = function tryParse(v) {
127
143
  var n = _parseInt(v, 10);
144
+
128
145
  return isNaN(n) ? v : n;
129
146
  };
147
+
130
148
  var forceType = function forceType(a, b) {
131
149
  return _typeof(a) !== _typeof(b) ? [String(a), String(b)] : [a, b];
132
150
  };
151
+
133
152
  var compareStrings = function compareStrings(a, b) {
134
153
  if (isWildcard(a) || isWildcard(b)) return 0;
154
+
135
155
  var _forceType = forceType(tryParse(a), tryParse(b)),
136
- _forceType2 = _slicedToArray(_forceType, 2),
137
- ap = _forceType2[0],
138
- bp = _forceType2[1];
156
+ _forceType2 = _slicedToArray(_forceType, 2),
157
+ ap = _forceType2[0],
158
+ bp = _forceType2[1];
159
+
139
160
  if (ap > bp) return 1;
140
161
  if (ap < bp) return -1;
141
162
  return 0;
142
163
  };
164
+
143
165
  var compareSegments = function compareSegments(a, b) {
144
166
  for (var i = 0; i < Math.max(a.length, b.length); i++) {
145
167
  var r = compareStrings(a[i] || '0', b[i] || '0');
146
168
  if (r !== 0) return r;
147
169
  }
170
+
148
171
  return 0;
149
172
  };
173
+
150
174
  var operatorResMap = {
151
175
  '>': [1],
152
176
  '>=': [0, 1],
@@ -154,11 +178,14 @@ var operatorResMap = {
154
178
  '<=': [-1, 0],
155
179
  '<': [-1]
156
180
  };
181
+
157
182
  var allowedOperators = _Object$keys(operatorResMap);
183
+
158
184
  var assertValidOperator = function assertValidOperator(op) {
159
185
  if (typeof op !== 'string') {
160
186
  throw new TypeError("Invalid operator type, expected string but got ".concat(_typeof(op)));
161
187
  }
188
+
162
189
  if (_indexOfInstanceProperty(allowedOperators).call(allowedOperators, op) === -1) {
163
190
  throw new Error("Invalid operator, expected one of ".concat(allowedOperators.join('|')));
164
191
  }
@@ -1,4 +1,5 @@
1
1
  var _context, _context2, _context3;
2
+
2
3
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js/instance/bind";
3
4
  // 防止被应用复写console
4
5
  var myconsole = {
@@ -6,39 +7,53 @@ var myconsole = {
6
7
  warn: function warn() {},
7
8
  error: function error() {}
8
9
  };
10
+
9
11
  if (window && window.console) {
10
12
  myconsole = window.console;
11
13
  }
14
+
12
15
  if (document && document.body) {
13
16
  var iframe = document.createElement('iframe');
17
+
14
18
  if (iframe && iframe.contentWindow && iframe.contentWindow.console) {
15
19
  iframe.style.display = 'none';
16
20
  document.body.appendChild(iframe);
17
21
  myconsole = iframe.contentWindow.console;
18
22
  }
19
23
  }
24
+
20
25
  var myLog = _bindInstanceProperty(_context = myconsole.log).call(_context, myconsole);
26
+
21
27
  var myWarn = _bindInstanceProperty(_context2 = myconsole.warn).call(_context2, myconsole);
28
+
22
29
  var myError = _bindInstanceProperty(_context3 = myconsole.error).call(_context3, myconsole);
30
+
23
31
  var style = 'color:#fff;font-weight:bold;border-radius:5px;background:#67c23a;';
24
32
  var styleError = "".concat(style, "background-color:red;");
25
33
  var styleWarn = "".concat(style, "background-color:orange;");
34
+
26
35
  function log() {
27
36
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
37
  args[_key] = arguments[_key];
29
38
  }
39
+
30
40
  return myLog("%c Yach-jssdk log: ", style, args);
31
41
  }
42
+
32
43
  function error() {
33
44
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
34
45
  args[_key2] = arguments[_key2];
35
46
  }
47
+
36
48
  return myWarn("%c Yach-jssdk log: ", styleError, args);
37
49
  }
50
+
38
51
  function warn() {
39
52
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
40
53
  args[_key3] = arguments[_key3];
41
54
  }
55
+
42
56
  return myError("%c Yach-jssdk log: ", styleWarn, args);
43
57
  }
58
+
44
59
  export { log, error, warn };
package/es/utils/env.js CHANGED
@@ -1,30 +1,36 @@
1
1
  import { ENV_ENUM } from '../lib/sdk/sdk.typings';
2
+
2
3
  function getUA() {
3
4
  return typeof navigator !== 'undefined' ? navigator.userAgent : '';
4
5
  }
6
+
5
7
  function getENV() {
6
8
  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
- // platform
9
+ inYach = /Yach/i.test(ua),
10
+ inIOS = /iPhone|iPad|iPod|iOS/i.test(ua) && inYach,
11
+ inAndroid = /Android/i.test(ua) && inYach,
12
+ inPC = /YachPc/i.test(ua),
13
+ inIpad = /iPad/i.test(ua) && inYach,
14
+ inIPhone = /iPhone/i.test(ua) && inYach; // platform
15
+
14
16
  var platform = ENV_ENUM.notInYach;
17
+
15
18
  if (inIOS) {
16
19
  platform = ENV_ENUM.ios;
17
20
  }
21
+
18
22
  if (inAndroid) {
19
23
  platform = ENV_ENUM.android;
20
24
  }
25
+
21
26
  if (inPC) {
22
27
  platform = ENV_ENUM.pc;
23
- }
24
- // version
28
+ } // version
29
+
30
+
25
31
  var versionArr = ua.match(/Yach\/[a-zA-Z0-9.-]+/) || [];
26
- var version = (versionArr[0] || '').split('/')[1] || '';
27
- // language
32
+ var version = (versionArr[0] || '').split('/')[1] || ''; // language
33
+
28
34
  var language = typeof navigator !== 'undefined' ? navigator.language : '*';
29
35
  return {
30
36
  platform: platform,
@@ -40,4 +46,5 @@ function getENV() {
40
46
  language: language
41
47
  };
42
48
  }
49
+
43
50
  export { getENV };
package/es/utils/index.js CHANGED
@@ -3,10 +3,13 @@ import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
3
3
  import { getENV } from './env';
4
4
  import bpitLog from './bpitLog';
5
5
  import { log, error, warn } from './console';
6
+
6
7
  function staticsLog(config) {
7
8
  var env = 'test';
8
9
  var version = getENV().version;
10
+
9
11
  var timestamp = _Date$now();
12
+
10
13
  var params = _Object$assign({
11
14
  group: 'yach',
12
15
  project: 'yach_31_jssdk',
@@ -14,7 +17,9 @@ function staticsLog(config) {
14
17
  version: version,
15
18
  timestamp: timestamp
16
19
  }, config);
20
+
17
21
  console.log('jssdk 项目 bpit 上报数据:', params);
18
22
  bpitLog(params);
19
23
  }
24
+
20
25
  export { log, error, warn, staticsLog as bpitLog, getENV };
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.talYoungFilesUpload = talYoungFilesUpload;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  /*
11
16
  * @Descripttion:
12
17
  * @Author: olei<wangzheng_jzb@100tal.com>
@@ -15,8 +20,8 @@ var _initAPI = _interopRequireDefault(require("../../initAPI"));
15
20
  * @LastEditTime: 2020-09-10 16:51:44
16
21
  * yach > 1.4.7 已经废弃,目前只保留 sdk 入口兼容 yach 低版本调用
17
22
  */
18
-
19
23
  var apiName = 'app.custom.talYoungFilesUpload';
24
+
20
25
  function talYoungFilesUpload(params) {
21
26
  (0, _initAPI["default"])(apiName, {
22
27
  params: params
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.chooseConversationByCorpId = chooseConversationByCorpId;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.chat.chooseConversationByCorpId';
16
+
11
17
  function chooseConversationByCorpId(params) {
12
18
  (0, _initAPI["default"])(apiName, {
13
19
  params: params
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.openSingleChat = openSingleChat;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.chat.openSingleChat';
16
+
11
17
  function openSingleChat(params) {
12
18
  (0, _initAPI["default"])(apiName, {
13
19
  params: params
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.openSquad = openSquad;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.chat.openSquad';
16
+
11
17
  function openSquad(params) {
12
18
  (0, _initAPI["default"])(apiName, {
13
19
  params: params
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.openTeamChat = openTeamChat;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.chat.openTeamChat';
16
+
11
17
  function openTeamChat(params) {
12
18
  (0, _initAPI["default"])(apiName, {
13
19
  params: params
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.pickConversation = pickConversation;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.chat.pickConversation';
11
16
  var ios = {
12
17
  vs: '0.0.0'
@@ -18,6 +23,7 @@ var platform = {
18
23
  ios: ios,
19
24
  android: android
20
25
  };
26
+
21
27
  function pickConversation(params) {
22
28
  (0, _initAPI["default"])(apiName, {
23
29
  params: params,
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.sendP2PMsg = sendP2PMsg;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.chat.sendP2PMsg';
16
+
11
17
  function sendP2PMsg(params) {
12
18
  (0, _initAPI["default"])(apiName, {
13
19
  params: params
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.complexPicker = complexPicker;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.contact.complexPicker';
16
+
11
17
  function complexPicker(params) {
12
18
  (0, _initAPI["default"])(apiName, {
13
19
  params: params
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.departmentsPicker = departmentsPicker;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.contact.departmentsPicker';
16
+
11
17
  function departmentsPicker(params) {
12
18
  (0, _initAPI["default"])(apiName, {
13
19
  params: params
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.groupComplexPicker = groupComplexPicker;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.group.groupComplexPicker';
16
+
11
17
  function groupComplexPicker(params) {
12
18
  (0, _initAPI["default"])(apiName, {
13
19
  params: params
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.multipointView = multipointView;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.map.multipointView';
11
16
  var ios = {
12
17
  vs: '0.0.0'
@@ -18,6 +23,7 @@ var platform = {
18
23
  ios: ios,
19
24
  android: android
20
25
  };
26
+
21
27
  function multipointView(params) {
22
28
  (0, _initAPI["default"])(apiName, {
23
29
  params: params,
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.view = view;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.map.view';
11
16
  var ios = {
12
17
  vs: '0.0.0'
@@ -18,6 +23,7 @@ var platform = {
18
23
  ios: ios,
19
24
  android: android
20
25
  };
26
+
21
27
  function view(params) {
22
28
  (0, _initAPI["default"])(apiName, {
23
29
  params: params,
@@ -1,14 +1,20 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.close = close;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  ;
11
16
  var apiName = 'biz.navigation.close';
17
+
12
18
  function close(params) {
13
19
  (0, _initAPI["default"])(apiName, {
14
20
  params: params
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.goBack = goBack;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.navigation.goBack';
11
16
  var ios = {
12
17
  vs: '0.0.0'
@@ -18,6 +23,7 @@ var platform = {
18
23
  ios: ios,
19
24
  android: android
20
25
  };
26
+
21
27
  function goBack(params) {
22
28
  (0, _initAPI["default"])(apiName, {
23
29
  params: params,
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
+
4
5
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
+
5
7
  _Object$defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
10
+
8
11
  exports.quit = quit;
12
+
9
13
  var _initAPI = _interopRequireDefault(require("../../initAPI"));
14
+
10
15
  var apiName = 'biz.navigation.quit';
11
16
  var pc = {
12
17
  vs: '0.0.0'
@@ -14,6 +19,7 @@ var pc = {
14
19
  var platform = {
15
20
  pc: pc
16
21
  };
22
+
17
23
  function quit(params) {
18
24
  (0, _initAPI["default"])(apiName, {
19
25
  params: params,