appium 2.0.0-beta.6 → 2.0.0-beta.60

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 (204) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +156 -65
  3. package/build/lib/appium.d.ts +229 -0
  4. package/build/lib/appium.d.ts.map +1 -0
  5. package/build/lib/appium.js +678 -439
  6. package/build/lib/appium.js.map +1 -0
  7. package/build/lib/cli/args.d.ts +17 -0
  8. package/build/lib/cli/args.d.ts.map +1 -0
  9. package/build/lib/cli/args.js +263 -319
  10. package/build/lib/cli/args.js.map +1 -0
  11. package/build/lib/cli/driver-command.d.ts +102 -0
  12. package/build/lib/cli/driver-command.d.ts.map +1 -0
  13. package/build/lib/cli/driver-command.js +131 -81
  14. package/build/lib/cli/driver-command.js.map +1 -0
  15. package/build/lib/cli/extension-command.d.ts +402 -0
  16. package/build/lib/cli/extension-command.d.ts.map +1 -0
  17. package/build/lib/cli/extension-command.js +799 -383
  18. package/build/lib/cli/extension-command.js.map +1 -0
  19. package/build/lib/cli/extension.d.ts +23 -0
  20. package/build/lib/cli/extension.d.ts.map +1 -0
  21. package/build/lib/cli/extension.js +71 -54
  22. package/build/lib/cli/extension.js.map +1 -0
  23. package/build/lib/cli/parser.d.ts +84 -0
  24. package/build/lib/cli/parser.d.ts.map +1 -0
  25. package/build/lib/cli/parser.js +240 -128
  26. package/build/lib/cli/parser.js.map +1 -0
  27. package/build/lib/cli/plugin-command.d.ts +99 -0
  28. package/build/lib/cli/plugin-command.d.ts.map +1 -0
  29. package/build/lib/cli/plugin-command.js +125 -81
  30. package/build/lib/cli/plugin-command.js.map +1 -0
  31. package/build/lib/cli/utils.d.ts +29 -0
  32. package/build/lib/cli/utils.d.ts.map +1 -0
  33. package/build/lib/cli/utils.js +72 -51
  34. package/build/lib/cli/utils.js.map +1 -0
  35. package/build/lib/config-file.d.ts +100 -0
  36. package/build/lib/config-file.d.ts.map +1 -0
  37. package/build/lib/config-file.js +207 -0
  38. package/build/lib/config-file.js.map +1 -0
  39. package/build/lib/config.d.ts +49 -0
  40. package/build/lib/config.d.ts.map +1 -0
  41. package/build/lib/config.js +267 -202
  42. package/build/lib/config.js.map +1 -0
  43. package/build/lib/constants.d.ts +56 -0
  44. package/build/lib/constants.d.ts.map +1 -0
  45. package/build/lib/constants.js +73 -0
  46. package/build/lib/constants.js.map +1 -0
  47. package/build/lib/extension/driver-config.d.ts +82 -0
  48. package/build/lib/extension/driver-config.d.ts.map +1 -0
  49. package/build/lib/extension/driver-config.js +210 -0
  50. package/build/lib/extension/driver-config.js.map +1 -0
  51. package/build/lib/extension/extension-config.d.ts +270 -0
  52. package/build/lib/extension/extension-config.d.ts.map +1 -0
  53. package/build/lib/extension/extension-config.js +601 -0
  54. package/build/lib/extension/extension-config.js.map +1 -0
  55. package/build/lib/extension/index.d.ts +48 -0
  56. package/build/lib/extension/index.d.ts.map +1 -0
  57. package/build/lib/extension/index.js +105 -0
  58. package/build/lib/extension/index.js.map +1 -0
  59. package/build/lib/extension/manifest-migrations.d.ts +27 -0
  60. package/build/lib/extension/manifest-migrations.d.ts.map +1 -0
  61. package/build/lib/extension/manifest-migrations.js +134 -0
  62. package/build/lib/extension/manifest-migrations.js.map +1 -0
  63. package/build/lib/extension/manifest.d.ts +145 -0
  64. package/build/lib/extension/manifest.d.ts.map +1 -0
  65. package/build/lib/extension/manifest.js +528 -0
  66. package/build/lib/extension/manifest.js.map +1 -0
  67. package/build/lib/extension/package-changed.d.ts +11 -0
  68. package/build/lib/extension/package-changed.d.ts.map +1 -0
  69. package/build/lib/extension/package-changed.js +62 -0
  70. package/build/lib/extension/package-changed.js.map +1 -0
  71. package/build/lib/extension/plugin-config.d.ts +56 -0
  72. package/build/lib/extension/plugin-config.d.ts.map +1 -0
  73. package/build/lib/extension/plugin-config.js +102 -0
  74. package/build/lib/extension/plugin-config.js.map +1 -0
  75. package/build/lib/grid-register.d.ts +10 -0
  76. package/build/lib/grid-register.d.ts.map +1 -0
  77. package/build/lib/grid-register.js +122 -144
  78. package/build/lib/grid-register.js.map +1 -0
  79. package/build/lib/logger.d.ts +3 -0
  80. package/build/lib/logger.d.ts.map +1 -0
  81. package/build/lib/logger.js +5 -17
  82. package/build/lib/logger.js.map +1 -0
  83. package/build/lib/logsink.d.ts +4 -0
  84. package/build/lib/logsink.d.ts.map +1 -0
  85. package/build/lib/logsink.js +190 -187
  86. package/build/lib/logsink.js.map +1 -0
  87. package/build/lib/main.d.ts +62 -0
  88. package/build/lib/main.d.ts.map +1 -0
  89. package/build/lib/main.js +339 -229
  90. package/build/lib/main.js.map +1 -0
  91. package/build/lib/schema/arg-spec.d.ts +143 -0
  92. package/build/lib/schema/arg-spec.d.ts.map +1 -0
  93. package/build/lib/schema/arg-spec.js +164 -0
  94. package/build/lib/schema/arg-spec.js.map +1 -0
  95. package/build/lib/schema/cli-args.d.ts +19 -0
  96. package/build/lib/schema/cli-args.d.ts.map +1 -0
  97. package/build/lib/schema/cli-args.js +217 -0
  98. package/build/lib/schema/cli-args.js.map +1 -0
  99. package/build/lib/schema/cli-transformers.d.ts +5 -0
  100. package/build/lib/schema/cli-transformers.d.ts.map +1 -0
  101. package/build/lib/schema/cli-transformers.js +124 -0
  102. package/build/lib/schema/cli-transformers.js.map +1 -0
  103. package/build/lib/schema/index.d.ts +3 -0
  104. package/build/lib/schema/index.d.ts.map +1 -0
  105. package/build/lib/schema/index.js +19 -0
  106. package/build/lib/schema/index.js.map +1 -0
  107. package/build/lib/schema/keywords.d.ts +24 -0
  108. package/build/lib/schema/keywords.d.ts.map +1 -0
  109. package/build/lib/schema/keywords.js +128 -0
  110. package/build/lib/schema/keywords.js.map +1 -0
  111. package/build/lib/schema/schema.d.ts +260 -0
  112. package/build/lib/schema/schema.d.ts.map +1 -0
  113. package/build/lib/schema/schema.js +640 -0
  114. package/build/lib/schema/schema.js.map +1 -0
  115. package/build/lib/utils.d.ts +266 -0
  116. package/build/lib/utils.d.ts.map +1 -0
  117. package/build/lib/utils.js +349 -273
  118. package/build/lib/utils.js.map +1 -0
  119. package/build/types/cli.d.ts +134 -0
  120. package/build/types/cli.d.ts.map +1 -0
  121. package/build/types/cli.js +3 -0
  122. package/build/types/cli.js.map +1 -0
  123. package/build/types/index.d.ts +15 -0
  124. package/build/types/index.d.ts.map +1 -0
  125. package/build/types/index.js +19 -0
  126. package/build/types/index.js.map +1 -0
  127. package/build/types/manifest/base.d.ts +135 -0
  128. package/build/types/manifest/base.d.ts.map +1 -0
  129. package/build/types/manifest/base.js +3 -0
  130. package/build/types/manifest/base.js.map +1 -0
  131. package/build/types/manifest/index.d.ts +21 -0
  132. package/build/types/manifest/index.d.ts.map +1 -0
  133. package/build/types/manifest/index.js +42 -0
  134. package/build/types/manifest/index.js.map +1 -0
  135. package/build/types/manifest/v3.d.ts +139 -0
  136. package/build/types/manifest/v3.d.ts.map +1 -0
  137. package/build/types/manifest/v3.js +3 -0
  138. package/build/types/manifest/v3.js.map +1 -0
  139. package/build/types/manifest/v4.d.ts +139 -0
  140. package/build/types/manifest/v4.d.ts.map +1 -0
  141. package/build/types/manifest/v4.js +3 -0
  142. package/build/types/manifest/v4.js.map +1 -0
  143. package/driver.d.ts +1 -0
  144. package/driver.js +14 -0
  145. package/index.js +11 -0
  146. package/lib/appium.js +558 -186
  147. package/lib/cli/args.js +277 -422
  148. package/lib/cli/driver-command.js +132 -24
  149. package/lib/cli/extension-command.js +751 -272
  150. package/lib/cli/extension.js +49 -18
  151. package/lib/cli/parser.js +263 -83
  152. package/lib/cli/plugin-command.js +122 -22
  153. package/lib/cli/utils.js +24 -10
  154. package/lib/config-file.js +220 -0
  155. package/lib/config.js +246 -111
  156. package/lib/constants.js +79 -0
  157. package/lib/extension/driver-config.js +247 -0
  158. package/lib/extension/extension-config.js +709 -0
  159. package/lib/extension/index.js +116 -0
  160. package/lib/extension/manifest-migrations.js +136 -0
  161. package/lib/extension/manifest.js +580 -0
  162. package/lib/extension/package-changed.js +64 -0
  163. package/lib/extension/plugin-config.js +112 -0
  164. package/lib/grid-register.js +49 -35
  165. package/lib/logger.js +1 -2
  166. package/lib/logsink.js +64 -38
  167. package/lib/main.js +318 -103
  168. package/lib/schema/arg-spec.js +229 -0
  169. package/lib/schema/cli-args.js +238 -0
  170. package/lib/schema/cli-transformers.js +119 -0
  171. package/lib/schema/index.js +2 -0
  172. package/lib/schema/keywords.js +136 -0
  173. package/lib/schema/schema.js +725 -0
  174. package/lib/utils.js +289 -167
  175. package/package.json +84 -84
  176. package/plugin.d.ts +1 -0
  177. package/plugin.js +13 -0
  178. package/scripts/autoinstall-extensions.js +243 -0
  179. package/support.d.ts +1 -0
  180. package/support.js +13 -0
  181. package/tsconfig.json +25 -0
  182. package/types/cli.ts +193 -0
  183. package/types/index.ts +20 -0
  184. package/types/manifest/README.md +30 -0
  185. package/types/manifest/base.ts +158 -0
  186. package/types/manifest/index.ts +28 -0
  187. package/types/manifest/v3.ts +161 -0
  188. package/types/manifest/v4.ts +161 -0
  189. package/CHANGELOG.md +0 -3515
  190. package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
  191. package/build/lib/cli/npm.js +0 -208
  192. package/build/lib/cli/parser-helpers.js +0 -82
  193. package/build/lib/driver-config.js +0 -77
  194. package/build/lib/drivers.js +0 -96
  195. package/build/lib/extension-config.js +0 -253
  196. package/build/lib/plugin-config.js +0 -59
  197. package/build/lib/plugins.js +0 -14
  198. package/lib/cli/npm.js +0 -184
  199. package/lib/cli/parser-helpers.js +0 -79
  200. package/lib/driver-config.js +0 -46
  201. package/lib/drivers.js +0 -81
  202. package/lib/extension-config.js +0 -209
  203. package/lib/plugin-config.js +0 -34
  204. package/lib/plugins.js +0 -10
@@ -1,134 +1,246 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.getParser = getParser;
9
- exports.getDefaultServerArgs = getDefaultServerArgs;
10
- exports.default = void 0;
11
-
12
- require("source-map-support/register");
13
-
14
- var _path = _interopRequireDefault(require("path"));
15
-
16
- var _lodash = _interopRequireDefault(require("lodash"));
17
-
18
- var _argparse = require("argparse");
19
-
20
- var _args = require("./args");
21
-
22
- var _extensionConfig = require("../extension-config");
23
-
24
- var _utils = require("../utils");
25
-
26
- function getParser(debug = false) {
27
- const parser = new _argparse.ArgumentParser({
28
- version: require(_path.default.resolve(_utils.rootDir, 'package.json')).version,
29
- addHelp: true,
30
- description: 'A webdriver-compatible server for use with native and hybrid iOS and Android applications.',
31
- prog: process.argv[1] ? _path.default.basename(process.argv[1]) : 'appium',
32
- debug
33
- });
34
- const subParsers = parser.addSubparsers({
35
- dest: 'subcommand',
36
- debug
37
- });
38
- const serverArgs = addServerToParser(_args.sharedArgs, subParsers, debug);
39
- parser.rawArgs = serverArgs;
40
- addExtensionsToParser(_args.sharedArgs, subParsers, debug);
41
- parser._parseArgs = parser.parseArgs;
42
-
43
- parser.parseArgs = function (args, namespace) {
44
- if (_lodash.default.isUndefined(args)) {
45
- args = [...process.argv.slice(2)];
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.ArgParser = exports.getParser = exports.EXTRA_ARGS = void 0;
7
+ const support_1 = require("@appium/support");
8
+ const argparse_1 = require("argparse");
9
+ const lodash_1 = __importDefault(require("lodash"));
10
+ const path_1 = __importDefault(require("path"));
11
+ const constants_1 = require("../constants");
12
+ const schema_1 = require("../schema");
13
+ const config_1 = require("../config");
14
+ const args_1 = require("./args");
15
+ exports.EXTRA_ARGS = 'extraArgs';
16
+ /**
17
+ * If the parsed args do not contain any of these values, then we
18
+ * will automatially inject the `server` subcommand.
19
+ */
20
+ const NON_SERVER_ARGS = Object.freeze(new Set([constants_1.DRIVER_TYPE, constants_1.PLUGIN_TYPE, constants_1.SERVER_SUBCOMMAND, '-h', '--help', '-v', '--version']));
21
+ const version = support_1.fs.readPackageJsonFrom(config_1.rootDir).version;
22
+ /**
23
+ * A wrapper around `argparse`
24
+ *
25
+ * - Handles instantiation, configuration, and monkeypatching of an
26
+ * `ArgumentParser` instance for Appium server and its extensions
27
+ * - Handles error conditions, messages, and exit behavior
28
+ */
29
+ class ArgParser {
30
+ /**
31
+ * @param {boolean} [debug] - If true, throw instead of exit on error.
32
+ */
33
+ constructor(debug = false) {
34
+ const prog = process.argv[1] ? path_1.default.basename(process.argv[1]) : 'appium';
35
+ const parser = new argparse_1.ArgumentParser({
36
+ add_help: true,
37
+ description: 'A webdriver-compatible server that facilitates automation of web, mobile, and other types of apps across various platforms.',
38
+ prog,
39
+ });
40
+ ArgParser._patchExit(parser);
41
+ /**
42
+ * Program name (typically `appium`)
43
+ * @type {string}
44
+ */
45
+ this.prog = prog;
46
+ /**
47
+ * If `true`, throw an error on parse failure instead of printing help
48
+ * @type {boolean}
49
+ */
50
+ this.debug = debug;
51
+ /**
52
+ * Wrapped `ArgumentParser` instance
53
+ * @type {ArgumentParser}
54
+ */
55
+ this.parser = parser;
56
+ parser.add_argument('-v', '--version', {
57
+ action: 'version',
58
+ version,
59
+ });
60
+ const subParsers = parser.add_subparsers({ dest: 'subcommand' });
61
+ // add the 'server' subcommand, and store the raw arguments on the parser
62
+ // object as a way for other parts of the code to work with the arguments
63
+ // conceptually rather than just through argparse
64
+ const serverArgs = ArgParser._addServerToParser(subParsers);
65
+ this.rawArgs = serverArgs;
66
+ // add the 'driver' and 'plugin' subcommands
67
+ ArgParser._addExtensionCommandsToParser(subParsers);
68
+ // backwards compatibility / drop-in wrapper
69
+ /**
70
+ * @type {ArgParser['parseArgs']}
71
+ */
72
+ this.parse_args = this.parseArgs;
46
73
  }
47
-
48
- if (!_lodash.default.includes([_extensionConfig.DRIVER_TYPE, _extensionConfig.PLUGIN_TYPE, 'server', '-h'], args[0])) {
49
- args.splice(0, 0, 'server');
74
+ /**
75
+ * Parse arguments from the command line.
76
+ *
77
+ * If no subcommand is passed in, this method will inject the `server` subcommand.
78
+ *
79
+ * `ArgParser.prototype.parse_args` is an alias of this method.
80
+ * @template {import('appium/types').CliCommand} [Cmd=import('appium/types').CliCommandServer]
81
+ * @param {string[]} [args] - Array of arguments, ostensibly from `process.argv`. Gathers args from `process.argv` if not provided.
82
+ * @returns {import('appium/types').Args<Cmd>} - The parsed arguments
83
+ */
84
+ parseArgs(args = process.argv.slice(2)) {
85
+ if (!NON_SERVER_ARGS.has(args[0])) {
86
+ args.unshift(constants_1.SERVER_SUBCOMMAND);
87
+ }
88
+ try {
89
+ const parsed = this.parser.parse_known_args(args);
90
+ const [knownArgs, unknownArgs] = parsed;
91
+ if (unknownArgs?.length &&
92
+ (knownArgs.driverCommand === 'run' || knownArgs.pluginCommand === 'run')) {
93
+ return ArgParser._transformParsedArgs(knownArgs, unknownArgs);
94
+ }
95
+ else if (unknownArgs?.length) {
96
+ throw new Error(`[ERROR] Unrecognized arguments: ${unknownArgs.join(' ')}`);
97
+ }
98
+ return ArgParser._transformParsedArgs(knownArgs);
99
+ }
100
+ catch (err) {
101
+ if (this.debug) {
102
+ throw err;
103
+ }
104
+ // this isn't tested via unit tests (we use `debug: true`) so may escape coverage.
105
+ /* istanbul ignore next */
106
+ {
107
+ // eslint-disable-next-line no-console
108
+ console.error(); // need an extra space since argparse prints usage.
109
+ // eslint-disable-next-line no-console
110
+ console.error(err.message);
111
+ process.exit(1);
112
+ }
113
+ }
50
114
  }
51
-
52
- return this._parseArgs(args, namespace);
53
- }.bind(parser);
54
-
55
- return parser;
56
- }
57
-
58
- function addServerToParser(sharedArgs, subParsers, debug) {
59
- const serverParser = subParsers.addParser('server', {
60
- addHelp: true,
61
- help: 'Run an Appium server',
62
- debug
63
- });
64
-
65
- for (const [flags, opts] of [...sharedArgs, ..._args.serverArgs]) {
66
- serverParser.addArgument([...flags], { ...opts
67
- });
68
- }
69
-
70
- return _args.serverArgs;
71
- }
72
-
73
- function getDefaultServerArgs() {
74
- let defaults = {};
75
-
76
- for (let [, arg] of _args.serverArgs) {
77
- defaults[arg.dest] = arg.defaultValue;
78
- }
79
-
80
- return defaults;
81
- }
82
-
83
- function addExtensionsToParser(sharedArgs, subParsers, debug) {
84
- for (const type of [_extensionConfig.DRIVER_TYPE, _extensionConfig.PLUGIN_TYPE]) {
85
- const extParser = subParsers.addParser(type, {
86
- addHelp: true,
87
- help: `Access the ${type} management CLI commands`,
88
- debug
89
- });
90
- const extSubParsers = extParser.addSubparsers({
91
- dest: `${type}Command`,
92
- debug
93
- });
94
- const parserSpecs = [{
95
- command: 'list',
96
- args: _args.extensionArgs[type].list,
97
- help: `List available and installed ${type}s`
98
- }, {
99
- command: 'install',
100
- args: _args.extensionArgs[type].install,
101
- help: `Install a ${type}`
102
- }, {
103
- command: 'uninstall',
104
- args: _args.extensionArgs[type].uninstall,
105
- help: `Uninstall a ${type}`
106
- }, {
107
- command: 'update',
108
- args: _args.extensionArgs[type].update,
109
- help: `Update installed ${type}s to the latest version`
110
- }];
111
-
112
- for (const {
113
- command,
114
- args,
115
- help
116
- } of parserSpecs) {
117
- const parser = extSubParsers.addParser(command, {
118
- help,
119
- debug
120
- });
121
-
122
- for (const [flags, opts] of [...sharedArgs, ...args]) {
123
- parser.addArgument([...flags], { ...opts
115
+ /**
116
+ * Given an object full of arguments as returned by `argparser.parse_args`,
117
+ * expand the ones for extensions into a nested object structure and rename
118
+ * keys to match the intended destination.
119
+ *
120
+ * E.g., `{'driver-foo-bar': baz}` becomes `{driver: {foo: {bar: 'baz'}}}`
121
+ * @param {object} args
122
+ * @param {string[]} [unknownArgs]
123
+ * @returns {object}
124
+ */
125
+ static _transformParsedArgs(args, unknownArgs = []) {
126
+ const result = lodash_1.default.reduce(args, (unpacked, value, key) => {
127
+ if (!lodash_1.default.isUndefined(value) && (0, schema_1.hasArgSpec)(key)) {
128
+ const { dest } = /** @type {import('../schema/arg-spec').ArgSpec} */ ((0, schema_1.getArgSpec)(key));
129
+ lodash_1.default.set(unpacked, dest, value);
130
+ }
131
+ else {
132
+ // this could be anything that _isn't_ a server arg
133
+ unpacked[key] = value;
134
+ }
135
+ return unpacked;
136
+ }, {});
137
+ result[exports.EXTRA_ARGS] = unknownArgs;
138
+ return result;
139
+ }
140
+ /**
141
+ * Patches the `exit()` method of the parser to throw an error, so we can handle it manually.
142
+ * @param {ArgumentParser} parser
143
+ */
144
+ static _patchExit(parser) {
145
+ parser.exit = (code, msg) => {
146
+ if (code) {
147
+ throw new Error(msg);
148
+ }
149
+ process.exit();
150
+ };
151
+ }
152
+ /**
153
+ *
154
+ * @param {import('argparse').SubParser} subParser
155
+ * @returns {import('./args').ArgumentDefinitions}
156
+ */
157
+ static _addServerToParser(subParser) {
158
+ const serverParser = subParser.add_parser('server', {
159
+ add_help: true,
160
+ help: 'Run an Appium server',
124
161
  });
125
- }
162
+ ArgParser._patchExit(serverParser);
163
+ const serverArgs = (0, args_1.getServerArgs)();
164
+ for (const [flagsOrNames, opts] of serverArgs) {
165
+ // TS doesn't like the spread operator here.
166
+ // @ts-ignore
167
+ serverParser.add_argument(...flagsOrNames, { ...opts });
168
+ }
169
+ return serverArgs;
170
+ }
171
+ /**
172
+ * Adds extension sub-sub-commands to `driver`/`plugin` subcommands
173
+ * @param {import('argparse').SubParser} subParsers
174
+ */
175
+ static _addExtensionCommandsToParser(subParsers) {
176
+ for (const type of /** @type {[DriverType, PluginType]} */ ([constants_1.DRIVER_TYPE, constants_1.PLUGIN_TYPE])) {
177
+ const extParser = subParsers.add_parser(type, {
178
+ add_help: true,
179
+ help: `Access the ${type} management CLI commands`,
180
+ });
181
+ ArgParser._patchExit(extParser);
182
+ const extSubParsers = extParser.add_subparsers({
183
+ dest: `${type}Command`,
184
+ });
185
+ const extensionArgs = (0, args_1.getExtensionArgs)();
186
+ /**
187
+ * @type { {command: import('appium/types').CliExtensionSubcommand, args: import('./args').ArgumentDefinitions, help: string}[] }
188
+ */
189
+ const parserSpecs = [
190
+ {
191
+ command: 'list',
192
+ args: extensionArgs[type].list,
193
+ help: `List available and installed ${type}s`,
194
+ },
195
+ {
196
+ command: 'install',
197
+ args: extensionArgs[type].install,
198
+ help: `Install a ${type}`,
199
+ },
200
+ {
201
+ command: 'uninstall',
202
+ args: extensionArgs[type].uninstall,
203
+ help: `Uninstall a ${type}`,
204
+ },
205
+ {
206
+ command: 'update',
207
+ args: extensionArgs[type].update,
208
+ help: `Update installed ${type}s to the latest version`,
209
+ },
210
+ {
211
+ command: 'run',
212
+ args: extensionArgs[type].run,
213
+ help: `Run a script (defined inside the ${type}'s package.json under the ` +
214
+ `“scripts” field inside the “appium” field) from an installed ${type}`,
215
+ },
216
+ ];
217
+ for (const { command, args, help } of parserSpecs) {
218
+ const parser = extSubParsers.add_parser(command, { help });
219
+ ArgParser._patchExit(parser);
220
+ for (const [flagsOrNames, opts] of args) {
221
+ // add_argument mutates params so make sure to send in copies instead
222
+ // @ts-ignore
223
+ parser.add_argument(...flagsOrNames, { ...opts });
224
+ }
225
+ }
226
+ }
126
227
  }
127
- }
128
228
  }
129
-
130
- var _default = getParser;
131
- exports.default = _default;require('source-map-support').install();
132
-
133
-
134
- //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9jbGkvcGFyc2VyLmpzIl0sIm5hbWVzIjpbImdldFBhcnNlciIsImRlYnVnIiwicGFyc2VyIiwiQXJndW1lbnRQYXJzZXIiLCJ2ZXJzaW9uIiwicmVxdWlyZSIsInBhdGgiLCJyZXNvbHZlIiwicm9vdERpciIsImFkZEhlbHAiLCJkZXNjcmlwdGlvbiIsInByb2ciLCJwcm9jZXNzIiwiYXJndiIsImJhc2VuYW1lIiwic3ViUGFyc2VycyIsImFkZFN1YnBhcnNlcnMiLCJkZXN0Iiwic2VydmVyQXJncyIsImFkZFNlcnZlclRvUGFyc2VyIiwic2hhcmVkQXJncyIsInJhd0FyZ3MiLCJhZGRFeHRlbnNpb25zVG9QYXJzZXIiLCJfcGFyc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wgZ2V0RGVmYXVsdFNlcnZlckFyZ3MgfTtcbiJdLCJmaWxlIjoibGliL2NsaS9wYXJzZXIuanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4ifQ==
229
+ exports.ArgParser = ArgParser;
230
+ /**
231
+ * Creates a {@link ArgParser} instance; finalizes the config schema.
232
+ *
233
+ * @constructs ArgParser
234
+ * @param {boolean} [debug] - If `true`, throw instead of exit upon parsing error
235
+ * @returns {ArgParser}
236
+ */
237
+ function getParser(debug) {
238
+ (0, schema_1.finalizeSchema)();
239
+ return new ArgParser(debug);
240
+ }
241
+ exports.getParser = getParser;
242
+ /**
243
+ * @typedef {import('@appium/types').DriverType} DriverType
244
+ * @typedef {import('@appium/types').PluginType} PluginType
245
+ */
246
+ //# sourceMappingURL=parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../lib/cli/parser.js"],"names":[],"mappings":";;;;;;AAAA,6CAAmC;AACnC,uCAAwC;AACxC,oDAAuB;AACvB,gDAAwB;AACxB,4CAAyE;AACzE,sCAAiE;AACjE,sCAAkC;AAClC,iCAAuD;AAE1C,QAAA,UAAU,GAAG,WAAW,CAAC;AAEtC;;;GAGG;AACH,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CACnC,IAAI,GAAG,CAAC,CAAC,uBAAW,EAAE,uBAAW,EAAE,6BAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAC1F,CAAC;AAEF,MAAM,OAAO,GAAG,YAAE,CAAC,mBAAmB,CAAC,gBAAO,CAAC,CAAC,OAAO,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,SAAS;IACb;;OAEG;IACH,YAAY,KAAK,GAAG,KAAK;QACvB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,C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B,KAAK,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;oBACvC,qEAAqE;oBACrE,aAAa;oBACb,MAAM,CAAC,YAAY,CAAC,GAAG,YAAY,EAAE,EAAC,GAAG,IAAI,EAAC,CAAC,CAAC;iBACjD;aACF;SACF;IACH,CAAC;CACF;AAekB,8BAAS;AAb5B;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,KAAK;IACtB,IAAA,uBAAc,GAAE,CAAC;IAEjB,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAEO,8BAAS;AAEjB;;;GAGG"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @extends {ExtensionCliCommand<PluginType>}
3
+ */
4
+ export default class PluginCliCommand extends ExtensionCliCommand<"plugin"> {
5
+ /**
6
+ *
7
+ * @param {import('./extension-command').ExtensionCommandOptions<PluginType>} opts
8
+ */
9
+ constructor({ config, json }: import('./extension-command').ExtensionCommandOptions<PluginType>);
10
+ /**
11
+ * Install a plugin
12
+ *
13
+ * @param {PluginInstallOpts} opts
14
+ * @returns {Promise<ExtRecord<PluginType>>}
15
+ */
16
+ install({ plugin, installType, packageName }: PluginInstallOpts): Promise<ExtRecord<PluginType>>;
17
+ /**
18
+ * Uninstall a plugin
19
+ *
20
+ * @param {PluginUninstallOpts} opts
21
+ * @returns {Promise<ExtRecord<PluginType>>}
22
+ */
23
+ uninstall({ plugin }: PluginUninstallOpts): Promise<ExtRecord<PluginType>>;
24
+ /**
25
+ * Update a plugin
26
+ *
27
+ * @param {PluginUpdateOpts} opts
28
+ * @returns {Promise<import('./extension-command').ExtensionUpdateResult>}
29
+ */
30
+ update({ plugin, unsafe }: PluginUpdateOpts): Promise<import('./extension-command').ExtensionUpdateResult>;
31
+ /**
32
+ *
33
+ * @param {PluginRunOptions} opts
34
+ * @returns {Promise<import('./extension-command').RunOutput>}
35
+ */
36
+ run({ plugin, scriptName, extraArgs }: PluginRunOptions): Promise<import('./extension-command').RunOutput>;
37
+ }
38
+ export type ExtensionType = import('@appium/types').ExtensionType;
39
+ export type PluginType = import('@appium/types').PluginType;
40
+ export type ExtRecord<ExtType extends import("@appium/types").ExtensionType> = import('appium/types').ExtRecord<ExtType>;
41
+ /**
42
+ * Options for {@linkcode PluginCliCommand.install }
43
+ */
44
+ export type PluginInstallOpts = {
45
+ /**
46
+ * - the name or spec of a plugin to install
47
+ */
48
+ plugin: string;
49
+ /**
50
+ * - how to install this plugin. One of the INSTALL_TYPES
51
+ */
52
+ installType: InstallType;
53
+ /**
54
+ * - for git/github installs, the plugin node package name
55
+ */
56
+ packageName?: string | undefined;
57
+ };
58
+ export type InstallType = import('appium/types').InstallType;
59
+ /**
60
+ * Options for {@linkcode PluginCliCommand.uninstall }
61
+ */
62
+ export type PluginUninstallOpts = {
63
+ /**
64
+ * - the name or spec of a plugin to uninstall
65
+ */
66
+ plugin: string;
67
+ };
68
+ /**
69
+ * Options for {@linkcode PluginCliCommand.update }
70
+ */
71
+ export type PluginUpdateOpts = {
72
+ /**
73
+ * - the name of the plugin to update
74
+ */
75
+ plugin: string;
76
+ /**
77
+ * - if true, will perform unsafe updates past major revision boundaries
78
+ */
79
+ unsafe: boolean;
80
+ };
81
+ /**
82
+ * Options for {@linkcode PluginCliCommand.run }.
83
+ */
84
+ export type PluginRunOptions = {
85
+ /**
86
+ * - name of the plugin to run a script from
87
+ */
88
+ plugin: string;
89
+ /**
90
+ * - name of the script to run
91
+ */
92
+ scriptName: string;
93
+ /**
94
+ * - arguments to pass to the script
95
+ */
96
+ extraArgs?: string[] | undefined;
97
+ };
98
+ import ExtensionCliCommand from "./extension-command";
99
+ //# sourceMappingURL=plugin-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-command.d.ts","sourceRoot":"","sources":["../../../lib/cli/plugin-command.js"],"names":[],"mappings":"AAMA;;GAEG;AACH;IACE;;;OAGG;IACH,8BAFW,OAAO,qBAAqB,EAAE,uBAAuB,CAAC,UAAU,CAAC,EAK3E;IAED;;;;;OAKG;IACH,8CAHW,iBAAiB,GACf,QAAQ,UAAU,UAAU,CAAC,CAAC,CAQ1C;IAED;;;;;OAKG;IACH,sBAHW,mBAAmB,GACjB,QAAQ,UAAU,UAAU,CAAC,CAAC,CAI1C;IAED;;;;;OAKG;IACH,2BAHW,gBAAgB,GACd,QAAQ,OAAO,qBAAqB,EAAE,qBAAqB,CAAC,CAIxE;IAED;;;;OAIG;IACH,uCAHW,gBAAgB,GACd,QAAQ,OAAO,qBAAqB,EAAE,SAAS,CAAC,CAS5D;CAkCF;4BAGY,OAAO,eAAe,EAAE,aAAa;yBACrC,OAAO,eAAe,EAAE,UAAU;+EAKlC,OAAO,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC;;;;;;;;YAMxC,MAAM;;;;iBACN,WAAW;;;;;;0BAKZ,OAAO,cAAc,EAAE,WAAW;;;;;;;;YAMjC,MAAM;;;;;;;;;YAMN,MAAM;;;;YACN,OAAO;;;;;;;;;YAMP,MAAM;;;;gBACN,MAAM"}