appium-mac2-driver 1.6.3 → 1.7.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 (74) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +2 -0
  3. package/build/index.js +9 -17
  4. package/build/lib/commands/app-management.d.ts +96 -0
  5. package/build/lib/commands/app-management.d.ts.map +1 -0
  6. package/build/lib/commands/app-management.js +71 -40
  7. package/build/lib/commands/app-management.js.map +1 -1
  8. package/build/lib/commands/applescript.d.ts +57 -0
  9. package/build/lib/commands/applescript.d.ts.map +1 -0
  10. package/build/lib/commands/applescript.js +74 -57
  11. package/build/lib/commands/applescript.js.map +1 -1
  12. package/build/lib/commands/execute.d.ts +6 -0
  13. package/build/lib/commands/execute.d.ts.map +1 -0
  14. package/build/lib/commands/execute.js +44 -47
  15. package/build/lib/commands/execute.js.map +1 -1
  16. package/build/lib/commands/find.d.ts +5 -0
  17. package/build/lib/commands/find.d.ts.map +1 -0
  18. package/build/lib/commands/find.js +18 -21
  19. package/build/lib/commands/find.js.map +1 -1
  20. package/build/lib/commands/gestures.d.ts +809 -0
  21. package/build/lib/commands/gestures.d.ts.map +1 -0
  22. package/build/lib/commands/gestures.js +481 -268
  23. package/build/lib/commands/gestures.js.map +1 -1
  24. package/build/lib/commands/index.d.ts +3 -0
  25. package/build/lib/commands/index.d.ts.map +1 -0
  26. package/build/lib/commands/index.js +16 -19
  27. package/build/lib/commands/index.js.map +1 -1
  28. package/build/lib/commands/record-screen.d.ts +174 -0
  29. package/build/lib/commands/record-screen.d.ts.map +1 -0
  30. package/build/lib/commands/record-screen.js +285 -198
  31. package/build/lib/commands/record-screen.js.map +1 -1
  32. package/build/lib/commands/screenshots.d.ts +42 -0
  33. package/build/lib/commands/screenshots.d.ts.map +1 -0
  34. package/build/lib/commands/screenshots.js +28 -16
  35. package/build/lib/commands/screenshots.js.map +1 -1
  36. package/build/lib/commands/source.d.ts +31 -0
  37. package/build/lib/commands/source.d.ts.map +1 -0
  38. package/build/lib/commands/source.js +21 -14
  39. package/build/lib/commands/source.js.map +1 -1
  40. package/build/lib/desired-caps.d.ts +50 -0
  41. package/build/lib/desired-caps.d.ts.map +1 -0
  42. package/build/lib/desired-caps.js +41 -45
  43. package/build/lib/desired-caps.js.map +1 -1
  44. package/build/lib/driver.d.ts +162 -0
  45. package/build/lib/driver.d.ts.map +1 -0
  46. package/build/lib/driver.js +123 -97
  47. package/build/lib/driver.js.map +1 -1
  48. package/build/lib/logger.d.ts +3 -0
  49. package/build/lib/logger.d.ts.map +1 -0
  50. package/build/lib/logger.js +5 -11
  51. package/build/lib/logger.js.map +1 -1
  52. package/build/lib/method-map.d.ts +19 -0
  53. package/build/lib/method-map.d.ts.map +1 -0
  54. package/build/lib/method-map.js +16 -25
  55. package/build/lib/method-map.js.map +1 -1
  56. package/build/lib/utils.d.ts +18 -0
  57. package/build/lib/utils.d.ts.map +1 -0
  58. package/build/lib/utils.js +40 -25
  59. package/build/lib/utils.js.map +1 -1
  60. package/build/lib/wda-mac.d.ts +72 -0
  61. package/build/lib/wda-mac.d.ts.map +1 -0
  62. package/build/lib/wda-mac.js +397 -348
  63. package/build/lib/wda-mac.js.map +1 -1
  64. package/lib/commands/app-management.js +15 -15
  65. package/lib/commands/applescript.js +9 -9
  66. package/lib/commands/gestures.js +114 -112
  67. package/lib/commands/record-screen.js +28 -20
  68. package/lib/commands/screenshots.js +4 -4
  69. package/lib/commands/source.js +5 -5
  70. package/lib/driver.js +19 -7
  71. package/lib/utils.js +1 -1
  72. package/lib/wda-mac.js +18 -12
  73. package/npm-shrinkwrap.json +5137 -5347
  74. package/package.json +30 -18
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.7.1](https://github.com/appium/appium-mac2-driver/compare/v1.7.0...v1.7.1) (2023-08-14)
2
+
3
+
4
+ ### Miscellaneous Chores
5
+
6
+ * **deps-dev:** bump lint-staged from 13.3.0 to 14.0.0 ([#217](https://github.com/appium/appium-mac2-driver/issues/217)) ([7c02fb6](https://github.com/appium/appium-mac2-driver/commit/7c02fb618471c221d98f77b4c187d6a98895428b))
7
+
8
+ ## [1.7.0](https://github.com/appium/appium-mac2-driver/compare/v1.6.3...v1.7.0) (2023-08-12)
9
+
10
+
11
+ ### Features
12
+
13
+ * Switch babel to typescript ([#216](https://github.com/appium/appium-mac2-driver/issues/216)) ([c908503](https://github.com/appium/appium-mac2-driver/commit/c9085034ebe57ee743acb18da5236af4563873f7))
14
+
1
15
  ## [1.6.3](https://github.com/appium/appium-mac2-driver/compare/v1.6.2...v1.6.3) (2023-06-16)
2
16
 
3
17
 
package/README.md CHANGED
@@ -217,6 +217,7 @@ startY | number | if `sourceElementId` and `destinationElementId` are unset | st
217
217
  endX | number | if `sourceElementId` and `destinationElementId` are unset | end X coordinate | 200
218
218
  endY | number | if `sourceElementId` and `destinationElementId` are unset | end Y coordinate | 220
219
219
  duration | number | yes | The number of float seconds to hold the mouse button | 2.5
220
+ holdDuration | number | yes | Touch hold duration in float seconds | 2.5
220
221
  velocity | number | no | Dragging velocity in pixels per second. If not provided then the default velocity is used. See official documentation on [XCUIGestureVelocity structure](https://developer.apple.com/documentation/xctest/xcuigesturevelocity) for more details | 2500
221
222
  keyModifierFlags | number | no | if set then the given key modifiers will be applied while drag is performed. See the official documentation on [XCUIKeyModifierFlags enumeration](https://developer.apple.com/documentation/xctest/xcuikeymodifierflags) for more details | `1 << 1 | 1 << 2`
222
223
 
@@ -341,6 +342,7 @@ startY | number | if `sourceElementId` and `destinationElementId` are unset | st
341
342
  endX | number | if `sourceElementId` and `destinationElementId` are unset | end X coordinate | 200
342
343
  endY | number | if `sourceElementId` and `destinationElementId` are unset | end Y coordinate | 220
343
344
  duration | number | yes | The number of float seconds to hold the touch | 2.5
345
+ holdDuration | number | yes | Touch hold duration in float seconds | 2.5
344
346
  velocity | number | no | Dragging velocity in pixels per second. If not provided then the default velocity is used. See official documentation on [XCUIGestureVelocity structure](https://developer.apple.com/documentation/xctest/xcuigesturevelocity) for more details | 2500
345
347
  keyModifierFlags | number | no | if set then the given key modifiers will be applied while the gesture is performed. See the official documentation on [XCUIKeyModifierFlags enumeration](https://developer.apple.com/documentation/xctest/xcuikeymodifierflags) for more details | `1 << 1 | 1 << 2`
346
348
 
package/build/index.js CHANGED
@@ -1,18 +1,10 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "Mac2Driver", {
8
- enumerable: true,
9
- get: function () {
10
- return _driver.default;
11
- }
12
- });
13
- exports.default = void 0;
14
- require("source-map-support/register");
15
- var _driver = _interopRequireDefault(require("./lib/driver"));
16
- var _default = _driver.default;
17
- exports.default = _default;
18
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfZHJpdmVyIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJfZGVmYXVsdCIsIk1hYzJEcml2ZXIiLCJleHBvcnRzIiwiZGVmYXVsdCJdLCJzb3VyY2VzIjpbIi4uL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBNYWMyRHJpdmVyIGZyb20gJy4vbGliL2RyaXZlcic7XG5cbmV4cG9ydCBkZWZhdWx0IE1hYzJEcml2ZXI7XG5leHBvcnQgeyBNYWMyRHJpdmVyIH07XG4iXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7O0FBQUEsSUFBQUEsT0FBQSxHQUFBQyxzQkFBQSxDQUFBQyxPQUFBO0FBQXNDLElBQUFDLFFBQUEsR0FFdkJDLGVBQVU7QUFBQUMsT0FBQSxDQUFBQyxPQUFBLEdBQUFILFFBQUEifQ==
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Mac2Driver = void 0;
7
+ const driver_1 = __importDefault(require("./lib/driver"));
8
+ exports.Mac2Driver = driver_1.default;
9
+ exports.default = driver_1.default;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,96 @@
1
+ export default commands;
2
+ export type LaunchAppOptions = {
3
+ /**
4
+ * bundle identifier of the app to be launched
5
+ * or activated
6
+ */
7
+ bundleId: string;
8
+ /**
9
+ * the list of command line arguments
10
+ * for the app to be be launched with. This parameter is ignored if the app
11
+ * is already running.
12
+ */
13
+ arguments: string[];
14
+ /**
15
+ * environment variables mapping. Custom
16
+ * variables are added to the default process environment.
17
+ */
18
+ environment: any;
19
+ };
20
+ export type ActivateAppOptions = {
21
+ /**
22
+ * bundle identifier of the app to be activated
23
+ */
24
+ bundleId: string;
25
+ };
26
+ export type TerminateAppOptions = {
27
+ /**
28
+ * bundle identifier of the app to be terminated
29
+ */
30
+ bundleId: string;
31
+ };
32
+ export type QueryAppStateOptions = {
33
+ /**
34
+ * bundle identifier of the app whose state should be queried
35
+ */
36
+ bundleId: string;
37
+ };
38
+ declare namespace commands {
39
+ /**
40
+ * @typedef {Object} LaunchAppOptions
41
+ * @property {string} bundleId bundle identifier of the app to be launched
42
+ * or activated
43
+ * @property {string[]} arguments the list of command line arguments
44
+ * for the app to be be launched with. This parameter is ignored if the app
45
+ * is already running.
46
+ * @property {Object} environment environment variables mapping. Custom
47
+ * variables are added to the default process environment.
48
+ */
49
+ /**
50
+ * Start an app with given bundle identifier or activates it
51
+ * if the app is already running. An exception is thrown if the
52
+ * app with the given identifier cannot be found.
53
+ *
54
+ * @param {LaunchAppOptions} opts
55
+ */
56
+ function macosLaunchApp(opts: LaunchAppOptions): Promise<any>;
57
+ /**
58
+ * @typedef {Object} ActivateAppOptions
59
+ * @property {string} bundleId bundle identifier of the app to be activated
60
+ */
61
+ /**
62
+ * Activate an app with given bundle identifier. An exception is thrown if the
63
+ * app cannot be found or is not running.
64
+ *
65
+ * @param {ActivateAppOptions} opts
66
+ */
67
+ function macosActivateApp(opts: ActivateAppOptions): Promise<any>;
68
+ /**
69
+ * @typedef {Object} TerminateAppOptions
70
+ * @property {string} bundleId bundle identifier of the app to be terminated
71
+ */
72
+ /**
73
+ * Terminate an app with given bundle identifier. An exception is thrown if the
74
+ * app cannot be found.
75
+ *
76
+ * @param {TerminateAppOptions} opts
77
+ * @returns {Promise<boolean>} `true` if the app was running and has been successfully terminated.
78
+ * `false` if the app was not running before.
79
+ */
80
+ function macosTerminateApp(opts: TerminateAppOptions): Promise<boolean>;
81
+ /**
82
+ * @typedef {Object} QueryAppStateOptions
83
+ * @property {string} bundleId bundle identifier of the app whose state should be queried
84
+ */
85
+ /**
86
+ * Query an app state with given bundle identifier. An exception is thrown if the
87
+ * app cannot be found.
88
+ *
89
+ * @param {QueryAppStateOptions} opts
90
+ * @returns {Promise<number>} The application state code. See
91
+ * https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc
92
+ * for more details
93
+ */
94
+ function macosQueryAppState(opts: QueryAppStateOptions): Promise<number>;
95
+ }
96
+ //# sourceMappingURL=app-management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-management.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":";;;;;;cAIc,MAAM;;;;;;eAEN,MAAM,EAAE;;;;;;;;;;;cAyBR,MAAM;;;;;;cAgBN,MAAM;;;;;;cAkBN,MAAM;;;IA/DpB;;;;;;;;;OASG;IAEH;;;;;;OAMG;IACH,8DAOC;IAED;;;OAGG;IAEH;;;;;OAKG;IACH,kEAGC;IAED;;;OAGG;IAEH;;;;;;;OAOG;IACH,wEAGC;IAED;;;OAGG;IAEH;;;;;;;;OAQG;IACH,yEAGC"}
@@ -1,46 +1,77 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- require("source-map-support/register");
2
+ Object.defineProperty(exports, "__esModule", { value: true });
8
3
  const commands = {};
9
- commands.macosLaunchApp = async function macosLaunchApp(opts = {}) {
10
- const {
11
- bundleId,
12
- environment
13
- } = opts;
14
- return await this.wda.proxy.command('/wda/apps/launch', 'POST', {
15
- arguments: opts.arguments,
16
- environment,
17
- bundleId
18
- });
4
+ /**
5
+ * @typedef {Object} LaunchAppOptions
6
+ * @property {string} bundleId bundle identifier of the app to be launched
7
+ * or activated
8
+ * @property {string[]} arguments the list of command line arguments
9
+ * for the app to be be launched with. This parameter is ignored if the app
10
+ * is already running.
11
+ * @property {Object} environment environment variables mapping. Custom
12
+ * variables are added to the default process environment.
13
+ */
14
+ /**
15
+ * Start an app with given bundle identifier or activates it
16
+ * if the app is already running. An exception is thrown if the
17
+ * app with the given identifier cannot be found.
18
+ *
19
+ * @param {LaunchAppOptions} opts
20
+ */
21
+ commands.macosLaunchApp = async function macosLaunchApp(opts) {
22
+ const { bundleId, environment } = opts ?? {};
23
+ return await this.wda.proxy.command('/wda/apps/launch', 'POST', {
24
+ arguments: opts.arguments,
25
+ environment,
26
+ bundleId,
27
+ });
19
28
  };
20
- commands.macosActivateApp = async function macosActivateApp(opts = {}) {
21
- const {
22
- bundleId
23
- } = opts;
24
- return await this.wda.proxy.command('/wda/apps/activate', 'POST', {
25
- bundleId
26
- });
29
+ /**
30
+ * @typedef {Object} ActivateAppOptions
31
+ * @property {string} bundleId bundle identifier of the app to be activated
32
+ */
33
+ /**
34
+ * Activate an app with given bundle identifier. An exception is thrown if the
35
+ * app cannot be found or is not running.
36
+ *
37
+ * @param {ActivateAppOptions} opts
38
+ */
39
+ commands.macosActivateApp = async function macosActivateApp(opts) {
40
+ const { bundleId } = opts ?? {};
41
+ return await this.wda.proxy.command('/wda/apps/activate', 'POST', { bundleId });
27
42
  };
28
- commands.macosTerminateApp = async function macosTerminateApp(opts = {}) {
29
- const {
30
- bundleId
31
- } = opts;
32
- return await this.wda.proxy.command('/wda/apps/terminate', 'POST', {
33
- bundleId
34
- });
43
+ /**
44
+ * @typedef {Object} TerminateAppOptions
45
+ * @property {string} bundleId bundle identifier of the app to be terminated
46
+ */
47
+ /**
48
+ * Terminate an app with given bundle identifier. An exception is thrown if the
49
+ * app cannot be found.
50
+ *
51
+ * @param {TerminateAppOptions} opts
52
+ * @returns {Promise<boolean>} `true` if the app was running and has been successfully terminated.
53
+ * `false` if the app was not running before.
54
+ */
55
+ commands.macosTerminateApp = async function macosTerminateApp(opts) {
56
+ const { bundleId } = opts ?? {};
57
+ return await this.wda.proxy.command('/wda/apps/terminate', 'POST', { bundleId });
35
58
  };
36
- commands.macosQueryAppState = async function macosQueryAppState(opts = {}) {
37
- const {
38
- bundleId
39
- } = opts;
40
- return await this.wda.proxy.command('/wda/apps/state', 'POST', {
41
- bundleId
42
- });
59
+ /**
60
+ * @typedef {Object} QueryAppStateOptions
61
+ * @property {string} bundleId bundle identifier of the app whose state should be queried
62
+ */
63
+ /**
64
+ * Query an app state with given bundle identifier. An exception is thrown if the
65
+ * app cannot be found.
66
+ *
67
+ * @param {QueryAppStateOptions} opts
68
+ * @returns {Promise<number>} The application state code. See
69
+ * https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc
70
+ * for more details
71
+ */
72
+ commands.macosQueryAppState = async function macosQueryAppState(opts) {
73
+ const { bundleId } = opts ?? {};
74
+ return await this.wda.proxy.command('/wda/apps/state', 'POST', { bundleId });
43
75
  };
44
- var _default = commands;
45
- exports.default = _default;
46
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJjb21tYW5kcyIsIm1hY29zTGF1bmNoQXBwIiwib3B0cyIsImJ1bmRsZUlkIiwiZW52aXJvbm1lbnQiLCJ3ZGEiLCJwcm94eSIsImNvbW1hbmQiLCJhcmd1bWVudHMiLCJtYWNvc0FjdGl2YXRlQXBwIiwibWFjb3NUZXJtaW5hdGVBcHAiLCJtYWNvc1F1ZXJ5QXBwU3RhdGUiLCJfZGVmYXVsdCIsImV4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.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-management.js","names":["commands","macosLaunchApp","opts","bundleId","environment","wda","proxy","command","arguments","macosActivateApp","macosTerminateApp","macosQueryAppState","_default","exports","default"],"sources":["../../../lib/commands/app-management.js"],"sourcesContent":["const commands = {};\n\n/**\n * @typedef {Object} LaunchAppOptions\n * @property {!string} bundleId bundle identifier of the app to be launched\n * or activated\n * @property {?Array<string>} arguments the list of command line arguments\n * for the app to be be launched with. This parameter is ignored if the app\n * is already running.\n * @property {Object} environment environment variables mapping. Custom\n * variables are added to the default process environment.\n */\n\n/**\n * Start an app with given bundle identifier or activates it\n * if the app is already running. An exception is thrown if the\n * app with the given identifier cannot be found.\n *\n * @param {LaunchAppOptions} opts\n */\ncommands.macosLaunchApp = async function macosLaunchApp (opts = {}) {\n const { bundleId, environment } = opts;\n return await this.wda.proxy.command('/wda/apps/launch', 'POST', {\n arguments: opts.arguments,\n environment,\n bundleId,\n });\n};\n\n/**\n * @typedef {Object} ActivateAppOptions\n * @property {!string} bundleId bundle identifier of the app to be activated\n */\n\n/**\n * Activate an app with given bundle identifier. An exception is thrown if the\n * app cannot be found or is not running.\n *\n * @param {ActivateAppOptions} opts\n */\ncommands.macosActivateApp = async function macosActivateApp (opts = {}) {\n const { bundleId } = opts;\n return await this.wda.proxy.command('/wda/apps/activate', 'POST', { bundleId });\n};\n\n/**\n * @typedef {Object} TerminateAppOptions\n * @property {!string} bundleId bundle identifier of the app to be terminated\n */\n\n/**\n * Terminate an app with given bundle identifier. An exception is thrown if the\n * app cannot be found.\n *\n * @param {TerminateAppOptions} opts\n * @returns {boolean} `true` if the app was running and has been successfully terminated.\n * `false` if the app was not running before.\n */\ncommands.macosTerminateApp = async function macosTerminateApp (opts = {}) {\n const { bundleId } = opts;\n return await this.wda.proxy.command('/wda/apps/terminate', 'POST', { bundleId });\n};\n\n/**\n * @typedef {Object} QueryAppStateOptions\n * @property {!string} bundleId bundle identifier of the app whose state should be queried\n */\n\n/**\n * Query an app state with given bundle identifier. An exception is thrown if the\n * app cannot be found.\n *\n * @param {QueryAppStateOptions} opts\n * @returns {number} The application state code. See\n * https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc\n * for more details\n */\ncommands.macosQueryAppState = async function macosQueryAppState (opts = {}) {\n const { bundleId } = opts;\n return await this.wda.proxy.command('/wda/apps/state', 'POST', { bundleId });\n};\n\nexport default commands;\n"],"mappings":";;;;;;;AAAA,MAAMA,QAAQ,GAAG,CAAC,CAAC;AAoBnBA,QAAQ,CAACC,cAAc,GAAG,eAAeA,cAAcA,CAAEC,IAAI,GAAG,CAAC,CAAC,EAAE;EAClE,MAAM;IAAEC,QAAQ;IAAEC;EAAY,CAAC,GAAGF,IAAI;EACtC,OAAO,MAAM,IAAI,CAACG,GAAG,CAACC,KAAK,CAACC,OAAO,CAAC,kBAAkB,EAAE,MAAM,EAAE;IAC9DC,SAAS,EAAEN,IAAI,CAACM,SAAS;IACzBJ,WAAW;IACXD;EACF,CAAC,CAAC;AACJ,CAAC;AAaDH,QAAQ,CAACS,gBAAgB,GAAG,eAAeA,gBAAgBA,CAAEP,IAAI,GAAG,CAAC,CAAC,EAAE;EACtE,MAAM;IAAEC;EAAS,CAAC,GAAGD,IAAI;EACzB,OAAO,MAAM,IAAI,CAACG,GAAG,CAACC,KAAK,CAACC,OAAO,CAAC,oBAAoB,EAAE,MAAM,EAAE;IAAEJ;EAAS,CAAC,CAAC;AACjF,CAAC;AAeDH,QAAQ,CAACU,iBAAiB,GAAG,eAAeA,iBAAiBA,CAAER,IAAI,GAAG,CAAC,CAAC,EAAE;EACxE,MAAM;IAAEC;EAAS,CAAC,GAAGD,IAAI;EACzB,OAAO,MAAM,IAAI,CAACG,GAAG,CAACC,KAAK,CAACC,OAAO,CAAC,qBAAqB,EAAE,MAAM,EAAE;IAAEJ;EAAS,CAAC,CAAC;AAClF,CAAC;AAgBDH,QAAQ,CAACW,kBAAkB,GAAG,eAAeA,kBAAkBA,CAAET,IAAI,GAAG,CA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AC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;AACnF,CAAC,CAAC;AAEF;;;GAGG;AAEH;;;;;;;;GAQG;AACH,QAAQ,CAAC,kBAAkB,GAAG,KAAK,UAAU,kBAAkB,CAAE,IAAI;IACnE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;IAChC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC/E,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
@@ -0,0 +1,57 @@
1
+ export default commands;
2
+ export type ExecAppleScriptOptions = {
3
+ /**
4
+ * A valid AppleScript to execute
5
+ */
6
+ script: string;
7
+ /**
8
+ * Overrides the scripting language. Basically, sets the value of `-l` command
9
+ * line argument of `osascript` tool. If unset the AppleScript language is assumed.
10
+ */
11
+ language: string;
12
+ /**
13
+ * A valid AppleScript as a single command (no line breaks) to execute
14
+ */
15
+ command: string;
16
+ /**
17
+ * [20000] The number of seconds to wait until a long-running command is
18
+ * finished. An error is thrown if the command is still running after this timeout expires.
19
+ */
20
+ timeout: number;
21
+ /**
22
+ * The path to an existing folder, which is going to be set as the
23
+ * working directory for the command/script being executed.
24
+ */
25
+ cwd: string;
26
+ };
27
+ export namespace commands {
28
+ /**
29
+ * @typedef {Object} ExecAppleScriptOptions
30
+ * @property {string} script A valid AppleScript to execute
31
+ * @property {string} language Overrides the scripting language. Basically, sets the value of `-l` command
32
+ * line argument of `osascript` tool. If unset the AppleScript language is assumed.
33
+ * @property {string} command A valid AppleScript as a single command (no line breaks) to execute
34
+ * @property {number} timeout [20000] The number of seconds to wait until a long-running command is
35
+ * finished. An error is thrown if the command is still running after this timeout expires.
36
+ * @property {string} cwd The path to an existing folder, which is going to be set as the
37
+ * working directory for the command/script being executed.
38
+ */
39
+ /**
40
+ * Executes the given AppleScript command or a whole script based on the
41
+ * given options. Either of these options must be provided. If both are provided
42
+ * then the `command` one gets the priority.
43
+ * Note that AppleScript command cannot contain line breaks. Consider making it
44
+ * to a script in such case.
45
+ * Note that by default AppleScript engine blocks commands/scripts execution if your script
46
+ * is trying to access some private entities, like cameras or the desktop screen
47
+ * and no permissions to do it are given to the parent (for example, Appium or Terminal)
48
+ * process in System Preferences -> Privacy list.
49
+ *
50
+ * @param {ExecAppleScriptOptions} opts
51
+ * @returns {Promise<string>} The actual stdout of the given command/script
52
+ * @throws {Error} If the exit code of the given command/script is not zero.
53
+ * The actual stderr output is set to the error message value.
54
+ */
55
+ function macosExecAppleScript(opts: ExecAppleScriptOptions): Promise<string>;
56
+ }
57
+ //# sourceMappingURL=applescript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applescript.d.ts","sourceRoot":"","sources":["../../../lib/commands/applescript.js"],"names":[],"mappings":";;;;;YAYc,MAAM;;;;;cACN,MAAM;;;;aAEN,MAAM;;;;;aACN,MAAM;;;;;SAEN,MAAM;;;IARpB;;;;;;;;;;OAUG;IAEH;;;;;;;;;;;;;;;OAeG;IACH,6EA6CC"}
@@ -1,67 +1,84 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.commands = void 0;
8
- require("source-map-support/register");
9
- var _support = require("appium/support");
10
- var _teen_process = require("teen_process");
11
- var _logger = _interopRequireDefault(require("../logger"));
12
- var _path = _interopRequireDefault(require("path"));
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.commands = void 0;
7
+ const support_1 = require("appium/support");
8
+ const teen_process_1 = require("teen_process");
9
+ const logger_1 = __importDefault(require("../logger"));
10
+ const path_1 = __importDefault(require("path"));
13
11
  const OSASCRIPT = 'osascript';
14
12
  const APPLE_SCRIPT_FEATURE = 'apple_script';
15
13
  const commands = {};
16
14
  exports.commands = commands;
17
- commands.macosExecAppleScript = async function macosExecAppleScript(opts = {}) {
18
- this.ensureFeatureEnabled(APPLE_SCRIPT_FEATURE);
19
- const {
20
- script,
21
- language,
22
- command,
23
- cwd,
24
- timeout
25
- } = opts;
26
- if (!script && !command) {
27
- _logger.default.errorAndThrow('AppleScript script/command must not be empty');
28
- }
29
- if (/\n/.test(command)) {
30
- _logger.default.errorAndThrow('AppleScript commands cannot contain line breaks');
31
- }
32
- const shouldRunScript = !command;
33
- const args = [];
34
- if (language) {
35
- args.push('-l', language);
36
- }
37
- let tmpRoot;
38
- try {
39
- if (shouldRunScript) {
40
- tmpRoot = await _support.tempDir.openDir();
41
- const tmpScriptPath = _path.default.resolve(tmpRoot, 'appium_script.scpt');
42
- await _support.fs.writeFile(tmpScriptPath, script, 'utf8');
43
- args.push(tmpScriptPath);
44
- } else {
45
- args.push('-e', command);
15
+ /**
16
+ * @typedef {Object} ExecAppleScriptOptions
17
+ * @property {string} script A valid AppleScript to execute
18
+ * @property {string} language Overrides the scripting language. Basically, sets the value of `-l` command
19
+ * line argument of `osascript` tool. If unset the AppleScript language is assumed.
20
+ * @property {string} command A valid AppleScript as a single command (no line breaks) to execute
21
+ * @property {number} timeout [20000] The number of seconds to wait until a long-running command is
22
+ * finished. An error is thrown if the command is still running after this timeout expires.
23
+ * @property {string} cwd The path to an existing folder, which is going to be set as the
24
+ * working directory for the command/script being executed.
25
+ */
26
+ /**
27
+ * Executes the given AppleScript command or a whole script based on the
28
+ * given options. Either of these options must be provided. If both are provided
29
+ * then the `command` one gets the priority.
30
+ * Note that AppleScript command cannot contain line breaks. Consider making it
31
+ * to a script in such case.
32
+ * Note that by default AppleScript engine blocks commands/scripts execution if your script
33
+ * is trying to access some private entities, like cameras or the desktop screen
34
+ * and no permissions to do it are given to the parent (for example, Appium or Terminal)
35
+ * process in System Preferences -> Privacy list.
36
+ *
37
+ * @param {ExecAppleScriptOptions} opts
38
+ * @returns {Promise<string>} The actual stdout of the given command/script
39
+ * @throws {Error} If the exit code of the given command/script is not zero.
40
+ * The actual stderr output is set to the error message value.
41
+ */
42
+ commands.macosExecAppleScript = async function macosExecAppleScript(opts) {
43
+ this.ensureFeatureEnabled(APPLE_SCRIPT_FEATURE);
44
+ const { script, language, command, cwd, timeout, } = opts ?? {};
45
+ if (!script && !command) {
46
+ logger_1.default.errorAndThrow('AppleScript script/command must not be empty');
47
+ }
48
+ if (/\n/.test(command)) {
49
+ logger_1.default.errorAndThrow('AppleScript commands cannot contain line breaks');
50
+ }
51
+ // 'command' has priority over 'script'
52
+ const shouldRunScript = !command;
53
+ const args = [];
54
+ if (language) {
55
+ args.push('-l', language);
46
56
  }
47
- _logger.default.info(`Running ${OSASCRIPT} with arguments: ${_support.util.quote(args)}`);
57
+ let tmpRoot;
48
58
  try {
49
- const {
50
- stdout
51
- } = await (0, _teen_process.exec)(OSASCRIPT, args, {
52
- cwd,
53
- timeout
54
- });
55
- return stdout;
56
- } catch (e) {
57
- throw new Error(e.stderr || e.message);
59
+ if (shouldRunScript) {
60
+ tmpRoot = await support_1.tempDir.openDir();
61
+ const tmpScriptPath = path_1.default.resolve(tmpRoot, 'appium_script.scpt');
62
+ await support_1.fs.writeFile(tmpScriptPath, script, 'utf8');
63
+ args.push(tmpScriptPath);
64
+ }
65
+ else {
66
+ args.push('-e', command);
67
+ }
68
+ logger_1.default.info(`Running ${OSASCRIPT} with arguments: ${support_1.util.quote(args)}`);
69
+ try {
70
+ const { stdout } = await (0, teen_process_1.exec)(OSASCRIPT, args, { cwd, timeout });
71
+ return stdout;
72
+ }
73
+ catch (e) {
74
+ throw new Error(e.stderr || e.message);
75
+ }
58
76
  }
59
- } finally {
60
- if (tmpRoot) {
61
- await _support.fs.rimraf(tmpRoot);
77
+ finally {
78
+ if (tmpRoot) {
79
+ await support_1.fs.rimraf(tmpRoot);
80
+ }
62
81
  }
63
- }
64
82
  };
65
- var _default = commands;
66
- exports.default = _default;
67
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfc3VwcG9ydCIsInJlcXVpcmUiLCJfdGVlbl9wcm9jZXNzIiwiX2xvZ2dlciIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJfcGF0aCIsIk9TQVNDUklQVCIsIkFQUExFX1NDUklQVF9GRUFUVVJFIiwiY29tbWFuZHMiLCJleHBvcnRzIiwibWFjb3NFeGVjQXBwbGVTY3JpcHQiLCJvcHRzIiwiZW5zdXJlRmVhdHVyZUVuYWJsZWQiLCJzY3JpcHQiLCJsYW5ndWFnZSIsImNvbW1hbmQiLCJjd2QiLCJ0aW1lb3V0IiwibG9nIiwiZXJyb3JBbmRUaHJvdyIsInRlc3QiLCJzaG91bGRSdW5TY3JpcHQiLCJhcmdzIiwicHVzaCIsInRtcFJvb3QiLCJ0ZW1wRGlyIiwib3BlbkRpciIsInRtcFNjcmlwdFBhdGgiLCJwYXRoIiwicmVzb2x2ZSIsImZzIiwid3JpdGVGaWxlIiwiaW5mbyIsInV0aWwiLCJxdW90ZSIsInN0ZG91dCIsImV4ZWMiLCJlIiwiRXJyb3IiLCJzdGRlcnIiLCJtZXNzYWdlIiwicmltcmFmIiwiX2RlZmF1bHQiLCJkZWZhdWx0Il0sInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL2NvbW1hbmRzL2FwcGxlc2NyaXB0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGZzLCB0ZW1wRGlyLCB1dGlsIH0gZnJvbSAnYXBwaXVtL3N1cHBvcnQnO1xuaW1wb3J0IHsgZXhlYyB9IGZyb20gJ3RlZW5fcHJvY2Vzcyc7XG5pbXBvcnQgbG9nIGZyb20gJy4uL2xvZ2dlcic7XG5pbXBvcnQgcGF0aCBmcm9tICdwYXRoJztcblxuY29uc3Q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0FBTyxDQUFDTCxPQUFPLEVBQUUsb0JBQW9CLENBQUM7TUFDakUsTUFBTU0sV0FBRSxDQUFDQyxTQUFTLENBQUNKLGFBQWEsRUFBRWQsTUFBTSxFQUFFLE1BQU0sQ0FBQztNQUNqRFMsSUFBSSxDQUFDQyxJQUFJLENBQUNJLGFBQWEsQ0FBQztJQUMxQixDQUFDLE1BQU07TUFDTEwsSUFBSSxDQUFDQyxJQUFJLENBQUMsSUFBSSxFQUFFUixPQUFPLENBQUM7SUFDMUI7SUFDQUcsZUFBRyxDQUFDYyxJQUFJLENBQUUsV0FBVTFCLFNBQVUsb0JBQW1CMkIsYUFBSSxDQUFDQyxLQUFLLENBQUNaLElBQUksQ0FBRSxFQUFDLENBQUM7SUFDcEUsSUFBSTtNQUNGLE1BQU07UUFBQ2E7TUFBTSxDQUFDLEdBQUcsTUFBTSxJQUFBQyxrQkFBSSxFQUFDOUIsU0FBUyxFQUFFZ0IsSUFBSSxFQUFFO1FBQUNOLEdBQUc7UUFBRUM7TUFBTyxDQUFDLENBQUM7TUFDNUQsT0FBT2tCLE1BQU07SUFDZixDQUFDLENBQUMsT0FBT0UsQ0FBQyxFQUFFO01BQ1YsTUFBTSxJQUFJQyxLQUFLLENBQUNELENBQUMsQ0FBQ0UsTUFBTSxJQUFJRixDQUFDLENBQUNHLE9BQU8sQ0FBQztJQUN4QztFQUNGLENBQUMsU0FBUztJQUNSLElBQUloQixPQUFPLEVBQUU7TUFDWCxNQUFNTSxXQUFFLENBQUNXLE1BQU0sQ0FBQ2pCLE9BQU8sQ0FBQztJQUMxQjtFQUNGO0FBQ0YsQ0FBQztBQUFDLElBQUFrQixRQUFBLEdBR2FsQyxRQUFRO0FBQUFDLE9BQUEsQ0FBQWtDLE9BQUEsR0FBQUQsUUFBQSJ9
83
+ exports.default = commands;
84
+ //# sourceMappingURL=applescript.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"applescript.js","names":["_support","require","_teen_process","_logger","_interopRequireDefault","_path","OSASCRIPT","APPLE_SCRIPT_FEATURE","commands","exports","macosExecAppleScript","opts","ensureFeatureEnabled","script","language","command","cwd","timeout","log","errorAndThrow","test","shouldRunScript","args","push","tmpRoot","tempDir","openDir","tmpScriptPath","path","resolve","fs","writeFile","info","util","quote","stdout","exec","e","Error","stderr","message","rimraf","_default","default"],"sources":["../../../lib/commands/applescript.js"],"sourcesContent":["import { fs, tempDir, util } from 'appium/support';\nimport { exec } from 'teen_process';\nimport log from '../logger';\nimport path from 'path';\n\nconst OSASCRIPT = 'osascript';\nconst APPLE_SCRIPT_FEATURE = 'apple_script';\n\nconst commands = {};\n\n/**\n * @typedef {Object} ExecAppleScriptOptions\n * @property {?string} script A valid AppleScript to execute\n * @property {?string} language Overrides the scripting language. Basically, sets the value of `-l` command\n * line argument of `osascript` tool. If unset the AppleScript language is assumed.\n * @property {?string} command A valid AppleScript as a single command (no line breaks) to execute\n * @property {?number} timeout [20000] The number of seconds to wait until a long-running command is\n * finished. An error is thrown if the command is still running after this timeout expires.\n * @property {?string} cwd The path to an existing folder, which is going to be set as the\n * working directory for the command/script being executed.\n */\n\n/**\n * Executes the given AppleScript command or a whole script based on the\n * given options. Either of these options must be provided. If both are provided\n * then the `command` one gets the priority.\n * Note that AppleScript command cannot contain line breaks. Consider making it\n * to a script in such case.\n * Note that by default AppleScript engine blocks commands/scripts execution if your script\n * is trying to access some private entities, like cameras or the desktop screen\n * and no permissions to do it are given to the parent (for example, Appium or Terminal)\n * process in System Preferences -> Privacy list.\n *\n * @param {!ExecAppleScriptOptions} opts\n * @returns {string} The actual stdout of the given command/script\n * @throws {Error} If the exit code of the given command/script is not zero.\n * The actual stderr output is set to the error message value.\n */\ncommands.macosExecAppleScript = async function macosExecAppleScript (opts = {}) {\n this.ensureFeatureEnabled(APPLE_SCRIPT_FEATURE);\n\n const {\n script,\n language,\n command,\n cwd,\n timeout,\n } = opts;\n if (!script && !command) {\n log.errorAndThrow('AppleScript script/command must not be empty');\n }\n if (/\\n/.test(command)) {\n log.errorAndThrow('AppleScript commands cannot contain line breaks');\n }\n // 'command' has priority over 'script'\n const shouldRunScript = !command;\n\n const args = [];\n if (language) {\n args.push('-l', language);\n }\n let tmpRoot;\n try {\n if (shouldRunScript) {\n tmpRoot = await tempDir.openDir();\n const tmpScriptPath = path.resolve(tmpRoot, 'appium_script.scpt');\n await fs.writeFile(tmpScriptPath, script, 'utf8');\n args.push(tmpScriptPath);\n } else {\n args.push('-e', command);\n }\n log.info(`Running ${OSASCRIPT} with arguments: ${util.quote(args)}`);\n try {\n const {stdout} = await exec(OSASCRIPT, args, {cwd, timeout});\n return stdout;\n } catch (e) {\n throw new Error(e.stderr || e.message);\n }\n } finally {\n if (tmpRoot) {\n await fs.rimraf(tmpRoot);\n }\n }\n};\n\nexport { commands };\nexport default commands;\n"],"mappings":";;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AAEA,MAAMK,SAAS,GAAG,WAAW;AAC7B,MAAMC,oBAAoB,GAAG,cAAc;AAE3C,MAAMC,QAAQ,GAAG,CAAC,CAAC;AAACC,OAAA,CAAAD,QAAA,GAAAA,QAAA;AA8BpBA,QAAQ,CAACE,oBAAoB,GAAG,eAAeA,oBAAoBA,CAAEC,IAAI,GAAG,CAAC,CAAC,EAAE;EAC9E,IAAI,CAACC,oBAAoB,CAACL,oBAAoB,CAAC;EAE/C,MAAM;IACJM,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,GAAG;IACHC;EACF,CAAC,GAAGN,IAAI;EACR,IAAI,CAACE,MAAM,IAAI,CAACE,OAAO,EAAE;IACvBG,eAAG,CAACC,aAAa,CAAC,8CAA8C,CAAC;EACnE;EACA,IAAI,IAAI,CAACC,IAAI,CAACL,OAAO,CAAC,EAAE;IACtBG,eAAG,CAACC,aAAa,CAAC,iDAAiD,CAAC;EACtE;EAEA,MAAME,eAAe,GAAG,CAACN,OAAO;EAEhC,MAAMO,IAAI,GAAG,EAAE;EACf,IAAIR,QAAQ,EAAE;IACZQ,IAAI,CAACC,IAAI,CAAC,IAAI,EAAET,QAAQ,CAAC;EAC3B;EACA,IAAIU,OAAO;EACX,IAAI;IACF,IAAIH,eAAe,EAAE;MACnBG,OAAO,GAAG,MAAMC,gBAAO,CAACC,OAAO,CAAC,CAAC;MACjC,MAAMC,aAAa,GAAGC,aAAI,CAACC,OAAO,CAACL,OAAO,EAAE,oBAAoB,CAAC;MACjE,MAAMM,WAAE,CAACC,SAAS,CAACJ,aAAa,EAAEd,MAAM,EAAE,MAAM,CAAC;MACjDS,IAAI,CAACC,IAAI,CAACI,aAAa,CAAC;IAC1B,CAAC,MAAM;MACLL,IAAI,CAACC,IAAI,CAAC,IAAI,EAAER,OAAO,CAAC;IAC1B;IACAG,eAAG,CAACc,IAAI,CAAE,WAAU1B,SAAU,oBAAmB2B,aAAI,CAACC,KAAK,CAACZ,IAAI,CAAE,EAAC,CAAC;IACpE,IAAI;MACF,MAAM;QAACa;MAAM,CAAC,GAAG,MAAM,IAAAC,kBAAI,EAAC9B,SAAS,EAAEgB,IAAI,EAAE;QAACN,GAAG;QAAEC;MAAO,CAAC,CAAC;MAC5D,OAAOkB,MAAM;IACf,CAAC,CAAC,OAAOE,CAAC,EAAE;MACV,MAAM,IAAIC,KAAK,CAACD,CAAC,CAACE,MAAM,IAAIF,CAAC,CAACG,OAAO,CAAC;IACxC;EACF,CAAC,SAAS;IACR,IAAIhB,OAAO,EAAE;MACX,MAAMM,WAAE,CAACW,MAAM,CAACjB,OAAO,CAAC;IAC1B;EACF;AACF,CAAC;AAAC,IAAAkB,QAAA,GAGalC,QAAQ;AAAAC,OAAA,CAAAkC,OAAA,GAAAD,QAAA"}
1
+ {"version":3,"file":"applescript.js","sourceRoot":"","sources":["../../../lib/commands/applescript.js"],"names":[],"mappings":";;;;;;AAAA,4CAAmD;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,CAAC,CAAC;SAC1B;QACD,gBAAG,CAAC,IAAI,CAAC,WAAW,SAAS,oBAAoB,cAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrE,IAAI;YACF,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAA,mBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,EAAC,GAAG,EAAE,OAAO,EAAC,CAAC,CAAC;YAC7D,OAAO,MAAM,CAAC;SACf;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;SACxC;KACF;YAAS;QACR,IAAI,OAAO,EAAE;YACX,MAAM,YAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SAC1B;KACF;AACH,CAAC,CAAC;AAGF,kBAAe,QAAQ,CAAC"}
@@ -0,0 +1,6 @@
1
+ export default commands;
2
+ declare namespace commands {
3
+ function execute(script: any, args: any): Promise<any>;
4
+ function executeMacosCommand(command: any, opts?: {}): Promise<any>;
5
+ }
6
+ //# sourceMappingURL=execute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/commands/execute.js"],"names":[],"mappings":";;IAuCA,uDAOC;IAED,oEAMC"}