yach.open.jssdk 4.4.1-beta8 → 4.4.1

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 (294) hide show
  1. package/dist/yach_jssdk_4.4.1-beta6.js +1 -0
  2. package/es/api/app/custom/talYoungFilesUpload.js +0 -2
  3. package/es/api/biz/chat/chooseConversationByCorpId.js +0 -2
  4. package/es/api/biz/chat/openSingleChat.js +0 -2
  5. package/es/api/biz/chat/openSquad.js +0 -2
  6. package/es/api/biz/chat/openTeamChat.js +0 -2
  7. package/es/api/biz/chat/pickConversation.js +0 -2
  8. package/es/api/biz/chat/sendP2PMsg.js +0 -2
  9. package/es/api/biz/contact/complexPicker.js +0 -2
  10. package/es/api/biz/contact/departmentsPicker.js +0 -2
  11. package/es/api/biz/group/groupComplexPicker.js +0 -2
  12. package/es/api/biz/map/multipointView.js +0 -2
  13. package/es/api/biz/map/view.js +0 -2
  14. package/es/api/biz/navigation/close.js +0 -2
  15. package/es/api/biz/navigation/goBack.js +0 -2
  16. package/es/api/biz/navigation/quit.js +0 -2
  17. package/es/api/biz/navigation/replace.js +0 -2
  18. package/es/api/biz/navigation/setIcon.js +0 -2
  19. package/es/api/biz/navigation/setLeft.js +0 -2
  20. package/es/api/biz/navigation/setMenu.js +0 -2
  21. package/es/api/biz/navigation/setPanGestureEnable.js +0 -2
  22. package/es/api/biz/navigation/setRight.js +0 -2
  23. package/es/api/biz/navigation/setTitle.js +0 -2
  24. package/es/api/biz/navigation/setTitleExpandIcon.js +0 -2
  25. package/es/api/biz/navigation/setWindowBig.js +0 -2
  26. package/es/api/biz/navigation/tencentMeeting.d.ts +0 -2
  27. package/es/api/biz/navigation/tencentMeeting.js +0 -2
  28. package/es/api/biz/navigation/tencentMeetingBegin.js +0 -2
  29. package/es/api/biz/navigation/updateExpandTitle.js +0 -2
  30. package/es/api/biz/telephone/call.js +0 -2
  31. package/es/api/biz/telephone/showCallMenu.js +0 -2
  32. package/es/api/biz/util/addAppToNav.js +0 -2
  33. package/es/api/biz/util/assistantCreate.js +0 -2
  34. package/es/api/biz/util/authFinish.js +0 -2
  35. package/es/api/biz/util/authStart.js +0 -2
  36. package/es/api/biz/util/chosen.js +0 -2
  37. package/es/api/biz/util/clipboardFileUpload.js +0 -2
  38. package/es/api/biz/util/closeWindow.js +0 -2
  39. package/es/api/biz/util/complain.js +0 -2
  40. package/es/api/biz/util/copy.d.ts +11 -0
  41. package/es/api/biz/util/copy.js +19 -0
  42. package/es/api/biz/util/createModifySchedule.js +0 -2
  43. package/es/api/biz/util/datepicker.js +0 -2
  44. package/es/api/biz/util/datetimepicker.js +0 -2
  45. package/es/api/biz/util/disableScreenCapture.js +0 -2
  46. package/es/api/biz/util/downloadFile.js +0 -2
  47. package/es/api/biz/util/entergroupCheck.js +0 -2
  48. package/es/api/biz/util/externalLinkPreviewFile.js +0 -2
  49. package/es/api/biz/util/feedback.js +0 -2
  50. package/es/api/biz/util/getSingleWebviewData.js +0 -2
  51. package/es/api/biz/util/getTogetherConfig.js +0 -2
  52. package/es/api/biz/util/getToken.js +0 -2
  53. package/es/api/biz/util/injectScript.js +0 -2
  54. package/es/api/biz/util/invoice.js +0 -2
  55. package/es/api/biz/util/knowledgeBaseSelect.js +0 -2
  56. package/es/api/biz/util/lorebaseRefreshNodeWebview.d.ts +11 -0
  57. package/es/api/biz/util/lorebaseRefreshNodeWebview.js +19 -0
  58. package/es/api/biz/util/lorebaseShowList.d.ts +11 -0
  59. package/es/api/biz/util/lorebaseShowList.js +19 -0
  60. package/es/api/biz/util/mediaFileUpload.js +0 -2
  61. package/es/api/biz/util/onlineDocmentOpenTeamChat.js +0 -2
  62. package/es/api/biz/util/open.js +0 -2
  63. package/es/api/biz/util/openFutureGroup.js +0 -2
  64. package/es/api/biz/util/openLink.js +0 -2
  65. package/es/api/biz/util/openMediaFileDialog.js +0 -2
  66. package/es/api/biz/util/openSingleWebview.js +0 -2
  67. package/es/api/biz/util/openSlidePanel.js +0 -2
  68. package/es/api/biz/util/openTalYoungToTopic.js +0 -2
  69. package/es/api/biz/util/openTogetherEyeWebview.js +0 -2
  70. package/es/api/biz/util/openUserSchedule.js +0 -2
  71. package/es/api/biz/util/openVideoPlayer.js +0 -2
  72. package/es/api/biz/util/previewFile.js +0 -2
  73. package/es/api/biz/util/previewImage.js +0 -2
  74. package/es/api/biz/util/proxy.js +0 -2
  75. package/es/api/biz/util/pushWorkMsg.js +0 -2
  76. package/es/api/biz/util/remind.js +0 -2
  77. package/es/api/biz/util/resetSessionUnread.js +0 -2
  78. package/es/api/biz/util/rouseApp.js +0 -2
  79. package/es/api/biz/util/savePic.js +0 -2
  80. package/es/api/biz/util/scan.js +0 -2
  81. package/es/api/biz/util/selectDepartment.js +0 -2
  82. package/es/api/biz/util/share.js +0 -2
  83. package/es/api/biz/util/takePicture.js +0 -2
  84. package/es/api/biz/util/uploadAttachment.js +0 -2
  85. package/es/api/biz/util/yachEvent.js +0 -2
  86. package/es/api/biz/util/zfbAuth.js +0 -2
  87. package/es/api/biz/webViewMessage/send.js +0 -2
  88. package/es/api/device/audio/download.js +0 -2
  89. package/es/api/device/audio/onPlayEnd.js +0 -2
  90. package/es/api/device/audio/onRecordEnd.js +0 -2
  91. package/es/api/device/audio/onRecordEnd_v2.js +0 -2
  92. package/es/api/device/audio/pause.js +0 -2
  93. package/es/api/device/audio/play.js +0 -2
  94. package/es/api/device/audio/resume.js +0 -2
  95. package/es/api/device/audio/startRecord.js +0 -2
  96. package/es/api/device/audio/startRecord_v2.js +0 -2
  97. package/es/api/device/audio/stop.js +0 -2
  98. package/es/api/device/audio/stopRecord.js +0 -2
  99. package/es/api/device/audio/stopRecord_v2.js +0 -2
  100. package/es/api/device/base/checkStepPermission.js +0 -2
  101. package/es/api/device/base/getPhoneInfo.js +0 -2
  102. package/es/api/device/base/getUUID.js +0 -2
  103. package/es/api/device/connection/getNetworkType.js +0 -2
  104. package/es/api/device/connection/isAtTal.js +2 -4
  105. package/es/api/device/geolocation/get.js +0 -2
  106. package/es/api/device/geolocation/getSwitch.js +0 -2
  107. package/es/api/device/notification/actionSheet.js +0 -2
  108. package/es/api/device/notification/alert.js +0 -2
  109. package/es/api/device/notification/confirm.js +0 -2
  110. package/es/api/device/notification/hidePreloader.js +0 -2
  111. package/es/api/device/notification/showPreloader.js +0 -2
  112. package/es/api/device/notification/toast.js +0 -2
  113. package/es/api/device/notification/vibrate.js +0 -2
  114. package/es/api/device/system/getLang.js +0 -2
  115. package/es/api/device/system/setLight.js +0 -2
  116. package/es/api/initAPI.js +3 -5
  117. package/es/api/primary/createTab.js +0 -2
  118. package/es/api/primary/exitFullScreen.js +0 -2
  119. package/es/api/primary/fullScreen.js +0 -2
  120. package/es/api/primary/weeklyShare.js +0 -2
  121. package/es/api/runtime/permission/requestAuthCode.js +0 -2
  122. package/es/api/ui/pullToRefresh/disable.js +0 -2
  123. package/es/api/ui/pullToRefresh/enable.js +0 -2
  124. package/es/api/ui/pullToRefresh/stop.js +0 -2
  125. package/es/api/ui/webViewBounce/disable.js +0 -2
  126. package/es/api/util/domainStorage/getItem.js +0 -2
  127. package/es/api/util/domainStorage/removeItem.js +0 -2
  128. package/es/api/util/domainStorage/setItem.js +0 -2
  129. package/es/api/util/tool/flushLog.js +0 -2
  130. package/es/api/util/tool/log.js +0 -2
  131. package/es/index.d.ts +7 -1
  132. package/es/index.js +22 -27
  133. package/es/lib/bridge/mobile.js +22 -27
  134. package/es/lib/bridge/pc.js +11 -18
  135. package/es/lib/helper/apiHelper.js +0 -2
  136. package/es/lib/helper/codeMap.js +0 -2
  137. package/es/lib/helper/event.js +7 -19
  138. package/es/lib/helper/pcIframe.js +21 -51
  139. package/es/lib/index.js +7 -21
  140. package/es/lib/sdk/index.js +16 -37
  141. package/es/lib/sdk/sdk.typings.js +0 -1
  142. package/es/utils/bpitLog.js +4 -13
  143. package/es/utils/compareVersions.js +26 -53
  144. package/es/utils/console.js +1 -17
  145. package/es/utils/env.js +12 -19
  146. package/es/utils/index.js +1 -6
  147. package/libs/api/app/custom/talYoungFilesUpload.js +2 -7
  148. package/libs/api/biz/chat/chooseConversationByCorpId.js +1 -7
  149. package/libs/api/biz/chat/openSingleChat.js +1 -7
  150. package/libs/api/biz/chat/openSquad.js +1 -7
  151. package/libs/api/biz/chat/openTeamChat.js +1 -7
  152. package/libs/api/biz/chat/pickConversation.js +1 -7
  153. package/libs/api/biz/chat/sendP2PMsg.js +1 -7
  154. package/libs/api/biz/contact/complexPicker.js +1 -7
  155. package/libs/api/biz/contact/departmentsPicker.js +1 -7
  156. package/libs/api/biz/group/groupComplexPicker.js +1 -7
  157. package/libs/api/biz/map/multipointView.js +1 -7
  158. package/libs/api/biz/map/view.js +1 -7
  159. package/libs/api/biz/navigation/close.js +1 -7
  160. package/libs/api/biz/navigation/goBack.js +1 -7
  161. package/libs/api/biz/navigation/quit.js +1 -7
  162. package/libs/api/biz/navigation/replace.js +1 -7
  163. package/libs/api/biz/navigation/setIcon.js +1 -8
  164. package/libs/api/biz/navigation/setLeft.js +1 -8
  165. package/libs/api/biz/navigation/setMenu.js +1 -8
  166. package/libs/api/biz/navigation/setPanGestureEnable.js +1 -8
  167. package/libs/api/biz/navigation/setRight.js +1 -8
  168. package/libs/api/biz/navigation/setTitle.js +1 -7
  169. package/libs/api/biz/navigation/setTitleExpandIcon.js +1 -8
  170. package/libs/api/biz/navigation/setWindowBig.js +2 -7
  171. package/libs/api/biz/navigation/tencentMeeting.d.ts +0 -2
  172. package/libs/api/biz/navigation/tencentMeeting.js +1 -7
  173. package/libs/api/biz/navigation/tencentMeetingBegin.js +1 -7
  174. package/libs/api/biz/navigation/updateExpandTitle.js +1 -7
  175. package/libs/api/biz/telephone/call.js +1 -7
  176. package/libs/api/biz/telephone/showCallMenu.js +1 -7
  177. package/libs/api/biz/util/addAppToNav.js +1 -7
  178. package/libs/api/biz/util/assistantCreate.js +1 -7
  179. package/libs/api/biz/util/authFinish.js +1 -7
  180. package/libs/api/biz/util/authStart.js +1 -7
  181. package/libs/api/biz/util/chosen.js +1 -7
  182. package/libs/api/biz/util/clipboardFileUpload.js +2 -8
  183. package/libs/api/biz/util/closeWindow.js +1 -7
  184. package/libs/api/biz/util/complain.js +1 -7
  185. package/libs/api/biz/util/copy.d.ts +11 -0
  186. package/libs/api/biz/util/copy.js +26 -0
  187. package/libs/api/biz/util/createModifySchedule.js +1 -7
  188. package/libs/api/biz/util/datepicker.js +1 -7
  189. package/libs/api/biz/util/datetimepicker.js +1 -7
  190. package/libs/api/biz/util/disableScreenCapture.js +1 -7
  191. package/libs/api/biz/util/downloadFile.js +1 -7
  192. package/libs/api/biz/util/entergroupCheck.js +1 -7
  193. package/libs/api/biz/util/externalLinkPreviewFile.js +1 -7
  194. package/libs/api/biz/util/feedback.js +1 -7
  195. package/libs/api/biz/util/getSingleWebviewData.js +1 -7
  196. package/libs/api/biz/util/getTogetherConfig.js +1 -7
  197. package/libs/api/biz/util/getToken.js +1 -7
  198. package/libs/api/biz/util/injectScript.js +1 -7
  199. package/libs/api/biz/util/invoice.js +2 -7
  200. package/libs/api/biz/util/knowledgeBaseSelect.js +1 -7
  201. package/libs/api/biz/util/lorebaseRefreshNodeWebview.d.ts +11 -0
  202. package/libs/api/biz/util/lorebaseRefreshNodeWebview.js +26 -0
  203. package/libs/api/biz/util/lorebaseShowList.d.ts +11 -0
  204. package/libs/api/biz/util/lorebaseShowList.js +26 -0
  205. package/libs/api/biz/util/mediaFileUpload.js +2 -7
  206. package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +1 -7
  207. package/libs/api/biz/util/open.js +1 -7
  208. package/libs/api/biz/util/openFutureGroup.js +1 -7
  209. package/libs/api/biz/util/openLink.js +1 -7
  210. package/libs/api/biz/util/openMediaFileDialog.js +2 -7
  211. package/libs/api/biz/util/openSingleWebview.js +1 -7
  212. package/libs/api/biz/util/openSlidePanel.js +1 -7
  213. package/libs/api/biz/util/openTalYoungToTopic.js +2 -7
  214. package/libs/api/biz/util/openTogetherEyeWebview.js +1 -7
  215. package/libs/api/biz/util/openUserSchedule.js +1 -7
  216. package/libs/api/biz/util/openVideoPlayer.js +1 -7
  217. package/libs/api/biz/util/previewFile.js +1 -7
  218. package/libs/api/biz/util/previewImage.js +1 -7
  219. package/libs/api/biz/util/proxy.js +1 -7
  220. package/libs/api/biz/util/pushWorkMsg.js +2 -7
  221. package/libs/api/biz/util/remind.js +1 -7
  222. package/libs/api/biz/util/resetSessionUnread.js +1 -7
  223. package/libs/api/biz/util/rouseApp.js +2 -7
  224. package/libs/api/biz/util/savePic.js +1 -7
  225. package/libs/api/biz/util/scan.js +1 -7
  226. package/libs/api/biz/util/selectDepartment.js +1 -7
  227. package/libs/api/biz/util/share.js +1 -7
  228. package/libs/api/biz/util/takePicture.js +1 -7
  229. package/libs/api/biz/util/uploadAttachment.js +1 -7
  230. package/libs/api/biz/util/yachEvent.js +1 -7
  231. package/libs/api/biz/util/zfbAuth.js +1 -7
  232. package/libs/api/biz/webViewMessage/send.js +1 -7
  233. package/libs/api/device/audio/download.js +1 -7
  234. package/libs/api/device/audio/onPlayEnd.js +1 -7
  235. package/libs/api/device/audio/onRecordEnd.js +1 -7
  236. package/libs/api/device/audio/onRecordEnd_v2.js +1 -7
  237. package/libs/api/device/audio/pause.js +1 -7
  238. package/libs/api/device/audio/play.js +1 -7
  239. package/libs/api/device/audio/resume.js +1 -7
  240. package/libs/api/device/audio/startRecord.js +1 -7
  241. package/libs/api/device/audio/startRecord_v2.js +1 -7
  242. package/libs/api/device/audio/stop.js +1 -7
  243. package/libs/api/device/audio/stopRecord.js +1 -7
  244. package/libs/api/device/audio/stopRecord_v2.js +1 -7
  245. package/libs/api/device/base/checkStepPermission.js +1 -7
  246. package/libs/api/device/base/getPhoneInfo.js +1 -7
  247. package/libs/api/device/base/getUUID.js +1 -7
  248. package/libs/api/device/connection/getNetworkType.js +1 -7
  249. package/libs/api/device/connection/isAtTal.js +3 -9
  250. package/libs/api/device/geolocation/get.js +1 -7
  251. package/libs/api/device/geolocation/getSwitch.js +1 -7
  252. package/libs/api/device/notification/actionSheet.js +1 -7
  253. package/libs/api/device/notification/alert.js +1 -7
  254. package/libs/api/device/notification/confirm.js +1 -7
  255. package/libs/api/device/notification/hidePreloader.js +1 -7
  256. package/libs/api/device/notification/showPreloader.js +1 -7
  257. package/libs/api/device/notification/toast.js +1 -7
  258. package/libs/api/device/notification/vibrate.js +1 -7
  259. package/libs/api/device/system/getLang.js +1 -7
  260. package/libs/api/device/system/setLight.js +1 -7
  261. package/libs/api/initAPI.js +4 -13
  262. package/libs/api/primary/createTab.js +1 -7
  263. package/libs/api/primary/exitFullScreen.js +1 -7
  264. package/libs/api/primary/fullScreen.js +1 -7
  265. package/libs/api/primary/weeklyShare.js +1 -7
  266. package/libs/api/runtime/permission/requestAuthCode.js +1 -7
  267. package/libs/api/ui/pullToRefresh/disable.js +1 -7
  268. package/libs/api/ui/pullToRefresh/enable.js +1 -7
  269. package/libs/api/ui/pullToRefresh/stop.js +1 -7
  270. package/libs/api/ui/webViewBounce/disable.js +1 -7
  271. package/libs/api/util/domainStorage/getItem.js +1 -7
  272. package/libs/api/util/domainStorage/removeItem.js +1 -7
  273. package/libs/api/util/domainStorage/setItem.js +1 -7
  274. package/libs/api/util/tool/flushLog.js +1 -7
  275. package/libs/api/util/tool/log.js +1 -7
  276. package/libs/index.d.ts +7 -1
  277. package/libs/index.js +281 -517
  278. package/libs/lib/bridge/index.js +6 -13
  279. package/libs/lib/bridge/mobile.js +26 -50
  280. package/libs/lib/bridge/pc.js +16 -37
  281. package/libs/lib/helper/apiHelper.js +1 -7
  282. package/libs/lib/helper/codeMap.js +1 -7
  283. package/libs/lib/helper/event.js +8 -28
  284. package/libs/lib/helper/pcIframe.js +20 -58
  285. package/libs/lib/index.js +9 -33
  286. package/libs/lib/sdk/index.js +17 -47
  287. package/libs/lib/sdk/sdk.typings.js +0 -4
  288. package/libs/utils/bpitLog.js +4 -16
  289. package/libs/utils/compareVersions.js +32 -77
  290. package/libs/utils/console.js +2 -18
  291. package/libs/utils/env.js +12 -21
  292. package/libs/utils/index.js +8 -21
  293. package/package.json +1 -1
  294. package/dist/yach_jssdk_4.4.1-beta8.js +0 -1
package/libs/lib/index.js CHANGED
@@ -1,35 +1,24 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
6
-
4
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports.initSdk = initSdk;
12
9
  exports.yachSdk = void 0;
13
-
14
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
15
-
16
11
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
17
-
18
12
  var _utils = require("../utils");
19
-
20
13
  var _sdk = _interopRequireDefault(require("./sdk"));
21
-
22
14
  var _bridge = require("./bridge");
23
-
24
15
  var _event = _interopRequireDefault(require("./helper/event"));
25
-
26
16
  var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
27
17
  function adopt(value) {
28
18
  return value instanceof P ? value : new P(function (resolve) {
29
19
  resolve(value);
30
20
  });
31
21
  }
32
-
33
22
  return new (P || (P = _promise["default"]))(function (resolve, reject) {
34
23
  function fulfilled(value) {
35
24
  try {
@@ -38,7 +27,6 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
38
27
  reject(e);
39
28
  }
40
29
  }
41
-
42
30
  function rejected(value) {
43
31
  try {
44
32
  step(generator["throw"](value));
@@ -46,39 +34,29 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
46
34
  reject(e);
47
35
  }
48
36
  }
49
-
50
37
  function step(result) {
51
38
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
52
39
  }
53
-
54
40
  step((generator = generator.apply(thisArg, _arguments || [])).next());
55
41
  });
56
42
  };
57
-
58
43
  var env = (0, _utils.getENV)();
59
44
  var platform = env.platform;
60
- var yachSdk = new _sdk["default"](env);
61
- exports.yachSdk = yachSdk;
62
-
45
+ var yachSdk = exports.yachSdk = new _sdk["default"](env);
63
46
  function initSdk() {
64
47
  var _this = this;
65
-
66
48
  var bridgeInit;
67
-
68
49
  if (platform === 'pc') {
69
50
  bridgeInit = function bridgeInit() {
70
51
  return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regenerator["default"].mark(function _callee() {
71
52
  return _regenerator["default"].wrap(function _callee$(_context) {
72
- while (1) {
73
- switch (_context.prev = _context.next) {
74
- case 0:
75
- (0, _bridge.PcBridgeInit)();
76
- return _context.abrupt("return", _bridge.pcBridge);
77
-
78
- case 2:
79
- case "end":
80
- return _context.stop();
81
- }
53
+ while (1) switch (_context.prev = _context.next) {
54
+ case 0:
55
+ (0, _bridge.PcBridgeInit)();
56
+ return _context.abrupt("return", _bridge.pcBridge);
57
+ case 2:
58
+ case "end":
59
+ return _context.stop();
82
60
  }
83
61
  }, _callee);
84
62
  }));
@@ -90,7 +68,6 @@ function initSdk() {
90
68
  });
91
69
  };
92
70
  }
93
-
94
71
  var config = {
95
72
  platform: platform,
96
73
  authMethod: 'config',
@@ -106,5 +83,4 @@ function initSdk() {
106
83
  };
107
84
  yachSdk.setPlatform(config);
108
85
  }
109
-
110
86
  initSdk();
@@ -1,33 +1,21 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
6
-
4
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports["default"] = void 0;
12
-
13
- var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/concat"));
14
-
15
9
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
16
-
10
+ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/concat"));
17
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
18
-
19
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
20
-
21
13
  var _utils = require("../../utils");
22
-
23
14
  var _compareVersions = require("../../utils/compareVersions");
24
-
25
15
  var _package = _interopRequireDefault(require("../../../package.json"));
26
-
27
16
  var Sdk = /*#__PURE__*/function () {
28
17
  function Sdk(env) {
29
18
  var _this = this;
30
-
31
19
  (0, _classCallCheck2["default"])(this, Sdk);
32
20
  this.invokeAPIConfigMapByMethod = {};
33
21
  this.configJsApiList = [];
@@ -49,11 +37,9 @@ var Sdk = /*#__PURE__*/function () {
49
37
  platformV2: env.platformV2,
50
38
  config: function config() {
51
39
  var _config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52
-
53
40
  // 鉴权
54
41
  var _config$jsApiList = _config.jsApiList,
55
- jsApiList = _config$jsApiList === void 0 ? [] : _config$jsApiList;
56
-
42
+ jsApiList = _config$jsApiList === void 0 ? [] : _config$jsApiList;
57
43
  if (_this.hadConfig) {
58
44
  console.log('Config has been executed');
59
45
  } else {
@@ -61,7 +47,6 @@ var Sdk = /*#__PURE__*/function () {
61
47
  fn('config', _config).then(function (value) {
62
48
  // 鉴权成功
63
49
  _this.cacheP.resolve(value);
64
-
65
50
  _this.hadConfig = true;
66
51
  _this.configJsApiList = jsApiList;
67
52
  })["catch"](function (error) {
@@ -93,19 +78,19 @@ var Sdk = /*#__PURE__*/function () {
93
78
  }
94
79
  };
95
80
  }
96
-
97
81
  (0, _createClass2["default"])(Sdk, [{
98
82
  key: "setAPI",
99
83
  value: function setAPI(method, config) {
100
84
  this.invokeAPIConfigMapByMethod[method] = config;
101
- } // 确定端的同事初始化bridge
102
-
85
+ }
86
+ // 确定端的同事初始化bridge
103
87
  }, {
104
88
  key: "setPlatform",
105
89
  value: function setPlatform(value) {
106
90
  var platform = value.platform,
107
- bridgeInit = value.bridgeInit;
108
- this.platformConfigMap[platform] = value; // if (this.env.platform === platform) bridgeInit();
91
+ bridgeInit = value.bridgeInit;
92
+ this.platformConfigMap[platform] = value;
93
+ // if (this.env.platform === platform) bridgeInit();
109
94
  }
110
95
  }, {
111
96
  key: "bridgeInitFn",
@@ -114,16 +99,13 @@ var Sdk = /*#__PURE__*/function () {
114
99
  if (this.bridgeInitFnPromise) {
115
100
  return this.bridgeInitFnPromise;
116
101
  }
117
-
118
102
  var o = this.platformConfigMap[this.env.platform];
119
-
120
103
  if (o) {
121
104
  this.bridgeInitFnPromise = o.bridgeInit();
122
105
  } else {
123
106
  var n = 'Do not support the current environment�' + this.env.platform;
124
107
  this.bridgeInitFnPromise = _promise["default"].reject(new Error(n));
125
108
  }
126
-
127
109
  return this.bridgeInitFnPromise;
128
110
  }
129
111
  }, {
@@ -143,39 +125,30 @@ var Sdk = /*#__PURE__*/function () {
143
125
  key: "invokeAPI",
144
126
  value: function invokeAPI(method, params) {
145
127
  var _context2;
146
-
147
128
  if (!params) params = {};
148
- if (!method) return; // 验证方法是否可用
149
-
129
+ if (!method) return;
130
+ // 验证方法是否可用
150
131
  var apiConfigs = this.invokeAPIConfigMapByMethod[method];
151
-
152
132
  if (!apiConfigs) {
153
133
  return this._onFail(method, '-1', "[".concat(method, "] method is not exist"), params.onFail);
154
134
  }
155
-
156
135
  var apiConfig = apiConfigs[this.env.platform];
157
-
158
136
  if (apiConfig) {
159
137
  var supportVersion = apiConfig.vs || '0.0.0';
160
-
161
138
  if ((0, _compareVersions.compareVersions)(this.env.version, supportVersion) < 0) {
162
139
  var _context;
163
-
164
140
  return this._onFail(method, '-1', (0, _concat["default"])(_context = "The current application version is ".concat(this.env.version, ". This method does not support versions less than ")).call(_context, supportVersion), params.onFail);
165
- } // 确定参数
166
-
167
-
168
- var p = apiConfig.paramsDeal ? apiConfig.paramsDeal(params) : params; // 确定回调
169
-
141
+ }
142
+ // 确定参数
143
+ var p = apiConfig.paramsDeal ? apiConfig.paramsDeal(params) : params;
144
+ // 确定回调
170
145
  if ('function' == typeof p.onSuccess) {
171
146
  var v = p.onSuccess;
172
-
173
147
  p.onSuccess = function (e) {
174
148
  v(e);
175
149
  };
176
- } // 主方法
177
-
178
-
150
+ }
151
+ // 主方法
179
152
  this.bridgeInitFn().then(function (fn) {
180
153
  fn(method, p).then(function (res) {
181
154
  // 调用成功
@@ -197,12 +170,9 @@ var Sdk = /*#__PURE__*/function () {
197
170
  });
198
171
  return;
199
172
  }
200
-
201
173
  this._onFail(method, '-1', (0, _concat["default"])(_context2 = "[".concat(method, "] method do not support the current platform (")).call(_context2, this.env.platform, ")"), params.onFail);
202
174
  }
203
175
  }]);
204
176
  return Sdk;
205
177
  }();
206
-
207
- var _default = Sdk;
208
- exports["default"] = _default;
178
+ var _default = exports["default"] = Sdk;
@@ -1,15 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
-
5
4
  _Object$defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
-
9
7
  exports.ENV_ENUM = void 0;
10
8
  var ENV_ENUM;
11
- exports.ENV_ENUM = ENV_ENUM;
12
-
13
9
  (function (ENV_ENUM) {
14
10
  ENV_ENUM["pc"] = "pc";
15
11
  ENV_ENUM["android"] = "android";
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
-
5
4
  _Object$defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
-
9
7
  exports["default"] = bpitLog;
10
-
11
8
  function loadScript(url) {
12
9
  var script = document.createElement('script');
13
10
  script.type = 'text/javascript';
14
-
15
11
  if (script.readyState) {
16
12
  // ie 浏览器
17
13
  script.onreadystatechange = function () {
@@ -26,38 +22,31 @@ function loadScript(url) {
26
22
  document.getElementsByTagName('head')[0].removeChild(script);
27
23
  };
28
24
  }
29
-
30
25
  script.src = url;
31
26
  document.getElementsByTagName('head')[0].appendChild(script);
32
27
  }
33
-
34
28
  function bpitLog(options) {
35
29
  if (!options) {
36
30
  console.log('bpit error: need options');
37
31
  return;
38
32
  }
39
-
40
33
  if (!options.group) {
41
34
  console.log('bpit error: need options.group');
42
35
  return;
43
36
  }
44
-
45
37
  if (!options.project) {
46
38
  console.log('bpit error: need options.project');
47
39
  return;
48
40
  }
49
-
50
41
  if (!options.hasOwnProperty('env')) {
51
42
  console.log('bpit error: need options.env');
52
43
  return;
53
44
  }
54
-
55
45
  if (!options.hasOwnProperty('version')) {
56
46
  console.log('bpit error: need options.version');
57
47
  return;
58
- } // upload data
59
-
60
-
48
+ }
49
+ // upload data
61
50
  var uploadData = ['https://es.zhiyinlou.com/log.js?'];
62
51
  uploadData.push('group=' + options.group);
63
52
  uploadData.push('&project=' + options.project);
@@ -68,13 +57,12 @@ function bpitLog(options) {
68
57
  if (options.workcode) uploadData.push('&workcode=' + options.workcode);
69
58
  if (options.timestamp) uploadData.push('&timestamp=' + options.timestamp);
70
59
  if (options.errorcode) uploadData.push('&errorcode=' + options.errorcode);
71
- if (options.message) uploadData.push('&message=' + options.message); // api load time
72
-
60
+ if (options.message) uploadData.push('&message=' + options.message);
61
+ // api load time
73
62
  if (options.api && options.time) {
74
63
  uploadData.push('&api=' + options.api);
75
64
  uploadData.push('&load_time=' + options.time);
76
65
  }
77
-
78
66
  var uploadDataUrl = uploadData.join('');
79
67
  loadScript(uploadDataUrl);
80
68
  if (options.env != 'online') console.log(uploadDataUrl);
@@ -1,27 +1,17 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
6
-
4
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
- exports.satisfies = exports.compare = exports.validate = exports.compareVersions = void 0;
12
-
13
- var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/index-of"));
14
-
15
- var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/keys"));
16
-
8
+ exports.validate = exports.satisfies = exports.compareVersions = exports.compare = void 0;
17
9
  var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
18
-
19
- var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
20
-
21
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
22
-
23
11
  var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/includes"));
24
-
12
+ var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
13
+ var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/keys"));
14
+ var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/index-of"));
25
15
  /**
26
16
  * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
27
17
  * 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`.
@@ -29,23 +19,22 @@ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/i
29
19
  * @param v2 - Second version to compare
30
20
  * @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).
31
21
  */
32
- var compareVersions = function compareVersions(v1, v2) {
22
+ var compareVersions = exports.compareVersions = function compareVersions(v1, v2) {
33
23
  // validate input and split into segments
34
24
  var n1 = validateAndParse(v1);
35
- var n2 = validateAndParse(v2); // pop off the patch
36
-
25
+ var n2 = validateAndParse(v2);
26
+ // pop off the patch
37
27
  var p1 = n1.pop();
38
- var p2 = n2.pop(); // validate numbers
39
-
28
+ var p2 = n2.pop();
29
+ // validate numbers
40
30
  var r = compareSegments(n1, n2);
41
- if (r !== 0) return r; // validate pre-release
42
-
31
+ if (r !== 0) return r;
32
+ // validate pre-release
43
33
  if (p1 && p2) {
44
34
  return compareSegments(p1.split('.'), p2.split('.'));
45
35
  } else if (p1 || p2) {
46
36
  return p1 ? -1 : 1;
47
37
  }
48
-
49
38
  return 0;
50
39
  };
51
40
  /**
@@ -61,11 +50,7 @@ var compareVersions = function compareVersions(v1, v2) {
61
50
  * validate('foo'); // return false
62
51
  * ```
63
52
  */
64
-
65
-
66
- exports.compareVersions = compareVersions;
67
-
68
- var validate = function validate(version) {
53
+ var validate = exports.validate = function validate(version) {
69
54
  return typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
70
55
  };
71
56
  /**
@@ -85,17 +70,12 @@ var validate = function validate(version) {
85
70
  * compare('10.1.1', '10.2.2', '>='); // return false
86
71
  * ```
87
72
  */
88
-
89
-
90
- exports.validate = validate;
91
-
92
- var compare = function compare(v1, v2, operator) {
73
+ var compare = exports.compare = function compare(v1, v2, operator) {
93
74
  var _context;
94
-
95
75
  // validate input operator
96
- assertValidOperator(operator); // since result of compareVersions can only be -1 or 0 or 1
76
+ assertValidOperator(operator);
77
+ // since result of compareVersions can only be -1 or 0 or 1
97
78
  // a simple map can be used to replace switch
98
-
99
79
  var res = compareVersions(v1, v2);
100
80
  return (0, _includes["default"])(_context = operatorResMap[operator]).call(_context, res);
101
81
  };
@@ -112,92 +92,69 @@ var compare = function compare(v1, v2, operator) {
112
92
  * satisfies('1.1.0', '~1.0.0'); // return false
113
93
  * ```
114
94
  */
115
-
116
-
117
- exports.compare = compare;
118
-
119
- var satisfies = function satisfies(version, range) {
95
+ var satisfies = exports.satisfies = function satisfies(version, range) {
120
96
  // if no range operator then "="
121
97
  var m = range.match(/^([<>=~^]+)/);
122
- var op = m ? m[1] : '='; // if gt/lt/eq then operator compare
123
-
124
- if (op !== '^' && op !== '~') return compare(version, range, op); // else range of either "~" or "^" is assumed
125
-
98
+ var op = m ? m[1] : '=';
99
+ // if gt/lt/eq then operator compare
100
+ if (op !== '^' && op !== '~') return compare(version, range, op);
101
+ // else range of either "~" or "^" is assumed
126
102
  var _validateAndParse = validateAndParse(version),
127
- _validateAndParse2 = (0, _slicedToArray2["default"])(_validateAndParse, 3),
128
- v1 = _validateAndParse2[0],
129
- v2 = _validateAndParse2[1],
130
- v3 = _validateAndParse2[2];
131
-
103
+ _validateAndParse2 = (0, _slicedToArray2["default"])(_validateAndParse, 3),
104
+ v1 = _validateAndParse2[0],
105
+ v2 = _validateAndParse2[1],
106
+ v3 = _validateAndParse2[2];
132
107
  var _validateAndParse3 = validateAndParse(range),
133
- _validateAndParse4 = (0, _slicedToArray2["default"])(_validateAndParse3, 3),
134
- r1 = _validateAndParse4[0],
135
- r2 = _validateAndParse4[1],
136
- r3 = _validateAndParse4[2];
137
-
108
+ _validateAndParse4 = (0, _slicedToArray2["default"])(_validateAndParse3, 3),
109
+ r1 = _validateAndParse4[0],
110
+ r2 = _validateAndParse4[1],
111
+ r3 = _validateAndParse4[2];
138
112
  if (compareStrings(v1, r1) !== 0) return false;
139
-
140
113
  if (op === '^') {
141
114
  return compareSegments([v2, v3], [r2, r3]) >= 0;
142
115
  }
143
-
144
116
  if (compareStrings(v2, r2) !== 0) return false;
145
117
  return compareStrings(v3, r3) >= 0;
146
118
  };
147
-
148
- exports.satisfies = satisfies;
149
119
  var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
150
-
151
120
  var validateAndParse = function validateAndParse(version) {
152
121
  if (typeof version !== 'string') {
153
122
  throw new TypeError('Invalid argument expected string');
154
123
  }
155
-
156
124
  var match = version.match(semver);
157
-
158
125
  if (!match) {
159
126
  throw new Error("Invalid argument not valid semver ('".concat(version, "' received)"));
160
127
  }
161
-
162
128
  match.shift();
163
129
  return match;
164
130
  };
165
-
166
131
  var isWildcard = function isWildcard(s) {
167
132
  return s === '*' || s === 'x' || s === 'X';
168
133
  };
169
-
170
134
  var tryParse = function tryParse(v) {
171
135
  var n = (0, _parseInt2["default"])(v, 10);
172
136
  return isNaN(n) ? v : n;
173
137
  };
174
-
175
138
  var forceType = function forceType(a, b) {
176
139
  return (0, _typeof2["default"])(a) !== (0, _typeof2["default"])(b) ? [String(a), String(b)] : [a, b];
177
140
  };
178
-
179
141
  var compareStrings = function compareStrings(a, b) {
180
142
  if (isWildcard(a) || isWildcard(b)) return 0;
181
-
182
143
  var _forceType = forceType(tryParse(a), tryParse(b)),
183
- _forceType2 = (0, _slicedToArray2["default"])(_forceType, 2),
184
- ap = _forceType2[0],
185
- bp = _forceType2[1];
186
-
144
+ _forceType2 = (0, _slicedToArray2["default"])(_forceType, 2),
145
+ ap = _forceType2[0],
146
+ bp = _forceType2[1];
187
147
  if (ap > bp) return 1;
188
148
  if (ap < bp) return -1;
189
149
  return 0;
190
150
  };
191
-
192
151
  var compareSegments = function compareSegments(a, b) {
193
152
  for (var i = 0; i < Math.max(a.length, b.length); i++) {
194
153
  var r = compareStrings(a[i] || '0', b[i] || '0');
195
154
  if (r !== 0) return r;
196
155
  }
197
-
198
156
  return 0;
199
157
  };
200
-
201
158
  var operatorResMap = {
202
159
  '>': [1],
203
160
  '>=': [0, 1],
@@ -206,12 +163,10 @@ var operatorResMap = {
206
163
  '<': [-1]
207
164
  };
208
165
  var allowedOperators = (0, _keys["default"])(operatorResMap);
209
-
210
166
  var assertValidOperator = function assertValidOperator(op) {
211
167
  if (typeof op !== 'string') {
212
168
  throw new TypeError("Invalid operator type, expected string but got ".concat((0, _typeof2["default"])(op)));
213
169
  }
214
-
215
170
  if ((0, _indexOf["default"])(allowedOperators).call(allowedOperators, op) === -1) {
216
171
  throw new Error("Invalid operator, expected one of ".concat(allowedOperators.join('|')));
217
172
  }
@@ -1,69 +1,53 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
6
-
4
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
- exports.log = log;
12
8
  exports.error = error;
9
+ exports.log = log;
13
10
  exports.warn = warn;
14
-
15
11
  var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/bind"));
16
-
17
12
  var _context, _context2, _context3;
18
-
19
13
  // 防止被应用复写console
20
14
  var myconsole = {
21
15
  log: function log() {},
22
16
  warn: function warn() {},
23
17
  error: function error() {}
24
18
  };
25
-
26
19
  if (typeof window !== 'undefined' && window.console) {
27
20
  myconsole = window.console;
28
21
  }
29
-
30
22
  if (typeof document !== 'undefined' && document.body) {
31
23
  var iframe = document.createElement('iframe');
32
-
33
24
  if (iframe && iframe.contentWindow && iframe.contentWindow.console) {
34
25
  iframe.style.display = 'none';
35
26
  document.body.appendChild(iframe);
36
27
  myconsole = iframe.contentWindow.console;
37
28
  }
38
29
  }
39
-
40
30
  var myLog = (0, _bind["default"])(_context = myconsole.log).call(_context, myconsole);
41
31
  var myWarn = (0, _bind["default"])(_context2 = myconsole.warn).call(_context2, myconsole);
42
32
  var myError = (0, _bind["default"])(_context3 = myconsole.error).call(_context3, myconsole);
43
33
  var style = 'color:#fff;font-weight:bold;border-radius:5px;background:#67c23a;';
44
34
  var styleError = "".concat(style, "background-color:red;");
45
35
  var styleWarn = "".concat(style, "background-color:orange;");
46
-
47
36
  function log() {
48
37
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49
38
  args[_key] = arguments[_key];
50
39
  }
51
-
52
40
  return myLog("%c Yach-jssdk log: ", style, args);
53
41
  }
54
-
55
42
  function error() {
56
43
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
57
44
  args[_key2] = arguments[_key2];
58
45
  }
59
-
60
46
  return myWarn("%c Yach-jssdk log: ", styleError, args);
61
47
  }
62
-
63
48
  function warn() {
64
49
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
65
50
  args[_key3] = arguments[_key3];
66
51
  }
67
-
68
52
  return myError("%c Yach-jssdk log: ", styleWarn, args);
69
53
  }