appium-android-driver 5.14.7 → 6.0.0

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 (192) hide show
  1. package/build/index.d.ts +282 -0
  2. package/build/index.d.ts.map +1 -0
  3. package/build/index.js.map +1 -0
  4. package/build/lib/commands/actions.d.ts +6 -224
  5. package/build/lib/commands/actions.d.ts.map +1 -1
  6. package/build/lib/commands/actions.js +306 -405
  7. package/build/lib/commands/actions.js.map +1 -1
  8. package/build/lib/commands/alert.d.ts +7 -9
  9. package/build/lib/commands/alert.d.ts.map +1 -1
  10. package/build/lib/commands/alert.js +24 -18
  11. package/build/lib/commands/alert.js.map +1 -1
  12. package/build/lib/commands/app-management.d.ts +7 -313
  13. package/build/lib/commands/app-management.d.ts.map +1 -1
  14. package/build/lib/commands/app-management.js +135 -293
  15. package/build/lib/commands/app-management.js.map +1 -1
  16. package/build/lib/commands/context.d.ts +8 -92
  17. package/build/lib/commands/context.d.ts.map +1 -1
  18. package/build/lib/commands/context.js +381 -439
  19. package/build/lib/commands/context.js.map +1 -1
  20. package/build/lib/commands/element.d.ts +8 -35
  21. package/build/lib/commands/element.d.ts.map +1 -1
  22. package/build/lib/commands/element.js +153 -136
  23. package/build/lib/commands/element.js.map +1 -1
  24. package/build/lib/commands/emu-console.d.ts +6 -48
  25. package/build/lib/commands/emu-console.d.ts.map +1 -1
  26. package/build/lib/commands/emu-console.js +19 -34
  27. package/build/lib/commands/emu-console.js.map +1 -1
  28. package/build/lib/commands/execute.d.ts +6 -5
  29. package/build/lib/commands/execute.d.ts.map +1 -1
  30. package/build/lib/commands/execute.js +77 -66
  31. package/build/lib/commands/execute.js.map +1 -1
  32. package/build/lib/commands/file-actions.d.ts +7 -128
  33. package/build/lib/commands/file-actions.d.ts.map +1 -1
  34. package/build/lib/commands/file-actions.js +183 -219
  35. package/build/lib/commands/file-actions.js.map +1 -1
  36. package/build/lib/commands/find.d.ts +8 -12
  37. package/build/lib/commands/find.d.ts.map +1 -1
  38. package/build/lib/commands/find.js +19 -23
  39. package/build/lib/commands/find.js.map +1 -1
  40. package/build/lib/commands/general.d.ts +9 -132
  41. package/build/lib/commands/general.d.ts.map +1 -1
  42. package/build/lib/commands/general.js +281 -312
  43. package/build/lib/commands/general.js.map +1 -1
  44. package/build/lib/commands/ime.d.ts +7 -10
  45. package/build/lib/commands/ime.d.ts.map +1 -1
  46. package/build/lib/commands/ime.js +47 -35
  47. package/build/lib/commands/ime.js.map +1 -1
  48. package/build/lib/commands/index.d.ts +27 -2
  49. package/build/lib/commands/index.d.ts.map +1 -1
  50. package/build/lib/commands/index.js +41 -19
  51. package/build/lib/commands/index.js.map +1 -1
  52. package/build/lib/commands/intent.d.ts +7 -417
  53. package/build/lib/commands/intent.d.ts.map +1 -1
  54. package/build/lib/commands/intent.js +104 -216
  55. package/build/lib/commands/intent.js.map +1 -1
  56. package/build/lib/commands/keyboard.d.ts +6 -5
  57. package/build/lib/commands/keyboard.d.ts.map +1 -1
  58. package/build/lib/commands/keyboard.js +16 -8
  59. package/build/lib/commands/keyboard.js.map +1 -1
  60. package/build/lib/commands/log.d.ts +7 -44
  61. package/build/lib/commands/log.d.ts.map +1 -1
  62. package/build/lib/commands/log.js +146 -108
  63. package/build/lib/commands/log.js.map +1 -1
  64. package/build/lib/commands/media-projection.d.ts +7 -143
  65. package/build/lib/commands/media-projection.d.ts.map +1 -1
  66. package/build/lib/commands/media-projection.js +113 -140
  67. package/build/lib/commands/media-projection.js.map +1 -1
  68. package/build/lib/commands/mixins.d.ts +740 -0
  69. package/build/lib/commands/mixins.d.ts.map +1 -0
  70. package/build/lib/commands/mixins.js +19 -0
  71. package/build/lib/commands/mixins.js.map +1 -0
  72. package/build/lib/commands/network.d.ts +7 -138
  73. package/build/lib/commands/network.d.ts.map +1 -1
  74. package/build/lib/commands/network.js +212 -254
  75. package/build/lib/commands/network.js.map +1 -1
  76. package/build/lib/commands/performance.d.ts +24 -70
  77. package/build/lib/commands/performance.d.ts.map +1 -1
  78. package/build/lib/commands/performance.js +144 -100
  79. package/build/lib/commands/performance.js.map +1 -1
  80. package/build/lib/commands/permissions.d.ts +8 -92
  81. package/build/lib/commands/permissions.d.ts.map +1 -1
  82. package/build/lib/commands/permissions.js +75 -87
  83. package/build/lib/commands/permissions.js.map +1 -1
  84. package/build/lib/commands/recordscreen.d.ts +7 -193
  85. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  86. package/build/lib/commands/recordscreen.js +151 -182
  87. package/build/lib/commands/recordscreen.js.map +1 -1
  88. package/build/lib/commands/shell.d.ts +7 -7
  89. package/build/lib/commands/shell.d.ts.map +1 -1
  90. package/build/lib/commands/shell.js +40 -33
  91. package/build/lib/commands/shell.js.map +1 -1
  92. package/build/lib/commands/streamscreen.d.ts +9 -103
  93. package/build/lib/commands/streamscreen.d.ts.map +1 -1
  94. package/build/lib/commands/streamscreen.js +261 -218
  95. package/build/lib/commands/streamscreen.js.map +1 -1
  96. package/build/lib/commands/system-bars.d.ts +22 -90
  97. package/build/lib/commands/system-bars.d.ts.map +1 -1
  98. package/build/lib/commands/system-bars.js +76 -74
  99. package/build/lib/commands/system-bars.js.map +1 -1
  100. package/build/lib/commands/touch.d.ts +10 -29
  101. package/build/lib/commands/touch.d.ts.map +1 -1
  102. package/build/lib/commands/touch.js +301 -285
  103. package/build/lib/commands/touch.js.map +1 -1
  104. package/build/lib/commands/types.d.ts +978 -0
  105. package/build/lib/commands/types.d.ts.map +1 -0
  106. package/build/lib/commands/types.js +3 -0
  107. package/build/lib/commands/types.js.map +1 -0
  108. package/build/lib/constraints.d.ts +291 -0
  109. package/build/lib/constraints.d.ts.map +1 -0
  110. package/build/lib/constraints.js +300 -0
  111. package/build/lib/constraints.js.map +1 -0
  112. package/build/lib/driver.d.ts +68 -37
  113. package/build/lib/driver.d.ts.map +1 -1
  114. package/build/lib/driver.js +123 -80
  115. package/build/lib/driver.js.map +1 -1
  116. package/build/lib/helpers/android.d.ts +164 -0
  117. package/build/lib/helpers/android.d.ts.map +1 -0
  118. package/build/lib/helpers/android.js +819 -0
  119. package/build/lib/helpers/android.js.map +1 -0
  120. package/build/lib/helpers/index.d.ts +7 -0
  121. package/build/lib/helpers/index.d.ts.map +1 -0
  122. package/build/lib/helpers/index.js +29 -0
  123. package/build/lib/helpers/index.js.map +1 -0
  124. package/build/lib/helpers/types.d.ts +121 -0
  125. package/build/lib/helpers/types.d.ts.map +1 -0
  126. package/build/lib/helpers/types.js +3 -0
  127. package/build/lib/helpers/types.js.map +1 -0
  128. package/build/lib/helpers/unlock.d.ts +32 -0
  129. package/build/lib/helpers/unlock.d.ts.map +1 -0
  130. package/build/lib/helpers/unlock.js +273 -0
  131. package/build/lib/helpers/unlock.js.map +1 -0
  132. package/build/lib/helpers/webview.d.ts +74 -0
  133. package/build/lib/helpers/webview.d.ts.map +1 -0
  134. package/build/lib/helpers/webview.js +421 -0
  135. package/build/lib/helpers/webview.js.map +1 -0
  136. package/build/lib/index.d.ts +9 -0
  137. package/build/lib/index.d.ts.map +1 -0
  138. package/build/lib/index.js +37 -0
  139. package/build/lib/index.js.map +1 -0
  140. package/build/lib/method-map.d.ts +0 -8
  141. package/build/lib/method-map.d.ts.map +1 -1
  142. package/build/lib/method-map.js +63 -74
  143. package/build/lib/method-map.js.map +1 -1
  144. package/build/lib/stubs.d.ts +0 -1
  145. package/build/lib/stubs.d.ts.map +1 -1
  146. package/build/lib/stubs.js +1 -0
  147. package/build/lib/stubs.js.map +1 -1
  148. package/build/lib/utils.d.ts +1 -1
  149. package/build/lib/utils.d.ts.map +1 -1
  150. package/lib/commands/actions.js +351 -464
  151. package/lib/commands/alert.js +27 -17
  152. package/lib/commands/app-management.js +156 -314
  153. package/lib/commands/context.js +457 -441
  154. package/lib/commands/element.js +201 -157
  155. package/lib/commands/emu-console.js +25 -45
  156. package/lib/commands/execute.js +106 -90
  157. package/lib/commands/file-actions.js +222 -240
  158. package/lib/commands/find.ts +103 -0
  159. package/lib/commands/general.js +327 -339
  160. package/lib/commands/ime.js +50 -34
  161. package/lib/commands/{index.js → index.ts} +20 -24
  162. package/lib/commands/intent.js +108 -249
  163. package/lib/commands/keyboard.js +20 -8
  164. package/lib/commands/log.js +172 -116
  165. package/lib/commands/media-projection.js +134 -161
  166. package/lib/commands/mixins.ts +966 -0
  167. package/lib/commands/network.js +252 -281
  168. package/lib/commands/performance.js +203 -132
  169. package/lib/commands/permissions.js +108 -109
  170. package/lib/commands/recordscreen.js +212 -209
  171. package/lib/commands/shell.js +51 -40
  172. package/lib/commands/streamscreen.js +355 -289
  173. package/lib/commands/system-bars.js +92 -83
  174. package/lib/commands/touch.js +357 -294
  175. package/lib/commands/types.ts +1097 -0
  176. package/lib/{desired-caps.js → constraints.ts} +106 -103
  177. package/lib/{driver.js → driver.ts} +278 -132
  178. package/lib/helpers/android.ts +1143 -0
  179. package/lib/helpers/index.ts +6 -0
  180. package/lib/helpers/types.ts +134 -0
  181. package/lib/helpers/unlock.ts +329 -0
  182. package/lib/helpers/webview.ts +582 -0
  183. package/lib/index.ts +18 -0
  184. package/lib/method-map.js +87 -98
  185. package/lib/stubs.ts +0 -1
  186. package/package.json +27 -20
  187. package/index.js +0 -24
  188. package/lib/android-helpers.js +0 -983
  189. package/lib/commands/coverage.js +0 -18
  190. package/lib/commands/find.js +0 -82
  191. package/lib/unlock-helpers.js +0 -278
  192. package/lib/webview-helpers.js +0 -602
@@ -1,75 +1,86 @@
1
1
  "use strict";
2
+ // @ts-check
2
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
5
  };
5
6
  Object.defineProperty(exports, "__esModule", { value: true });
6
7
  const lodash_1 = __importDefault(require("lodash"));
7
8
  const driver_1 = require("appium/driver");
8
- const extensions = {};
9
- extensions.execute = async function execute(script, args) {
10
- if (script.match(/^mobile:/)) {
11
- this.log.info(`Executing native command '${script}'`);
12
- script = script.replace(/^mobile:/, '').trim();
13
- return await this.executeMobile(script, lodash_1.default.isArray(args) ? args[0] : args);
14
- }
15
- if (!this.isWebContext()) {
16
- throw new driver_1.errors.NotImplementedError();
17
- }
18
- const endpoint = this.chromedriver.jwproxy.downstreamProtocol === driver_1.PROTOCOLS.MJSONWP
19
- ? '/execute'
20
- : '/execute/sync';
21
- return await this.chromedriver.jwproxy.command(endpoint, 'POST', {
22
- script,
23
- args,
24
- });
9
+ const mixins_1 = require("./mixins");
10
+ /**
11
+ * @type {import('./mixins').ExecuteMixin & ThisType<import('../driver').AndroidDriver>}
12
+ * @satisfies {import('@appium/types').ExternalDriver}
13
+ */
14
+ const ExecuteMixin = {
15
+ async execute(script, args) {
16
+ if (script.match(/^mobile:/)) {
17
+ this.log.info(`Executing native command '${script}'`);
18
+ script = script.replace(/^mobile:/, '').trim();
19
+ return await this.executeMobile(script, lodash_1.default.isArray(args) ? /** @type {import('@appium/types').StringRecord} */ (args[0]) : args);
20
+ }
21
+ if (!this.isWebContext()) {
22
+ throw new driver_1.errors.NotImplementedError();
23
+ }
24
+ const endpoint =
25
+ /** @type {import('appium-chromedriver').Chromedriver} */ (this.chromedriver).jwproxy
26
+ .downstreamProtocol === driver_1.PROTOCOLS.MJSONWP
27
+ ? '/execute'
28
+ : '/execute/sync';
29
+ return await /** @type {import('appium-chromedriver').Chromedriver} */ (this.chromedriver).jwproxy.command(endpoint, 'POST', {
30
+ script,
31
+ args,
32
+ });
33
+ },
34
+ async executeMobile(mobileCommand, opts = {}) {
35
+ const mobileCommandsMapping = {
36
+ shell: 'mobileShell',
37
+ execEmuConsoleCommand: 'mobileExecEmuConsoleCommand',
38
+ startLogsBroadcast: 'mobileStartLogsBroadcast',
39
+ stopLogsBroadcast: 'mobileStopLogsBroadcast',
40
+ changePermissions: 'mobileChangePermissions',
41
+ getPermissions: 'mobileGetPermissions',
42
+ performEditorAction: 'mobilePerformEditorAction',
43
+ sensorSet: 'sensorSet',
44
+ getDeviceTime: 'mobileGetDeviceTime',
45
+ startScreenStreaming: 'mobileStartScreenStreaming',
46
+ stopScreenStreaming: 'mobileStopScreenStreaming',
47
+ getNotifications: 'mobileGetNotifications',
48
+ listSms: 'mobileListSms',
49
+ pushFile: 'mobilePushFile',
50
+ pullFile: 'mobilePullFile',
51
+ pullFolder: 'mobilePullFolder',
52
+ deleteFile: 'mobileDeleteFile',
53
+ isAppInstalled: 'mobileIsAppInstalled',
54
+ queryAppState: 'mobileQueryAppState',
55
+ activateApp: 'mobileActivateApp',
56
+ removeApp: 'mobileRemoveApp',
57
+ terminateApp: 'mobileTerminateApp',
58
+ installApp: 'mobileInstallApp',
59
+ clearApp: 'mobileClearApp',
60
+ startService: 'mobileStartService',
61
+ stopService: 'mobileStopService',
62
+ startActivity: 'mobileStartActivity',
63
+ broadcast: 'mobileBroadcast',
64
+ getContexts: 'mobileGetContexts',
65
+ lock: 'mobileLock',
66
+ unlock: 'mobileUnlock',
67
+ refreshGpsCache: 'mobileRefreshGpsCache',
68
+ startMediaProjectionRecording: 'mobileStartMediaProjectionRecording',
69
+ isMediaProjectionRecordingRunning: 'mobileIsMediaProjectionRecordingRunning',
70
+ stopMediaProjectionRecording: 'mobileStopMediaProjectionRecording',
71
+ getConnectivity: 'mobileGetConnectivity',
72
+ setConnectivity: 'mobileSetConnectivity',
73
+ hideKeyboard: 'hideKeyboard',
74
+ isKeyboardShown: 'isKeyboardShown',
75
+ };
76
+ if (!lodash_1.default.has(mobileCommandsMapping, mobileCommand)) {
77
+ throw new driver_1.errors.UnknownCommandError(`Unknown mobile command "${mobileCommand}". ` +
78
+ `Only ${lodash_1.default.keys(mobileCommandsMapping)} commands are supported.`);
79
+ }
80
+ // @ts-expect-error fine for now until we replace with execute methods
81
+ return await this[mobileCommandsMapping[mobileCommand]](opts);
82
+ },
25
83
  };
26
- extensions.executeMobile = async function executeMobile(mobileCommand, opts = {}) {
27
- const mobileCommandsMapping = {
28
- shell: 'mobileShell',
29
- execEmuConsoleCommand: 'mobileExecEmuConsoleCommand',
30
- startLogsBroadcast: 'mobileStartLogsBroadcast',
31
- stopLogsBroadcast: 'mobileStopLogsBroadcast',
32
- changePermissions: 'mobileChangePermissions',
33
- getPermissions: 'mobileGetPermissions',
34
- performEditorAction: 'mobilePerformEditorAction',
35
- sensorSet: 'sensorSet',
36
- getDeviceTime: 'mobileGetDeviceTime',
37
- startScreenStreaming: 'mobileStartScreenStreaming',
38
- stopScreenStreaming: 'mobileStopScreenStreaming',
39
- getNotifications: 'mobileGetNotifications',
40
- listSms: 'mobileListSms',
41
- pushFile: 'mobilePushFile',
42
- pullFile: 'mobilePullFile',
43
- pullFolder: 'mobilePullFolder',
44
- deleteFile: 'mobileDeleteFile',
45
- isAppInstalled: 'mobileIsAppInstalled',
46
- queryAppState: 'mobileQueryAppState',
47
- activateApp: 'mobileActivateApp',
48
- removeApp: 'mobileRemoveApp',
49
- terminateApp: 'mobileTerminateApp',
50
- installApp: 'mobileInstallApp',
51
- clearApp: 'mobileClearApp',
52
- startService: 'mobileStartService',
53
- stopService: 'mobileStopService',
54
- startActivity: 'mobileStartActivity',
55
- broadcast: 'mobileBroadcast',
56
- getContexts: 'mobileGetContexts',
57
- lock: 'mobileLock',
58
- unlock: 'mobileUnlock',
59
- refreshGpsCache: 'mobileRefreshGpsCache',
60
- startMediaProjectionRecording: 'mobileStartMediaProjectionRecording',
61
- isMediaProjectionRecordingRunning: 'mobileIsMediaProjectionRecordingRunning',
62
- stopMediaProjectionRecording: 'mobileStopMediaProjectionRecording',
63
- getConnectivity: 'mobileGetConnectivity',
64
- setConnectivity: 'mobileSetConnectivity',
65
- hideKeyboard: 'hideKeyboard',
66
- isKeyboardShown: 'isKeyboardShown',
67
- };
68
- if (!lodash_1.default.has(mobileCommandsMapping, mobileCommand)) {
69
- throw new driver_1.errors.UnknownCommandError(`Unknown mobile command "${mobileCommand}". ` +
70
- `Only ${lodash_1.default.keys(mobileCommandsMapping)} commands are supported.`);
71
- }
72
- return await this[mobileCommandsMapping[mobileCommand]](opts);
73
- };
74
- exports.default = extensions;
84
+ (0, mixins_1.mixin)(ExecuteMixin);
85
+ exports.default = ExecuteMixin;
75
86
  //# sourceMappingURL=execute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/commands/execute.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AACvB,0CAAgD;AAEhD,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,UAAU,CAAC,OAAO,GAAG,KAAK,UAAU,OAAO,CAAC,MAAM,EAAE,IAAI;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;QAC5B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,MAAM,GAAG,CAAC,CAAC;QACtD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/C,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;KAC3E;IACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE;QACxB,MAAM,IAAI,eAAM,CAAC,mBAAmB,EAAE,CAAC;KACxC;IACD,MAAM,QAAQ,GACZ,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,kBAAkB,KAAK,kBAAS,CAAC,OAAO;QAChE,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,eAAe,CAAC;IACtB,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE;QAC/D,MAAM;QACN,IAAI;KACL,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,UAAU,CAAC,aAAa,GAAG,KAAK,UAAU,aAAa,CAAC,aAAa,EAAE,IAAI,GAAG,EAAE;IAC9E,MAAM,qBAAqB,GAAG;QAC5B,KAAK,EAAE,aAA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,gBAAC,CAAC,GAAG,CAAC,qBAAqB,EAAE,aAAa,CAAC,EAAE;YAChD,MAAM,IAAI,eAAM,CAAC,mBAAmB,CAClC,2BAA2B,aAAa,KAAK;gBAC3C,QAAQ,gBAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,0BAA0B,CAClE,CAAC;SACH;QACD,sEAAsE;QACtE,OAAO,MAAM,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC;CACF,CAAC;AAEF,IAAA,cAAK,EAAC,YAAY,CAAC,CAAC;AAEpB,kBAAe,YAAY,CAAC"}
@@ -1,129 +1,8 @@
1
- export default commands;
2
- export type PullFileOptions = {
3
- /**
4
- * The full path to the remote file
5
- * or a specially formatted path, which points to an item inside an app bundle,
6
- * for example `@my.app.id/my/path`. It is mandatory for the app bundle to have
7
- * debugging enabled in order to use the latter remotePath format.
8
- */
9
- remotePath: string;
10
- };
11
- export type PushFileOptions = {
12
- /**
13
- * The full path to the remote file
14
- * or a specially formatted path, which points to an item inside an app bundle,
15
- * for example `@my.app.id/my/path`. It is mandatory for the app bundle to have
16
- * debugging enabled in order to use the latter remotePath format.
17
- */
18
- remotePath: string;
19
- /**
20
- * Base64-encoded content of the file to be pushed.
21
- */
22
- payload: string;
23
- };
24
- export type PullFolderOptions = {
25
- /**
26
- * The full path to the remote folder.
27
- */
28
- remotePath: string;
29
- };
30
- export type DeleteFileOpts = {
31
- /**
32
- * The full path to the remote file
33
- * or a file inside an application bundle (for example `@my.app.id/path/in/bundle`)
34
- */
35
- remotePath: string;
36
- };
37
- export namespace commands {
38
- /**
39
- * Pulls a remote file from the device.
40
- * It is required, that a package has debugging flag enabled
41
- * in order to access its files.
42
- *
43
- * @param {string} remotePath The full path to the remote file
44
- * or a specially formatted path, which points to an item inside app bundle
45
- * @returns {string} Base64 encoded content of the pulled file
46
- * @throws {Error} If the pull operation failed
47
- */
48
- function pullFile(remotePath: string): string;
49
- /**
50
- * @typedef {Object} PullFileOptions
51
- * @property {string} remotePath The full path to the remote file
52
- * or a specially formatted path, which points to an item inside an app bundle,
53
- * for example `@my.app.id/my/path`. It is mandatory for the app bundle to have
54
- * debugging enabled in order to use the latter remotePath format.
55
- */
56
- /**
57
- * Pulls a remote file from the device.
58
- *
59
- * @param {PullFileOptions} opts
60
- * @returns {string} The same as `pullFile`
61
- */
62
- function mobilePullFile(opts?: PullFileOptions): string;
63
- /**
64
- * Pushes the given data to a file on the remote device
65
- * It is required, that a package has debugging flag enabled
66
- * in order to access its files.
67
- * After a file is pushed it gets automatically scanned for possible
68
- * media occurrences. If the scan succeeds then the file is added to the
69
- * media library.
70
- *
71
- * @param {string} remotePath The full path to the remote file or
72
- * a file inside a package bundle
73
- * @param {string} base64Data Base64 encoded data to be written to the
74
- * remote file. The remote file will be silently overridden if it already exists.
75
- * @throws {Error} If there was an error while pushing the data
76
- */
77
- function pushFile(remotePath: string, base64Data: string): Promise<void>;
78
- /**
79
- * @typedef {Object} PushFileOptions
80
- * @property {string} remotePath The full path to the remote file
81
- * or a specially formatted path, which points to an item inside an app bundle,
82
- * for example `@my.app.id/my/path`. It is mandatory for the app bundle to have
83
- * debugging enabled in order to use the latter remotePath format.
84
- * @property {string} payload Base64-encoded content of the file to be pushed.
85
- */
86
- /**
87
- * Pushes the given data to a file on the remote device.
88
- *
89
- * @param {PushFileOptions} opts
90
- */
91
- function mobilePushFile(opts?: PushFileOptions): Promise<void>;
92
- /**
93
- * Pulls the whole folder from the remote device
94
- *
95
- * @param {string} remotePath The full path to a folder on the
96
- * remote device or a folder inside an application bundle
97
- * @returns {string} Base64-encoded and zipped content of the folder
98
- * @throws {Error} If there was a failure while getting the folder content
99
- */
100
- function pullFolder(remotePath: string): string;
101
- /**
102
- * @typedef {Object} PullFolderOptions
103
- * @property {string} remotePath The full path to the remote folder.
104
- */
105
- /**
106
- * Pulls the whole folder from the device under test.
107
- *
108
- * @param {PullFolderOptions} opts
109
- * @returns {string} The same as `pullFolder`
110
- */
111
- function mobilePullFolder(opts?: PullFolderOptions): string;
112
- /**
113
- * @typedef {Object} DeleteFileOpts
114
- * @property {!string} remotePath The full path to the remote file
115
- * or a file inside an application bundle (for example `@my.app.id/path/in/bundle`)
116
- */
117
- /**
118
- * Deletes a file on the remote device
119
- *
120
- * @param {DeleteFileOpts} opts
121
- * @returns {boolean} `true` if the remote file has been successfully deleted.
122
- * If the path to a remote file is valid, but the file itself does not exist
123
- * then `false` is returned.
124
- * @throws {Error} If the argument is invalid or there was an error while
125
- * deleting the file
126
- */
127
- function mobileDeleteFile(opts?: DeleteFileOpts): boolean;
128
- }
1
+ export default FileActionsMixin;
2
+ export type ADB = import('appium-adb').ADB;
3
+ /**
4
+ * @type {import('./mixins').FileActionsMixin & ThisType<import('../driver').AndroidDriver>}
5
+ * @satisfies {import('@appium/types').ExternalDriver}
6
+ */
7
+ declare const FileActionsMixin: import('./mixins').FileActionsMixin & ThisType<import('../driver').AndroidDriver>;
129
8
  //# sourceMappingURL=file-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-actions.d.ts","sourceRoot":"","sources":["../../../lib/commands/file-actions.js"],"names":[],"mappings":";;;;;;;;gBAuHc,MAAM;;;;;;;;;gBAyFN,MAAM;;;;aAIN,MAAM;;;;;;gBAmCN,MAAM;;;;;;;gBAuFL,MAAM;;;IAvQrB;;;;;;;;;OASG;IACH,8CAkCC;IAED;;;;;;OAMG;IAEH;;;;;OAKG;IACH,wDAGC;IAED;;;;;;;;;;;;;OAaG;IACH,yEAsDC;IAED;;;;;;;OAOG;IAEH;;;;OAIG;IACH,+DAGC;IAED;;;;;;;OAOG;IACH,gDAUC;IAED;;;OAGG;IAEH;;;;;OAKG;IACH,4DAGC;IAyED;;;;OAIG;IAEH;;;;;;;;;OASG;IACH,0DAYC"}
1
+ {"version":3,"file":"file-actions.d.ts","sourceRoot":"","sources":["../../../lib/commands/file-actions.js"],"names":[],"mappings":";kBAsVa,OAAO,YAAY,EAAE,GAAG;AArQrC;;;GAGG;AACH,gCAHU,OAAO,UAAU,EAAE,gBAAgB,GAAG,SAAS,OAAO,WAAW,EAAE,aAAa,CAAC,CAuJzF"}