@limrun/appium-xcuitest-driver 10.11.0-lim.3 → 10.14.6-lim.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 (285) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/build/lib/commands/active-app-info.d.ts +4 -3
  3. package/build/lib/commands/active-app-info.d.ts.map +1 -1
  4. package/build/lib/commands/active-app-info.js +2 -3
  5. package/build/lib/commands/active-app-info.js.map +1 -1
  6. package/build/lib/commands/alert.d.ts +26 -31
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +20 -29
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +99 -76
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +83 -73
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/app-strings.d.ts +6 -7
  15. package/build/lib/commands/app-strings.d.ts.map +1 -1
  16. package/build/lib/commands/app-strings.js +3 -8
  17. package/build/lib/commands/app-strings.js.map +1 -1
  18. package/build/lib/commands/appearance.d.ts +7 -9
  19. package/build/lib/commands/appearance.d.ts.map +1 -1
  20. package/build/lib/commands/appearance.js +13 -19
  21. package/build/lib/commands/appearance.js.map +1 -1
  22. package/build/lib/commands/audit.d.ts +5 -33
  23. package/build/lib/commands/audit.d.ts.map +1 -1
  24. package/build/lib/commands/audit.js +3 -16
  25. package/build/lib/commands/audit.js.map +1 -1
  26. package/build/lib/commands/battery.d.ts +4 -4
  27. package/build/lib/commands/battery.d.ts.map +1 -1
  28. package/build/lib/commands/battery.js +3 -7
  29. package/build/lib/commands/battery.js.map +1 -1
  30. package/build/lib/commands/biometric.d.ts +12 -14
  31. package/build/lib/commands/biometric.d.ts.map +1 -1
  32. package/build/lib/commands/biometric.js +10 -19
  33. package/build/lib/commands/biometric.js.map +1 -1
  34. package/build/lib/commands/certificate.d.ts +14 -19
  35. package/build/lib/commands/certificate.d.ts.map +1 -1
  36. package/build/lib/commands/certificate.js +24 -31
  37. package/build/lib/commands/certificate.js.map +1 -1
  38. package/build/lib/commands/clipboard.d.ts +9 -11
  39. package/build/lib/commands/clipboard.d.ts.map +1 -1
  40. package/build/lib/commands/clipboard.js +8 -13
  41. package/build/lib/commands/clipboard.js.map +1 -1
  42. package/build/lib/commands/condition.d.ts +9 -72
  43. package/build/lib/commands/condition.d.ts.map +1 -1
  44. package/build/lib/commands/condition.js +5 -66
  45. package/build/lib/commands/condition.js.map +1 -1
  46. package/build/lib/commands/content-size.d.ts +16 -19
  47. package/build/lib/commands/content-size.d.ts.map +1 -1
  48. package/build/lib/commands/content-size.js +14 -22
  49. package/build/lib/commands/content-size.js.map +1 -1
  50. package/build/lib/commands/context.d.ts +130 -161
  51. package/build/lib/commands/context.d.ts.map +1 -1
  52. package/build/lib/commands/context.js +123 -108
  53. package/build/lib/commands/context.js.map +1 -1
  54. package/build/lib/commands/device-info.d.ts +13 -0
  55. package/build/lib/commands/device-info.d.ts.map +1 -0
  56. package/build/lib/commands/device-info.js +20 -0
  57. package/build/lib/commands/device-info.js.map +1 -0
  58. package/build/lib/commands/element.d.ts +83 -67
  59. package/build/lib/commands/element.d.ts.map +1 -1
  60. package/build/lib/commands/element.js +111 -134
  61. package/build/lib/commands/element.js.map +1 -1
  62. package/build/lib/commands/execute.d.ts +10 -22
  63. package/build/lib/commands/execute.d.ts.map +1 -1
  64. package/build/lib/commands/execute.js +13 -29
  65. package/build/lib/commands/execute.js.map +1 -1
  66. package/build/lib/commands/file-movement.d.ts +31 -42
  67. package/build/lib/commands/file-movement.d.ts.map +1 -1
  68. package/build/lib/commands/file-movement.js +146 -205
  69. package/build/lib/commands/file-movement.js.map +1 -1
  70. package/build/lib/commands/find.d.ts +20 -12
  71. package/build/lib/commands/find.d.ts.map +1 -1
  72. package/build/lib/commands/find.js +27 -65
  73. package/build/lib/commands/find.js.map +1 -1
  74. package/build/lib/commands/general.d.ts +84 -80
  75. package/build/lib/commands/general.d.ts.map +1 -1
  76. package/build/lib/commands/general.js +67 -54
  77. package/build/lib/commands/general.js.map +1 -1
  78. package/build/lib/commands/geolocation.d.ts +16 -36
  79. package/build/lib/commands/geolocation.d.ts.map +1 -1
  80. package/build/lib/commands/geolocation.js +8 -25
  81. package/build/lib/commands/geolocation.js.map +1 -1
  82. package/build/lib/commands/gesture.d.ts +103 -119
  83. package/build/lib/commands/gesture.d.ts.map +1 -1
  84. package/build/lib/commands/gesture.js +98 -138
  85. package/build/lib/commands/gesture.js.map +1 -1
  86. package/build/lib/commands/increase-contrast.d.ts +10 -13
  87. package/build/lib/commands/increase-contrast.d.ts.map +1 -1
  88. package/build/lib/commands/increase-contrast.js +8 -16
  89. package/build/lib/commands/increase-contrast.js.map +1 -1
  90. package/build/lib/commands/iohid.d.ts +6 -1359
  91. package/build/lib/commands/iohid.d.ts.map +1 -1
  92. package/build/lib/commands/iohid.js +5 -10
  93. package/build/lib/commands/iohid.js.map +1 -1
  94. package/build/lib/commands/keyboard.d.ts +16 -13
  95. package/build/lib/commands/keyboard.d.ts.map +1 -1
  96. package/build/lib/commands/keyboard.js +14 -18
  97. package/build/lib/commands/keyboard.js.map +1 -1
  98. package/build/lib/commands/keychains.d.ts +2 -2
  99. package/build/lib/commands/keychains.d.ts.map +1 -1
  100. package/build/lib/commands/keychains.js +1 -4
  101. package/build/lib/commands/keychains.js.map +1 -1
  102. package/build/lib/commands/localization.d.ts +7 -6
  103. package/build/lib/commands/localization.d.ts.map +1 -1
  104. package/build/lib/commands/localization.js +7 -8
  105. package/build/lib/commands/localization.js.map +1 -1
  106. package/build/lib/commands/location.d.ts +8 -11
  107. package/build/lib/commands/location.d.ts.map +1 -1
  108. package/build/lib/commands/location.js +7 -15
  109. package/build/lib/commands/location.js.map +1 -1
  110. package/build/lib/commands/lock.d.ts +6 -10
  111. package/build/lib/commands/lock.d.ts.map +1 -1
  112. package/build/lib/commands/lock.js +3 -10
  113. package/build/lib/commands/lock.js.map +1 -1
  114. package/build/lib/commands/log.d.ts +42 -44
  115. package/build/lib/commands/log.d.ts.map +1 -1
  116. package/build/lib/commands/log.js +32 -53
  117. package/build/lib/commands/log.js.map +1 -1
  118. package/build/lib/commands/memory.d.ts +4 -5
  119. package/build/lib/commands/memory.d.ts.map +1 -1
  120. package/build/lib/commands/memory.js +3 -8
  121. package/build/lib/commands/memory.js.map +1 -1
  122. package/build/lib/commands/navigation.d.ts +14 -26
  123. package/build/lib/commands/navigation.d.ts.map +1 -1
  124. package/build/lib/commands/navigation.js +22 -32
  125. package/build/lib/commands/navigation.js.map +1 -1
  126. package/build/lib/commands/notifications.d.ts +10 -10
  127. package/build/lib/commands/notifications.d.ts.map +1 -1
  128. package/build/lib/commands/notifications.js +8 -12
  129. package/build/lib/commands/notifications.js.map +1 -1
  130. package/build/lib/commands/pasteboard.d.ts +9 -10
  131. package/build/lib/commands/pasteboard.d.ts.map +1 -1
  132. package/build/lib/commands/pasteboard.js +8 -13
  133. package/build/lib/commands/pasteboard.js.map +1 -1
  134. package/build/lib/commands/pcap.d.ts +18 -38
  135. package/build/lib/commands/pcap.d.ts.map +1 -1
  136. package/build/lib/commands/pcap.js +9 -14
  137. package/build/lib/commands/pcap.js.map +1 -1
  138. package/build/lib/commands/performance.d.ts +36 -55
  139. package/build/lib/commands/performance.d.ts.map +1 -1
  140. package/build/lib/commands/performance.js +93 -86
  141. package/build/lib/commands/performance.js.map +1 -1
  142. package/build/lib/commands/permissions.d.ts +15 -17
  143. package/build/lib/commands/permissions.d.ts.map +1 -1
  144. package/build/lib/commands/permissions.js +12 -18
  145. package/build/lib/commands/permissions.js.map +1 -1
  146. package/build/lib/commands/proxy-helper.d.ts +11 -11
  147. package/build/lib/commands/proxy-helper.d.ts.map +1 -1
  148. package/build/lib/commands/proxy-helper.js +15 -24
  149. package/build/lib/commands/proxy-helper.js.map +1 -1
  150. package/build/lib/commands/record-audio.d.ts +25 -52
  151. package/build/lib/commands/record-audio.d.ts.map +1 -1
  152. package/build/lib/commands/record-audio.js +17 -19
  153. package/build/lib/commands/record-audio.js.map +1 -1
  154. package/build/lib/commands/recordscreen.d.ts +31 -62
  155. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  156. package/build/lib/commands/recordscreen.js +29 -28
  157. package/build/lib/commands/recordscreen.js.map +1 -1
  158. package/build/lib/commands/screenshots.d.ts +15 -9
  159. package/build/lib/commands/screenshots.d.ts.map +1 -1
  160. package/build/lib/commands/screenshots.js +16 -16
  161. package/build/lib/commands/screenshots.js.map +1 -1
  162. package/build/lib/commands/simctl.d.ts +16 -22
  163. package/build/lib/commands/simctl.d.ts.map +1 -1
  164. package/build/lib/commands/simctl.js +13 -17
  165. package/build/lib/commands/simctl.js.map +1 -1
  166. package/build/lib/commands/source.d.ts +10 -8
  167. package/build/lib/commands/source.d.ts.map +1 -1
  168. package/build/lib/commands/source.js +11 -14
  169. package/build/lib/commands/source.js.map +1 -1
  170. package/build/lib/commands/timeouts.d.ts +25 -32
  171. package/build/lib/commands/timeouts.d.ts.map +1 -1
  172. package/build/lib/commands/timeouts.js +19 -15
  173. package/build/lib/commands/timeouts.js.map +1 -1
  174. package/build/lib/commands/types.d.ts +80 -0
  175. package/build/lib/commands/types.d.ts.map +1 -1
  176. package/build/lib/commands/web.d.ts +199 -202
  177. package/build/lib/commands/web.d.ts.map +1 -1
  178. package/build/lib/commands/web.js +216 -175
  179. package/build/lib/commands/web.js.map +1 -1
  180. package/build/lib/commands/xctest-record-screen.d.ts +17 -47
  181. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
  182. package/build/lib/commands/xctest-record-screen.js +28 -59
  183. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  184. package/build/lib/commands/xctest.d.ts +37 -37
  185. package/build/lib/commands/xctest.d.ts.map +1 -1
  186. package/build/lib/commands/xctest.js +38 -50
  187. package/build/lib/commands/xctest.js.map +1 -1
  188. package/build/lib/desired-caps.js +1 -1
  189. package/build/lib/device/log/ios-simulator-log.d.ts.map +1 -1
  190. package/build/lib/device/log/ios-simulator-log.js +2 -0
  191. package/build/lib/device/log/ios-simulator-log.js.map +1 -1
  192. package/build/lib/device/simulator-management.d.ts.map +1 -1
  193. package/build/lib/device/simulator-management.js +4 -5
  194. package/build/lib/device/simulator-management.js.map +1 -1
  195. package/build/lib/device-log/ios-crash-log.d.ts +1 -1
  196. package/build/lib/device-log/ios-crash-log.d.ts.map +1 -1
  197. package/build/lib/device-log/ios-simulator-log.d.ts +1 -1
  198. package/build/lib/device-log/ios-simulator-log.d.ts.map +1 -1
  199. package/build/lib/doctor/optional-checks.d.ts +0 -9
  200. package/build/lib/doctor/optional-checks.d.ts.map +1 -1
  201. package/build/lib/doctor/optional-checks.js +1 -30
  202. package/build/lib/doctor/optional-checks.js.map +1 -1
  203. package/build/lib/driver.d.ts +11 -3
  204. package/build/lib/driver.d.ts.map +1 -1
  205. package/build/lib/driver.js +36 -12
  206. package/build/lib/driver.js.map +1 -1
  207. package/build/lib/execute-method-map.d.ts.map +1 -1
  208. package/build/lib/execute-method-map.js +0 -9
  209. package/build/lib/execute-method-map.js.map +1 -1
  210. package/build/lib/simulator-management.js +3 -3
  211. package/build/lib/simulator-management.js.map +1 -1
  212. package/lib/commands/active-app-info.ts +15 -0
  213. package/lib/commands/alert.ts +98 -0
  214. package/lib/commands/app-management.ts +414 -0
  215. package/lib/commands/{app-strings.js → app-strings.ts} +10 -9
  216. package/lib/commands/appearance.ts +70 -0
  217. package/lib/commands/audit.ts +25 -0
  218. package/lib/commands/{battery.js → battery.ts} +10 -12
  219. package/lib/commands/biometric.ts +52 -0
  220. package/lib/commands/{certificate.js → certificate.ts} +55 -50
  221. package/lib/commands/clipboard.ts +37 -0
  222. package/lib/commands/{condition.js → condition.ts} +21 -77
  223. package/lib/commands/content-size.ts +67 -0
  224. package/lib/commands/{context.js → context.ts} +174 -146
  225. package/lib/commands/device-info.ts +24 -0
  226. package/lib/commands/element.ts +419 -0
  227. package/lib/commands/{execute.js → execute.ts} +42 -38
  228. package/lib/commands/{file-movement.js → file-movement.ts} +212 -235
  229. package/lib/commands/find.ts +277 -0
  230. package/lib/commands/{general.js → general.ts} +102 -77
  231. package/lib/commands/geolocation.ts +55 -0
  232. package/lib/commands/{gesture.js → gesture.ts} +225 -183
  233. package/lib/commands/increase-contrast.ts +49 -0
  234. package/lib/commands/{iohid.js → iohid.ts} +15 -13
  235. package/lib/commands/keyboard.ts +70 -0
  236. package/lib/commands/keychains.ts +16 -0
  237. package/lib/commands/{localization.js → localization.ts} +22 -12
  238. package/lib/commands/{location.js → location.ts} +19 -22
  239. package/lib/commands/lock.ts +43 -0
  240. package/lib/commands/{log.js → log.ts} +68 -68
  241. package/lib/commands/{memory.js → memory.ts} +9 -9
  242. package/lib/commands/{navigation.js → navigation.ts} +42 -39
  243. package/lib/commands/{notifications.js → notifications.ts} +22 -14
  244. package/lib/commands/pasteboard.ts +44 -0
  245. package/lib/commands/{pcap.js → pcap.ts} +28 -28
  246. package/lib/commands/{performance.js → performance.ts} +133 -114
  247. package/lib/commands/permissions.ts +90 -0
  248. package/lib/commands/{proxy-helper.js → proxy-helper.ts} +26 -26
  249. package/lib/commands/{record-audio.js → record-audio.ts} +35 -33
  250. package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
  251. package/lib/commands/{screenshots.js → screenshots.ts} +27 -21
  252. package/lib/commands/simctl.ts +82 -0
  253. package/lib/commands/{source.js → source.ts} +23 -20
  254. package/lib/commands/timeouts.ts +95 -0
  255. package/lib/commands/types.ts +86 -0
  256. package/lib/commands/{web.js → web.ts} +314 -264
  257. package/lib/commands/{xctest-record-screen.js → xctest-record-screen.ts} +54 -71
  258. package/lib/commands/{xctest.js → xctest.ts} +78 -71
  259. package/lib/desired-caps.ts +1 -1
  260. package/lib/device/log/ios-simulator-log.ts +2 -0
  261. package/lib/device/simulator-management.ts +3 -6
  262. package/lib/doctor/optional-checks.ts +0 -33
  263. package/lib/driver.ts +38 -13
  264. package/lib/execute-method-map.ts +0 -9
  265. package/package.json +6 -5
  266. package/lib/commands/active-app-info.js +0 -12
  267. package/lib/commands/alert.js +0 -88
  268. package/lib/commands/app-management.js +0 -346
  269. package/lib/commands/appearance.js +0 -71
  270. package/lib/commands/audit.js +0 -31
  271. package/lib/commands/biometric.js +0 -52
  272. package/lib/commands/clipboard.js +0 -35
  273. package/lib/commands/content-size.js +0 -68
  274. package/lib/commands/deviceInfo.js +0 -27
  275. package/lib/commands/element.js +0 -423
  276. package/lib/commands/find.js +0 -205
  277. package/lib/commands/geolocation.js +0 -56
  278. package/lib/commands/increase-contrast.js +0 -50
  279. package/lib/commands/keyboard.js +0 -62
  280. package/lib/commands/keychains.js +0 -17
  281. package/lib/commands/lock.js +0 -46
  282. package/lib/commands/pasteboard.js +0 -43
  283. package/lib/commands/permissions.js +0 -85
  284. package/lib/commands/simctl.js +0 -71
  285. package/lib/commands/timeouts.js +0 -68
@@ -7,7 +7,7 @@ exports.PerfRecorder = void 0;
7
7
  exports.mobileStartPerfRecord = mobileStartPerfRecord;
8
8
  exports.mobileStopPerfRecord = mobileStopPerfRecord;
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
- const path_1 = __importDefault(require("path"));
10
+ const node_path_1 = __importDefault(require("node:path"));
11
11
  const support_1 = require("appium/support");
12
12
  const teen_process_1 = require("teen_process");
13
13
  const utils_1 = require("../utils");
@@ -39,10 +39,9 @@ const XCRUN = 'xcrun';
39
39
  *
40
40
  * Read [Recording, Pausing, and Stopping Traces](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html) for more details.
41
41
  *
42
- * @param {number} timeout - The maximum count of milliseconds to record the profiling information.
43
- * @param {string} profileName - The name of existing performance profile to apply. Can also contain the full path to the chosen template on the server file system. Note: not all profiles are supported on mobile devices.
44
- * @param {number|'current'} [pid] - The ID of the process to measure the performance for. Set it to `current` in order to measure the performance of the process, which belongs to the currently active application. All processes running on the device are measured if `pid` is unset (the default setting).
45
- * @this {XCUITestDriver}
42
+ * @param timeout - The maximum count of milliseconds to record the profiling information.
43
+ * @param profileName - The name of existing performance profile to apply. Can also contain the full path to the chosen template on the server file system. Note: not all profiles are supported on mobile devices.
44
+ * @param pid - The ID of the process to measure the performance for. Set it to `current` in order to measure the performance of the process, which belongs to the currently active application. All processes running on the device are measured if `pid` is unset (the default setting).
46
45
  */
47
46
  async function mobileStartPerfRecord(timeout = DEFAULT_TIMEOUT_MS, profileName = DEFAULT_PROFILE_NAME, pid) {
48
47
  if (!this.isFeatureEnabled(PERF_RECORD_FEAT_NAME) && !this.isRealDevice()) {
@@ -62,7 +61,7 @@ async function mobileStartPerfRecord(timeout = DEFAULT_TIMEOUT_MS, profileName =
62
61
  let realPid;
63
62
  if (pid) {
64
63
  if (lodash_1.default.toLower(String(pid)) === DEFAULT_PID) {
65
- const appInfo = /** @type {import('./types').ActiveAppInfo} */ (await this.proxyCommand('/wda/activeAppInfo', 'GET'));
64
+ const appInfo = (await this.proxyCommand('/wda/activeAppInfo', 'GET'));
66
65
  realPid = appInfo.pid;
67
66
  }
68
67
  else {
@@ -72,7 +71,7 @@ async function mobileStartPerfRecord(timeout = DEFAULT_TIMEOUT_MS, profileName =
72
71
  const recorder = new PerfRecorder(await support_1.tempDir.openDir(), this.device.udid, {
73
72
  timeout: parseInt(String(timeout), 10),
74
73
  profileName,
75
- pid: parseInt(String(realPid), 10),
74
+ pid: realPid,
76
75
  });
77
76
  await recorder.start();
78
77
  this._perfRecorders = [...(this._perfRecorders || []), recorder];
@@ -84,19 +83,17 @@ async function mobileStartPerfRecord(timeout = DEFAULT_TIMEOUT_MS, profileName =
84
83
  *
85
84
  * The resulting file in `.trace` format can be either returned directly as base64-encoded zip archive or uploaded to a remote location (such files can be pretty large). Afterwards it is possible to unarchive and open such files with Xcode Dev Tools.
86
85
  *
87
- * @param {string} [remotePath] - The path to the remote location, where the resulting zipped `.trace` file should be uploaded. The following protocols are supported: `http`, `https`, `ftp`. Null or empty string value (the default setting) means the content of resulting file should be zipped, encoded as Base64 and passed as the endpoint response value. An exception will be thrown if the generated file is too big to fit into the available process memory.
88
- * @param {string} [user] - The name of the user for the remote authentication. Only works if `remotePath` is provided.
89
- * @param {string} [pass] - The password for the remote authentication. Only works if `remotePath` is provided.
90
- * @param {import('axios').Method} [method] - The http multipart upload method name. Only works if `remotePath` is provided. Defaults to `PUT`
91
- * @param {string} profileName - The name of existing performance profile to stop the recording for. Multiple recorders for different profile names could be executed at the same time.
92
- * @param {Record<string,any>} [headers] - Additional headers mapping for multipart http(s) uploads
93
- * @param {string} [fileFieldName] - The name of the form field, where the file content BLOB should be stored for http(s) uploads. Defaults to `file`
94
- * @param {Record<string,any>|([string, any])[]} [formFields] - Additional form fields for multipart http(s) uploads
95
- *
96
- * @returns {Promise<string>} The resulting file in `.trace` format. This file can either be returned directly as base64-encoded `.zip` archive or uploaded to a remote location (note that such files may be large), _depending on the `remotePath` argument value._ Thereafter, the file may be unarchived and opened with Xcode Developer Tools.
86
+ * @param remotePath - The path to the remote location, where the resulting zipped `.trace` file should be uploaded. The following protocols are supported: `http`, `https`, `ftp`. Null or empty string value (the default setting) means the content of resulting file should be zipped, encoded as Base64 and passed as the endpoint response value. An exception will be thrown if the generated file is too big to fit into the available process memory.
87
+ * @param user - The name of the user for the remote authentication. Only works if `remotePath` is provided.
88
+ * @param pass - The password for the remote authentication. Only works if `remotePath` is provided.
89
+ * @param method - The http multipart upload method name. Only works if `remotePath` is provided. Defaults to `PUT`
90
+ * @param profileName - The name of existing performance profile to stop the recording for. Multiple recorders for different profile names could be executed at the same time.
91
+ * @param headers - Additional headers mapping for multipart http(s) uploads
92
+ * @param fileFieldName - The name of the form field, where the file content BLOB should be stored for http(s) uploads. Defaults to `file`
93
+ * @param formFields - Additional form fields for multipart http(s) uploads
94
+ * @returns The resulting file in `.trace` format. This file can either be returned directly as base64-encoded `.zip` archive or uploaded to a remote location (note that such files may be large), _depending on the `remotePath` argument value._ Thereafter, the file may be unarchived and opened with Xcode Developer Tools.
97
95
  * @throws {Error} If no performance recording with given profile name/device udid combination
98
96
  * has been started before or the resulting .trace file has not been generated properly.
99
- * @this {XCUITestDriver}
100
97
  */
101
98
  async function mobileStopPerfRecord(remotePath, user, pass, method, profileName = DEFAULT_PROFILE_NAME, headers, fileFieldName, formFields) {
102
99
  if (!this.isFeatureEnabled(PERF_RECORD_FEAT_NAME) && !this.isRealDevice()) {
@@ -112,7 +109,10 @@ async function mobileStopPerfRecord(remotePath, user, pass, method, profileName
112
109
  `and device ${this.device.udid}. Have you started the profiling before?`);
113
110
  }
114
111
  const recorder = lodash_1.default.first(recorders);
115
- const resultPath = await /** @type {PerfRecorder} */ (recorder).stop();
112
+ if (!recorder) {
113
+ throw this.log.errorWithException(`No recorder found for performance profile '${profileName}' and device ${this.device.udid}`);
114
+ }
115
+ const resultPath = await recorder.stop();
116
116
  if (!(await support_1.fs.exists(resultPath))) {
117
117
  throw this.log.errorWithException(`There is no ${DEFAULT_EXT} file found for performance profile '${profileName}' ` +
118
118
  `and device ${this.device.udid}. Make sure the selected profile is supported on this device`);
@@ -129,35 +129,22 @@ async function mobileStopPerfRecord(remotePath, user, pass, method, profileName
129
129
  await support_1.fs.rimraf(resultPath);
130
130
  return result;
131
131
  }
132
- async function requireXctrace() {
133
- const xcrunPath = await requireXcrun();
134
- try {
135
- await (0, teen_process_1.exec)(xcrunPath, [XCTRACE, 'help']);
136
- }
137
- catch (e) {
138
- throw new Error(`${XCTRACE} is not available for the active Xcode version. ` +
139
- `Please make sure XCode is up to date. Original error: ${e.stderr || e.message}`);
140
- }
141
- return xcrunPath;
142
- }
143
- async function requireInstruments() {
144
- try {
145
- return await support_1.fs.which(INSTRUMENTS);
146
- }
147
- catch {
148
- throw new Error(`${INSTRUMENTS} has not been found in PATH. ` +
149
- `Please make sure XCode development tools are installed`);
150
- }
151
- }
152
132
  class PerfRecorder {
153
- /** @type {import('teen_process').SubProcess|null} */
154
133
  _process;
134
+ _zippedReportPath;
135
+ _timeout;
136
+ _profileName;
137
+ _reportPath;
138
+ _pid;
139
+ _udid;
140
+ _logger;
141
+ _archivePromise;
155
142
  constructor(reportRoot, udid, opts = {}) {
156
143
  this._process = null;
157
144
  this._zippedReportPath = '';
158
145
  this._timeout = opts.timeout && opts.timeout > 0 ? opts.timeout : DEFAULT_TIMEOUT_MS;
159
146
  this._profileName = opts.profileName || DEFAULT_PROFILE_NAME;
160
- this._reportPath = path_1.default.resolve(reportRoot, `appium_perf__${this._profileName.replace(/\W/g, '_')}__${Date.now()}${DEFAULT_EXT}`);
147
+ this._reportPath = node_path_1.default.resolve(reportRoot, `appium_perf__${this._profileName.replace(/\W/g, '_')}__${Date.now()}${DEFAULT_EXT}`);
161
148
  this._pid = opts.pid;
162
149
  this._udid = udid;
163
150
  this._logger = support_1.logger.getLogger(`${lodash_1.default.truncate(this._profileName, { length: 10 })}@${this._udid.substring(0, 8)}`);
@@ -166,9 +153,6 @@ class PerfRecorder {
166
153
  get profileName() {
167
154
  return this._profileName;
168
155
  }
169
- async getOriginalReportPath() {
170
- return (await support_1.fs.exists(this._reportPath)) ? this._reportPath : '';
171
- }
172
156
  async getZippedReportPath() {
173
157
  // This is to prevent possible race conditions, because the archive operation
174
158
  // could be pretty time-intensive
@@ -179,13 +163,13 @@ class PerfRecorder {
179
163
  return '';
180
164
  }
181
165
  const zippedReportPath = await support_1.tempDir.path({
182
- prefix: path_1.default.parse(originalReportPath).name,
166
+ prefix: node_path_1.default.parse(originalReportPath).name,
183
167
  suffix: '.zip',
184
168
  });
185
169
  await support_1.zip.toArchive(zippedReportPath, {
186
- cwd: path_1.default.dirname(this._reportPath),
170
+ cwd: node_path_1.default.dirname(this._reportPath),
187
171
  });
188
- await support_1.fs.rimraf(path_1.default.dirname(this._reportPath));
172
+ await support_1.fs.rimraf(node_path_1.default.dirname(this._reportPath));
189
173
  this._zippedReportPath = zippedReportPath;
190
174
  return this._zippedReportPath;
191
175
  })();
@@ -195,41 +179,6 @@ class PerfRecorder {
195
179
  isRunning() {
196
180
  return !!this._process?.isRunning;
197
181
  }
198
- async _enforceTermination() {
199
- if (this._process && this.isRunning()) {
200
- this._logger.debug('Force-stopping the currently running perf recording');
201
- try {
202
- await this._process.stop('SIGKILL');
203
- }
204
- catch { }
205
- }
206
- this._process = null;
207
- const performCleanup = async () => {
208
- try {
209
- await bluebird_1.default.all([this._zippedReportPath, path_1.default.dirname(this._reportPath)]
210
- .filter(Boolean)
211
- .map((x) => support_1.fs.rimraf(x)));
212
- }
213
- catch (e) {
214
- this._logger.warn(e.message);
215
- }
216
- };
217
- if (this._archivePromise) {
218
- (async () => {
219
- try {
220
- await this._archivePromise;
221
- }
222
- catch {
223
- }
224
- finally {
225
- await performCleanup();
226
- this._archivePromise = null;
227
- }
228
- })();
229
- }
230
- await performCleanup();
231
- return '';
232
- }
233
182
  async start() {
234
183
  let binaryPath;
235
184
  try {
@@ -241,7 +190,7 @@ class PerfRecorder {
241
190
  binaryPath = await requireInstruments();
242
191
  }
243
192
  const args = [];
244
- const toolName = path_1.default.basename(binaryPath) === XCRUN ? XCTRACE : INSTRUMENTS;
193
+ const toolName = node_path_1.default.basename(binaryPath) === XCRUN ? XCTRACE : INSTRUMENTS;
245
194
  if (toolName === XCTRACE) {
246
195
  args.push(XCTRACE, 'record', '--device', this._udid, '--template', this._profileName, '--output', this._reportPath, '--time-limit', `${this._timeout}ms`);
247
196
  if (this._pid) {
@@ -323,8 +272,69 @@ class PerfRecorder {
323
272
  }
324
273
  return await this.getZippedReportPath();
325
274
  }
275
+ async getOriginalReportPath() {
276
+ return (await support_1.fs.exists(this._reportPath)) ? this._reportPath : '';
277
+ }
278
+ async _enforceTermination() {
279
+ if (this._process && this.isRunning()) {
280
+ this._logger.debug('Force-stopping the currently running perf recording');
281
+ try {
282
+ await this._process.stop('SIGKILL');
283
+ }
284
+ catch {
285
+ // Ignore errors
286
+ }
287
+ }
288
+ this._process = null;
289
+ const performCleanup = async () => {
290
+ try {
291
+ await bluebird_1.default.all([this._zippedReportPath, node_path_1.default.dirname(this._reportPath)]
292
+ .filter(Boolean)
293
+ .map((x) => support_1.fs.rimraf(x)));
294
+ }
295
+ catch (e) {
296
+ this._logger.warn(e.message);
297
+ }
298
+ };
299
+ if (this._archivePromise) {
300
+ (async () => {
301
+ try {
302
+ await this._archivePromise;
303
+ }
304
+ catch {
305
+ // Ignore errors
306
+ }
307
+ finally {
308
+ await performCleanup();
309
+ this._archivePromise = null;
310
+ }
311
+ })();
312
+ }
313
+ await performCleanup();
314
+ return '';
315
+ }
326
316
  }
327
317
  exports.PerfRecorder = PerfRecorder;
318
+ async function requireXctrace() {
319
+ const xcrunPath = await requireXcrun();
320
+ try {
321
+ await (0, teen_process_1.exec)(xcrunPath, [XCTRACE, 'help']);
322
+ }
323
+ catch (e) {
324
+ throw new Error(`${XCTRACE} is not available for the active Xcode version. ` +
325
+ `Please make sure XCode is up to date. Original error: ${e.stderr || e.message}`);
326
+ }
327
+ return xcrunPath;
328
+ }
329
+ async function requireInstruments() {
330
+ try {
331
+ return await support_1.fs.which(INSTRUMENTS);
332
+ }
333
+ catch {
334
+ throw new Error(`${INSTRUMENTS} has not been found in PATH. ` +
335
+ `Please make sure XCode development tools are installed`);
336
+ }
337
+ }
328
338
  async function requireXcrun() {
329
339
  try {
330
340
  return await support_1.fs.which(XCRUN);
@@ -334,7 +344,4 @@ async function requireXcrun() {
334
344
  `Please make sure XCode development tools are installed`);
335
345
  }
336
346
  }
337
- /**
338
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
339
- */
340
347
  //# sourceMappingURL=performance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"performance.js","sourceRoot":"","sources":["../../../lib/commands/performance.js"],"names":[],"mappings":";;;;;;AAyCA,sDAyCC;AAuBD,oDA+CC;AAxJD,oDAAuB;AACvB,gDAAwB;AACxB,4CAA8D;AAC9D,+CAA8C;AAC9C,oCAA8C;AAC9C,uCAA0C;AAC1C,wDAAyB;AAEzB,MAAM,qBAAqB,GAAG,aAAa,CAA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IAAI,CAAC;QACH,OAAO,MAAM,YAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,GAAG,WAAW,+BAA+B;YAC3C,wDAAwD,CAC3D,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,YAAY;IACzB,IAAI,CAAC;QACH,OAAO,MAAM,YAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,+BAA+B;YACrC,wDAAwD,CAC3D,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,36 +1,34 @@
1
+ import { PermissionService } from './enum';
2
+ import type { XCUITestDriver } from '../driver';
3
+ import type { PermissionState } from './types';
1
4
  /**
2
5
  * Resets the given permission for the active application under test.
3
6
  * Works for both Simulator and real devices using Xcode SDK 11.4+
4
7
  *
5
- * @param {PermissionService|number} service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
6
- * @throws {Error} If permission reset fails on the device.
7
- * @this {XCUITestDriver}
8
+ * @param service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
9
+ * @throws If permission reset fails on the device.
8
10
  */
9
- export function mobileResetPermission(this: import("../driver").XCUITestDriver, service: PermissionService | number): Promise<void>;
11
+ export declare function mobileResetPermission(this: XCUITestDriver, service: PermissionService | number): Promise<void>;
10
12
  /**
11
13
  * Gets application permission state on a simulated device.
12
14
  *
13
15
  * **This method requires [WIX applesimutils](https://github.com/wix/AppleSimulatorUtils) to be installed on the Appium server host.**
14
16
  *
15
- * @param {string} bundleId - Bundle identifier of the target application
16
- * @param {import('./enum').PermissionService} service - Service name
17
- * @returns {Promise<import('./types').PermissionState>} Either 'yes', 'no', 'unset' or 'limited'
18
- * @throws {Error} If permission getting fails or the device is not a Simulator.
19
- * @this {XCUITestDriver}
17
+ * @param bundleId - Bundle identifier of the target application
18
+ * @param service - Service name
19
+ * @returns Either 'yes', 'no', 'unset' or 'limited'
20
+ * @throws If permission getting fails or the device is not a Simulator.
20
21
  * @group Simulator Only
21
22
  */
22
- export function mobileGetPermission(this: import("../driver").XCUITestDriver, bundleId: string, service: import("./enum").PermissionService): Promise<import("./types").PermissionState>;
23
+ export declare function mobileGetPermission(this: XCUITestDriver, bundleId: string, service: PermissionService): Promise<PermissionState>;
23
24
  /**
24
25
  * Set application permission state on Simulator.
25
26
  *
26
- * @param {Record<Partial<import('./types').AccessRule>, import('./types').PermissionState>} access - One or more access rules to set.
27
- * @param {string} bundleId - Bundle identifier of the target application
27
+ * @param access - One or more access rules to set.
28
+ * @param bundleId - Bundle identifier of the target application
28
29
  * @since Xcode SDK 11.4
29
- * @throws {Error} If permission setting fails or the device is not a Simulator.
30
+ * @throws If permission setting fails or the device is not a Simulator.
30
31
  * @group Simulator Only
31
- * @this {XCUITestDriver}
32
32
  */
33
- export function mobileSetPermissions(this: import("../driver").XCUITestDriver, access: Record<Partial<import("./types").AccessRule>, import("./types").PermissionState>, bundleId: string): Promise<void>;
34
- export type XCUITestDriver = import("../driver").XCUITestDriver;
35
- import { PermissionService } from './enum';
33
+ export declare function mobileSetPermissions(this: XCUITestDriver, access: Record<string, PermissionState>, bundleId: string): Promise<void>;
36
34
  //# sourceMappingURL=permissions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../lib/commands/permissions.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,yFAJW,iBAAiB,GAAC,MAAM,iBA0BlC;AAED;;;;;;;;;;;GAWG;AACH,wFAPW,MAAM,WACN,OAAO,QAAQ,EAAE,iBAAiB,GAChC,OAAO,CAAC,OAAO,SAAS,EAAE,eAAe,CAAC,CAgBtD;AAED;;;;;;;;;GASG;AACH,uFAPW,MAAM,CAAC,OAAO,CAAC,OAAO,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,SAAS,EAAE,eAAe,CAAC,YAChF,MAAM,iBAahB;6BAGY,OAAO,WAAW,EAAE,cAAc;kCAlFf,QAAQ"}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../lib/commands/permissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAEzC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAG7C;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAClC,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,eAAe,CAAC,CAS1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EACvC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -9,14 +9,12 @@ exports.mobileSetPermissions = mobileSetPermissions;
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
10
  const enum_1 = require("./enum");
11
11
  const utils_1 = require("../utils");
12
- const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Permission-related operations');
13
12
  /**
14
13
  * Resets the given permission for the active application under test.
15
14
  * Works for both Simulator and real devices using Xcode SDK 11.4+
16
15
  *
17
- * @param {PermissionService|number} service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
18
- * @throws {Error} If permission reset fails on the device.
19
- * @this {XCUITestDriver}
16
+ * @param service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
17
+ * @throws If permission reset fails on the device.
20
18
  */
21
19
  async function mobileResetPermission(service) {
22
20
  if (!service) {
@@ -43,11 +41,10 @@ async function mobileResetPermission(service) {
43
41
  *
44
42
  * **This method requires [WIX applesimutils](https://github.com/wix/AppleSimulatorUtils) to be installed on the Appium server host.**
45
43
  *
46
- * @param {string} bundleId - Bundle identifier of the target application
47
- * @param {import('./enum').PermissionService} service - Service name
48
- * @returns {Promise<import('./types').PermissionState>} Either 'yes', 'no', 'unset' or 'limited'
49
- * @throws {Error} If permission getting fails or the device is not a Simulator.
50
- * @this {XCUITestDriver}
44
+ * @param bundleId - Bundle identifier of the target application
45
+ * @param service - Service name
46
+ * @returns Either 'yes', 'no', 'unset' or 'limited'
47
+ * @throws If permission getting fails or the device is not a Simulator.
51
48
  * @group Simulator Only
52
49
  */
53
50
  async function mobileGetPermission(bundleId, service) {
@@ -55,26 +52,23 @@ async function mobileGetPermission(bundleId, service) {
55
52
  throw new Error(`The 'service' option is expected to be present`);
56
53
  }
57
54
  assertSimulator(this);
58
- return /** @type {import('./types').PermissionState} */ (await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).getPermission(bundleId, String(service)));
55
+ return await this.device.getPermission(bundleId, String(service));
59
56
  }
60
57
  /**
61
58
  * Set application permission state on Simulator.
62
59
  *
63
- * @param {Record<Partial<import('./types').AccessRule>, import('./types').PermissionState>} access - One or more access rules to set.
64
- * @param {string} bundleId - Bundle identifier of the target application
60
+ * @param access - One or more access rules to set.
61
+ * @param bundleId - Bundle identifier of the target application
65
62
  * @since Xcode SDK 11.4
66
- * @throws {Error} If permission setting fails or the device is not a Simulator.
63
+ * @throws If permission setting fails or the device is not a Simulator.
67
64
  * @group Simulator Only
68
- * @this {XCUITestDriver}
69
65
  */
70
66
  async function mobileSetPermissions(access, bundleId) {
71
67
  if (!lodash_1.default.isPlainObject(access)) {
72
68
  throw new Error(`The 'access' option is expected to be a map`);
73
69
  }
74
70
  assertSimulator(this);
75
- await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).setPermissions(bundleId, access);
71
+ await this.device.setPermissions(bundleId, access);
76
72
  }
77
- /**
78
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
79
- */
73
+ const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Permission-related operations');
80
74
  //# sourceMappingURL=permissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../lib/commands/permissions.js"],"names":[],"mappings":";;;;;AAcA,sDAsBC;AAcD,kDAWC;AAYD,oDAOC;AAhFD,oDAAuB;AACvB,iCAAyC;AACzC,oCAA6D;AAE7D,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,uBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;AAEnG;;;;;;;GAOG;AACI,KAAK,UAAU,qBAAqB,CAAC,OAAO;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,QAAQ,CAAC;IACb,IAAI,gBAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,QAAQ,GAAG,wBAAiB,CAAC,gBAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,qCAAqC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAC,CAAC,IAAI,CAAC,wBAAiB,CAAC,CAAC,EAAE,CACvF,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,IAAI,gBAAC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,QAAQ,GAAG,OAAO,CAAC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,CAAC,CAAC;IACjE,CAAC;IACD,eAAe,CAAC,IAAI,CAAC,CAAC;IAEtB,MAAO,IAAI,CAAC,MAAoB,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,MAAsB,EAAE,EAAE,CAAC,uBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC"}
@@ -1,15 +1,15 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ export type AllowedHttpMethod = 'GET' | 'POST' | 'DELETE';
1
3
  /**
2
4
  * Proxies a command to WebDriverAgent
3
- * @template [TReq=any]
4
- * @template [TRes=unknown]
5
- * @param {string} url
6
- * @param {AllowedHttpMethod} method
7
- * @param {TReq} [body]
8
- * @param {boolean} isSessionCommand
9
- * @this {import('../driver').XCUITestDriver}
10
- * @returns {Promise<TRes>}
5
+ *
6
+ * @template TReq - Request body type
7
+ * @template TRes - Response type
8
+ * @param url - The endpoint URL
9
+ * @param method - HTTP method to use
10
+ * @param body - Optional request body
11
+ * @param isSessionCommand - Whether this is a session command (default: true)
12
+ * @returns Promise resolving to the response
11
13
  */
12
- export function proxyCommand<TReq = any, TRes = unknown>(this: import("../driver").XCUITestDriver, url: string, method: AllowedHttpMethod, body?: TReq, isSessionCommand?: boolean): Promise<TRes>;
13
- export type XCUITestDriver = import("../driver").XCUITestDriver;
14
- export type AllowedHttpMethod = "GET" | "POST" | "DELETE";
14
+ export declare function proxyCommand<TReq = any, TRes = unknown>(this: XCUITestDriver, url: string, method: AllowedHttpMethod, body?: TReq, isSessionCommand?: boolean): Promise<TRes>;
15
15
  //# sourceMappingURL=proxy-helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-helper.d.ts","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.js"],"names":[],"mappings":"AA+CA;;;;;;;;;;GAUG;AACH,6BATc,IAAI,QACJ,IAAI,2DACP,MAAM,UACN,iBAAiB,SACjB,IAAI,qBACJ,OAAO,GAEL,OAAO,CAAC,IAAI,CAAC,CA8CzB;6BAcY,OAAO,WAAW,EAAE,cAAc;gCAClC,KAAK,GAAC,MAAM,GAAC,QAAQ"}
1
+ {"version":3,"file":"proxy-helper.d.ts","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AA8C9C,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAAC,IAAI,GAAG,GAAG,EAAE,IAAI,GAAG,OAAO,EAC3D,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,IAAI,CAAC,EAAE,IAAI,EACX,gBAAgB,GAAE,OAAc,GAC/B,OAAO,CAAC,IAAI,CAAC,CA4Cf"}
@@ -9,8 +9,8 @@ const bluebird_1 = __importDefault(require("bluebird"));
9
9
  const GET = 'GET';
10
10
  const POST = 'POST';
11
11
  const DELETE = 'DELETE';
12
- const SUPPORTED_METHODS = Object.freeze(new Set(/** @type {const} */ ([GET, POST, DELETE])));
13
- const WDA_ROUTES = /** @type {const} */ ({
12
+ const SUPPORTED_METHODS = Object.freeze(new Set([GET, POST, DELETE]));
13
+ const WDA_ROUTES = {
14
14
  '/wda/screen': {
15
15
  GET: 'getScreenInfo',
16
16
  },
@@ -47,21 +47,21 @@ const WDA_ROUTES = /** @type {const} */ ({
47
47
  '/wda/locked': {
48
48
  GET: 'isLocked',
49
49
  },
50
- });
50
+ };
51
51
  /**
52
52
  * Proxies a command to WebDriverAgent
53
- * @template [TReq=any]
54
- * @template [TRes=unknown]
55
- * @param {string} url
56
- * @param {AllowedHttpMethod} method
57
- * @param {TReq} [body]
58
- * @param {boolean} isSessionCommand
59
- * @this {import('../driver').XCUITestDriver}
60
- * @returns {Promise<TRes>}
53
+ *
54
+ * @template TReq - Request body type
55
+ * @template TRes - Response type
56
+ * @param url - The endpoint URL
57
+ * @param method - HTTP method to use
58
+ * @param body - Optional request body
59
+ * @param isSessionCommand - Whether this is a session command (default: true)
60
+ * @returns Promise resolving to the response
61
61
  */
62
62
  async function proxyCommand(url, method, body, isSessionCommand = true) {
63
63
  if (this.shutdownUnexpectedly) {
64
- return /** @type {TRes} */ (undefined);
64
+ return undefined;
65
65
  }
66
66
  if (!url) {
67
67
  throw this.log.errorWithException('Proxying requires an endpoint');
@@ -81,11 +81,11 @@ async function proxyCommand(url, method, body, isSessionCommand = true) {
81
81
  this.log.info(`Proxying to WDA with an unknown route: ${method} ${url}`);
82
82
  }
83
83
  if (!timeout) {
84
- return /** @type {TRes} */ (await proxy.command(url, method, body));
84
+ return await proxy.command(url, method, body);
85
85
  }
86
86
  this.log.debug(`Setting custom timeout to ${timeout} ms for '${cmdName}' command`);
87
87
  try {
88
- return /** @type {TRes} */ (await bluebird_1.default.resolve(proxy.command(url, method, body)).timeout(timeout));
88
+ return await bluebird_1.default.resolve(proxy.command(url, method, body)).timeout(timeout);
89
89
  }
90
90
  catch (e) {
91
91
  if (!(e instanceof bluebird_1.default.Promise.TimeoutError)) {
@@ -97,18 +97,9 @@ async function proxyCommand(url, method, body, isSessionCommand = true) {
97
97
  throw error;
98
98
  }
99
99
  }
100
- /**
101
- * @param {string} endpoint
102
- * @param {AllowedHttpMethod} method
103
- * @returns {string|undefined}
104
- */
105
100
  function wdaRouteToCommandName(endpoint, method) {
106
101
  if (endpoint in WDA_ROUTES) {
107
- return WDA_ROUTES[endpoint][method];
102
+ return WDA_ROUTES[endpoint]?.[method];
108
103
  }
109
104
  }
110
- /**
111
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
112
- * @typedef {'GET'|'POST'|'DELETE'} AllowedHttpMethod
113
- */
114
105
  //# sourceMappingURL=proxy-helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-helper.js","sourceRoot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