appium 2.0.0-beta.7 → 2.0.0-beta.71

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 (206) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +149 -58
  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 -300
  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 -60
  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 +252 -148
  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 +262 -223
  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 +189 -184
  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 +388 -234
  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 +220 -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 +275 -407
  148. package/lib/cli/driver-command.js +132 -24
  149. package/lib/cli/extension-command.js +751 -272
  150. package/lib/cli/extension.js +47 -20
  151. package/lib/cli/parser.js +267 -95
  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 +243 -132
  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 +59 -36
  167. package/lib/main.js +369 -104
  168. package/lib/schema/arg-spec.js +229 -0
  169. package/lib/schema/cli-args.js +241 -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 -83
  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 -3594
  190. package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
  191. package/build/lib/cli/argparse-actions.js +0 -104
  192. package/build/lib/cli/npm.js +0 -200
  193. package/build/lib/cli/parser-helpers.js +0 -93
  194. package/build/lib/driver-config.js +0 -77
  195. package/build/lib/drivers.js +0 -99
  196. package/build/lib/extension-config.js +0 -253
  197. package/build/lib/plugin-config.js +0 -59
  198. package/build/lib/plugins.js +0 -14
  199. package/lib/cli/argparse-actions.js +0 -77
  200. package/lib/cli/npm.js +0 -175
  201. package/lib/cli/parser-helpers.js +0 -91
  202. package/lib/driver-config.js +0 -46
  203. package/lib/drivers.js +0 -84
  204. package/lib/extension-config.js +0 -209
  205. package/lib/plugin-config.js +0 -34
  206. package/lib/plugins.js +0 -10
@@ -1,85 +1,129 @@
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.default = void 0;
9
-
10
- require("source-map-support/register");
11
-
12
- var _lodash = _interopRequireDefault(require("lodash"));
13
-
14
- var _extensionCommand = _interopRequireDefault(require("./extension-command"));
15
-
16
- var _extensionConfig = require("../extension-config");
17
-
18
- var _plugins = require("../plugins");
19
-
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
+ const lodash_1 = __importDefault(require("lodash"));
7
+ const extension_command_1 = __importDefault(require("./extension-command"));
8
+ const constants_1 = require("../constants");
20
9
  const REQ_PLUGIN_FIELDS = ['pluginName', 'mainClass'];
21
-
22
- class PluginCommand extends _extensionCommand.default {
23
- constructor({
24
- config,
25
- json
26
- }) {
27
- super({
28
- config,
29
- json,
30
- type: _extensionConfig.PLUGIN_TYPE
31
- });
32
- this.knownExtensions = _plugins.KNOWN_PLUGINS;
33
- }
34
-
35
- async install({
36
- plugin,
37
- installType,
38
- packageName
39
- }) {
40
- return await super.install({
41
- ext: plugin,
42
- installType,
43
- packageName
44
- });
45
- }
46
-
47
- async uninstall({
48
- plugin
49
- }) {
50
- return await super.uninstall({
51
- ext: plugin
52
- });
53
- }
54
-
55
- async update({
56
- plugin,
57
- unsafe
58
- }) {
59
- return await super.update({
60
- ext: plugin,
61
- unsafe
62
- });
63
- }
64
-
65
- getPostInstallText({
66
- extName,
67
- extData
68
- }) {
69
- return `Plugin ${extName}@${extData.version} successfully installed`.green;
70
- }
71
-
72
- validateExtensionFields(appiumPkgData) {
73
- const missingFields = REQ_PLUGIN_FIELDS.reduce((acc, field) => appiumPkgData[field] ? acc : [...acc, field], []);
74
-
75
- if (!_lodash.default.isEmpty(missingFields)) {
76
- throw new Error(`Installed plugin did not expose correct fields for compability ` + `with Appium. Missing fields: ${JSON.stringify(missingFields)}`);
10
+ /**
11
+ * @extends {ExtensionCliCommand<PluginType>}
12
+ */
13
+ class PluginCliCommand extends extension_command_1.default {
14
+ /**
15
+ *
16
+ * @param {import('./extension-command').ExtensionCommandOptions<PluginType>} opts
17
+ */
18
+ constructor({ config, json }) {
19
+ super({ config, json });
20
+ this.knownExtensions = constants_1.KNOWN_PLUGINS;
21
+ }
22
+ /**
23
+ * Install a plugin
24
+ *
25
+ * @param {PluginInstallOpts} opts
26
+ * @returns {Promise<ExtRecord<PluginType>>}
27
+ */
28
+ async install({ plugin, installType, packageName }) {
29
+ return await super._install({
30
+ installSpec: plugin,
31
+ installType,
32
+ packageName,
33
+ });
34
+ }
35
+ /**
36
+ * Uninstall a plugin
37
+ *
38
+ * @param {PluginUninstallOpts} opts
39
+ * @returns {Promise<ExtRecord<PluginType>>}
40
+ */
41
+ async uninstall({ plugin }) {
42
+ return await super._uninstall({ installSpec: plugin });
43
+ }
44
+ /**
45
+ * Update a plugin
46
+ *
47
+ * @param {PluginUpdateOpts} opts
48
+ * @returns {Promise<import('./extension-command').ExtensionUpdateResult>}
49
+ */
50
+ async update({ plugin, unsafe }) {
51
+ return await super._update({ installSpec: plugin, unsafe });
52
+ }
53
+ /**
54
+ *
55
+ * @param {PluginRunOptions} opts
56
+ * @returns {Promise<import('./extension-command').RunOutput>}
57
+ */
58
+ async run({ plugin, scriptName, extraArgs }) {
59
+ return await super._run({
60
+ installSpec: plugin,
61
+ scriptName,
62
+ extraArgs,
63
+ bufferOutput: this.isJsonOutput,
64
+ });
65
+ }
66
+ /**
67
+ *
68
+ * @param {import('./extension-command').ExtensionArgs} opts
69
+ * @returns {string}
70
+ */
71
+ getPostInstallText({ extName, extData }) {
72
+ return `Plugin ${extName}@${extData.version} successfully installed`.green;
73
+ }
74
+ /**
75
+ * Validates fields in `appium` field of `pluginMetadata`
76
+ *
77
+ * For any `package.json` fields which a plugin requires, validate the type of
78
+ * those fields on the `package.json` data, throwing an error if anything is
79
+ * amiss.
80
+ * @param {import('appium/types').ExtMetadata<PluginType>} pluginMetadata
81
+ * @param {string} installSpec
82
+ * @returns {void}
83
+ */
84
+ validateExtensionFields(pluginMetadata, installSpec) {
85
+ const missingFields = REQ_PLUGIN_FIELDS.reduce((acc, field) => (pluginMetadata[field] ? acc : [...acc, field]), []);
86
+ if (!lodash_1.default.isEmpty(missingFields)) {
87
+ throw new Error(`Installed plugin "${installSpec}" did not expose correct fields for compability ` +
88
+ `with Appium. Missing fields: ${JSON.stringify(missingFields)}`);
89
+ }
77
90
  }
78
- }
79
-
80
91
  }
81
-
82
- exports.default = PluginCommand;require('source-map-support').install();
83
-
84
-
85
- //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9jbGkvcGx1Z2luLWNvbW1hbmQuanMiXSwibmFtZXMiOlsiUkVRX1BMVUdJTl9GSUVMRFMiLCJQbHVnaW5Db21tYW5kIiwiRXh0ZW5zaW9uQ29tbWFuZCIsImNvbnN0cnVjdG9yIiwiY29uZmlnIiwianNvbiIsInR5cGUiLCJQTFVHSU5fVFlQRSIsImtub3duRXh0ZW5zaW9ucyIsIktOT1dOX1BMVUdJTlMiLCJpbnN0YWxsIiwicGx1Z2luIiwiaW5zdGFsbFR5cGUiLCJwYWNrYWdlTmFtZSIsImV4dCIsInVuaW5zdGFsbCIsInVwZGF0ZSIsInVuc2FmZSIsImdldFBvc3RJbnN0YWxsVGV4dCIsImV4dE5hbWUiLCJleHREYXRhIiwidmVyc2lvbiIsImdyZWVuIiwidmFsaWRhdGVFeHRlbnNpb25GaWVsZHMiLCJhcHBpdW1Qa2dEYXRhIiwibWlzc2luZ0ZpZWxkcyIsInJlZHVjZSIsImFjYyIsImZpZWxkIiwiXyIsImlzRW1wdHkiLCJFcnJvciIsIkpTT04iLCJzdHJpbmdpZnkiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0FBQUE7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBRUEsTUFBTUEsaUJBQWlCLEdBQUcsQ0FBQyxZQUFELEVBQWUsV0FBZixDQUExQjs7QUFFZS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CBmaWVsZHMgZm9yIGNvbXBhYmlsaXR5IGAgK1xuICAgICAgICAgICAgICAgICAgICAgIGB3aXRoIEFwcGl1bS4gTWlzc2luZyBmaWVsZHM6ICR7SlNPTi5zdHJpbmdpZnkobWlzc2luZ0ZpZWxkcyl9YCk7XG4gICAgfVxuXG4gIH1cblxufVxuIl0sImZpbGUiOiJsaWIvY2xpL3BsdWdpbi1jb21tYW5kLmpzIiwic291cmNlUm9vdCI6Ii4uLy4uLy4uIn0=
92
+ exports.default = PluginCliCommand;
93
+ /**
94
+ * @typedef {import('@appium/types').ExtensionType} ExtensionType
95
+ * @typedef {import('@appium/types').PluginType} PluginType
96
+ */
97
+ /**
98
+ * @template {ExtensionType} ExtType
99
+ * @typedef {import('appium/types').ExtRecord<ExtType>} ExtRecord
100
+ */
101
+ /**
102
+ * Options for {@linkcode PluginCliCommand.install}
103
+ * @typedef PluginInstallOpts
104
+ * @property {string} plugin - the name or spec of a plugin to install
105
+ * @property {InstallType} installType - how to install this plugin. One of the INSTALL_TYPES
106
+ * @property {string} [packageName] - for git/github installs, the plugin node package name
107
+ */
108
+ /**
109
+ * @typedef {import('appium/types').InstallType} InstallType
110
+ */
111
+ /**
112
+ * Options for {@linkcode PluginCliCommand.uninstall}
113
+ * @typedef PluginUninstallOpts
114
+ * @property {string} plugin - the name or spec of a plugin to uninstall
115
+ */
116
+ /**
117
+ * Options for {@linkcode PluginCliCommand.update}
118
+ * @typedef PluginUpdateOpts
119
+ * @property {string} plugin - the name of the plugin to update
120
+ * @property {boolean} unsafe - if true, will perform unsafe updates past major revision boundaries
121
+ */
122
+ /**
123
+ * Options for {@linkcode PluginCliCommand.run}.
124
+ * @typedef PluginRunOptions
125
+ * @property {string} plugin - name of the plugin to run a script from
126
+ * @property {string} scriptName - name of the script to run
127
+ * @property {string[]} [extraArgs] - arguments to pass to the script
128
+ */
129
+ //# sourceMappingURL=plugin-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-command.js","sourceRo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;QACnC,OAAO,UAAU,OAAO,IAAI,OAAO,CAAC,OAAO,yBAAyB,CAAC,KAAK,CAAC;IAC7E,CAAC;IAED;;;;;;;;;OASG;IACH,uBAAuB,CAAC,cAAc,EAAE,WAAW;QACjD,MAAM,aAAa,GAAG,iBAAiB,CAAC,MAAM,CAC5C,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC,EAC/D,EAAE,CACH,CAAC;QAEF,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YAC7B,MAAM,IAAI,KAAK,CACb,qBAAqB,WAAW,kDAAkD;gBAChF,gCAAgC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAClE,CAAC;SACH;IACH,CAAC;CACF;AA1FD,mCA0FC;AAED;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;GAMG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG"}
@@ -0,0 +1,29 @@
1
+ /***
2
+ * Log an error to the console and exit the process.
3
+ * @param {boolean} json - whether we should log json or text
4
+ * @param {any} msg - error message, object, Error instance, etc.
5
+ */
6
+ export function errAndQuit(json: boolean, msg: any): void;
7
+ /**
8
+ * Conditionally log something to the console
9
+ * @param {boolean} json - whether we are in json mode (and should therefore not log)
10
+ * @param {string} msg - string to log
11
+ */
12
+ export function log(json: boolean, msg: string): void;
13
+ /**
14
+ * Start a spinner, execute an async function, and then stop the spinner
15
+ * @param {boolean} json - whether we are in json mode (and should therefore not log)
16
+ * @param {string} msg - string to log
17
+ * @param {function} fn - function to wrap with spinning
18
+ */
19
+ export function spinWith(json: boolean, msg: string, fn: Function): Promise<any>;
20
+ export const JSON_SPACES: 4;
21
+ export class RingBuffer {
22
+ constructor(size?: number);
23
+ size: number;
24
+ buffer: any[];
25
+ getBuff(): any[];
26
+ dequeue(): void;
27
+ enqueue(item: any): void;
28
+ }
29
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/cli/utils.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,iCAHW,OAAO,OACP,GAAG,QAYb;AAED;;;;GAIG;AACH,0BAHW,OAAO,OACP,MAAM,QAIhB;AAED;;;;;GAKG;AACH,+BAJW,OAAO,OACP,MAAM,8BAiBhB;AAhDD,4BAAsB;AAkDtB;IACE,2BAGC;IAFC,aAAgB;IAChB,cAAgB;IAElB,iBAEC;IACD,gBAEC;IACD,yBAKC;CACF"}
@@ -1,59 +1,80 @@
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.errAndQuit = errAndQuit;
9
- exports.log = log;
10
- exports.spinWith = spinWith;
11
- exports.JSON_SPACES = void 0;
12
-
13
- require("source-map-support/register");
14
-
15
- var _ora = _interopRequireDefault(require("ora"));
16
-
2
+ /* eslint-disable no-console */
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.RingBuffer = exports.JSON_SPACES = exports.spinWith = exports.log = exports.errAndQuit = void 0;
8
+ const ora_1 = __importDefault(require("ora"));
17
9
  const JSON_SPACES = 4;
18
10
  exports.JSON_SPACES = JSON_SPACES;
19
-
11
+ /***
12
+ * Log an error to the console and exit the process.
13
+ * @param {boolean} json - whether we should log json or text
14
+ * @param {any} msg - error message, object, Error instance, etc.
15
+ */
20
16
  function errAndQuit(json, msg) {
21
- if (json) {
22
- console.log(JSON.stringify({
23
- error: `${msg}`
24
- }, null, JSON_SPACES));
25
- } else {
26
- console.error(`${msg}`.red);
27
-
28
- if (msg.stderr) {
29
- console.error(`${msg.stderr}`.red);
30
- }
31
- }
32
-
33
- process.exit(1);
17
+ if (json) {
18
+ console.log(JSON.stringify({ error: `${msg}` }, null, JSON_SPACES));
19
+ }
20
+ else {
21
+ console.error(`${msg}`.red);
22
+ if (msg.stderr) {
23
+ console.error(`${msg.stderr}`.red);
24
+ }
25
+ }
26
+ process.exit(1);
34
27
  }
35
-
28
+ exports.errAndQuit = errAndQuit;
29
+ /**
30
+ * Conditionally log something to the console
31
+ * @param {boolean} json - whether we are in json mode (and should therefore not log)
32
+ * @param {string} msg - string to log
33
+ */
36
34
  function log(json, msg) {
37
- !json && console.log(msg);
35
+ !json && console.log(msg);
38
36
  }
39
-
37
+ exports.log = log;
38
+ /**
39
+ * Start a spinner, execute an async function, and then stop the spinner
40
+ * @param {boolean} json - whether we are in json mode (and should therefore not log)
41
+ * @param {string} msg - string to log
42
+ * @param {function} fn - function to wrap with spinning
43
+ */
40
44
  async function spinWith(json, msg, fn) {
41
- if (json) {
42
- return await fn();
43
- }
44
-
45
- const spinner = (0, _ora.default)(msg).start();
46
- let res;
47
-
48
- try {
49
- res = await fn();
50
- spinner.succeed();
51
- return res;
52
- } catch (err) {
53
- spinner.fail();
54
- throw err;
55
- }
56
- }require('source-map-support').install();
57
-
58
-
59
- //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9jbGkvdXRpbHMuanMiXSwibmFtZXMiOlsiSlNPTl9TUEFDRVMiLCJlcnJBbmRRdWl0IiwianNvbiIsIm1zZyIsImNvbnNvbGUiLCJsb2ciLCJKU09OIiwic3RyaW5naWZ5IiwiZXJyb3IiLCJyZWQiLCJzdGRlcnIiLCJwcm9jZXNzIiwiZXhpdCIsInNwaW5XaXRoIiwiZm4iLCJzcGlubmVyIiwic3RhcnQiLCJyZXMiLCJzdWNjZWVkIiwiZXJyIiwiZmFpbCJdLCJtYXBwaW5ncyI6Ijs7Ozs7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oiLi4vLi4vLi4ifQ==
45
+ if (json) {
46
+ return await fn();
47
+ }
48
+ const spinner = (0, ora_1.default)(msg).start();
49
+ let res;
50
+ try {
51
+ res = await fn();
52
+ spinner.succeed();
53
+ return res;
54
+ }
55
+ catch (err) {
56
+ spinner.fail();
57
+ throw err;
58
+ }
59
+ }
60
+ exports.spinWith = spinWith;
61
+ class RingBuffer {
62
+ constructor(size = 50) {
63
+ this.size = size;
64
+ this.buffer = [];
65
+ }
66
+ getBuff() {
67
+ return this.buffer;
68
+ }
69
+ dequeue() {
70
+ this.buffer.shift();
71
+ }
72
+ enqueue(item) {
73
+ if (this.buffer.length >= this.size) {
74
+ this.dequeue();
75
+ }
76
+ this.buffer.push(item);
77
+ }
78
+ }
79
+ exports.RingBuffer = RingBuffer;
80
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/cli/utils.js"],"names":[],"mappings":";AAAA,+BAA+B;;;;;;AAE/B,8CAAsB;AAEtB,MAAM,WAAW,GAAG,CAAC,CAAC;AAqEa,kCAAW;AAnE9C;;;;GAIG;AACH,SAAS,UAAU,CAAC,IAAI,EAAE,GAAG;IAC3B,IAAI,IAAI,EAAE;QACR,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC,KAAK,EAAE,GAAG,GAAG,EAAE,EAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;KACnE;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,GAAG,CAAC,MAAM,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;SACpC;KACF;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAoDO,gCAAU;AAlDlB;;;;GAIG;AACH,SAAS,GAAG,CAAC,IAAI,EAAE,GAAG;IACpB,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AA2CmB,kBAAG;AAzCvB;;;;;GAKG;AACH,KAAK,UAAU,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACnC,IAAI,IAAI,EAAE;QACR,OAAO,MAAM,EAAE,EAAE,CAAC;KACnB;IACD,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IACjC,IAAI,GAAG,CAAC;IACR,IAAI;QACF,GAAG,GAAG,MAAM,EAAE,EAAE,CAAC;QACjB,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,GAAG,CAAC;KACZ;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,GAAG,CAAC;KACX;AACH,CAAC;AAqBwB,4BAAQ;AAnBjC,MAAM,UAAU;IACd,YAAY,IAAI,GAAG,EAAE;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACnB,CAAC;IACD,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,CAAC,IAAI;QACV,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE;YACnC,IAAI,CAAC,OAAO,EAAE,CAAC;SAChB;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF;AAE+C,gCAAU"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Given an array of errors and the result of loading a config file, generate a
3
+ * helpful string for the user.
4
+ *
5
+ * - If `opts` contains a `json` property, this should be the original JSON
6
+ * _string_ of the config file. This is only applicable if the config file
7
+ * was in JSON format. If present, it will associate line numbers with errors.
8
+ * - If `errors` happens to be empty, this will throw.
9
+ * @param {import('ajv').ErrorObject[]} errors - Non-empty array of errors. Required.
10
+ * @param {ReadConfigFileResult['config']|any} [config] -
11
+ * Configuration & metadata
12
+ * @param {FormatConfigErrorsOptions} [opts]
13
+ * @throws {TypeError} If `errors` is empty
14
+ * @returns {string}
15
+ */
16
+ export function formatErrors(errors?: import('ajv').ErrorObject[], config?: ReadConfigFileResult['config'] | any, opts?: FormatConfigErrorsOptions | undefined): string;
17
+ /**
18
+ * Given an optional path, read a config file. Validates the config file.
19
+ *
20
+ * Call {@link validate} if you already have a config object.
21
+ * @param {string} [filepath] - Path to config file, if we have one
22
+ * @param {ReadConfigFileOptions} [opts] - Options
23
+ * @public
24
+ * @returns {Promise<ReadConfigFileResult>} Contains config and filepath, if found, and any errors
25
+ */
26
+ export function readConfigFile(filepath?: string | undefined, opts?: ReadConfigFileOptions | undefined): Promise<ReadConfigFileResult>;
27
+ /**
28
+ * Convert schema property names to either a) the value of the `appiumCliDest` property, if any; or b) camel-case
29
+ * @param {AppiumConfig} config - Configuration object
30
+ * @returns {NormalizedAppiumConfig} New object with camel-cased keys (or `dest` keys).
31
+ */
32
+ export function normalizeConfig(config: AppiumConfig): NormalizedAppiumConfig;
33
+ /**
34
+ * Result of calling {@link readConfigFile }.
35
+ */
36
+ export type ReadConfigFileResult = {
37
+ /**
38
+ * - Validation errors
39
+ */
40
+ errors?: import("ajv").ErrorObject<string, Record<string, any>, any>[] | undefined;
41
+ /**
42
+ * - The path to the config file, if found
43
+ */
44
+ filepath?: string | undefined;
45
+ /**
46
+ * - If `true`, the config file exists but is empty
47
+ */
48
+ isEmpty?: boolean | undefined;
49
+ /**
50
+ * - The parsed configuration
51
+ */
52
+ config?: import("@appium/types").NormalizedAppiumConfig | undefined;
53
+ /**
54
+ * - Human-readable error messages and suggestions. If the `pretty` option is `true`, this will be a nice string to print.
55
+ */
56
+ reason?: string | import("@sidvind/better-ajv-errors").IOutputError[] | undefined;
57
+ };
58
+ /**
59
+ * Options for {@link readConfigFile }.
60
+ */
61
+ export type ReadConfigFileOptions = {
62
+ /**
63
+ * If `false`, do not use color and fancy formatting in the `reason` property of the {@link ReadConfigFileResult }. The value of `reason` is then suitable for machine-reading.
64
+ */
65
+ pretty?: boolean | undefined;
66
+ };
67
+ /**
68
+ * This is an `AsyncSearcher` which is inexplicably _not_ exported by the `lilconfig` type definition.
69
+ */
70
+ export type LilconfigAsyncSearcher = ReturnType<typeof import("lilconfig")["lilconfig"]>;
71
+ /**
72
+ * The contents of an Appium config file. Generated from schema
73
+ */
74
+ export type AppiumConfig = import('@appium/types').AppiumConfig;
75
+ /**
76
+ * The contents of an Appium config file with camelcased property names (and using `appiumCliDest` value if present). Generated from {@link AppiumConfig }
77
+ */
78
+ export type NormalizedAppiumConfig = import('@appium/types').NormalizedAppiumConfig;
79
+ /**
80
+ * The string should be a raw JSON string.
81
+ */
82
+ export type RawJson = string;
83
+ /**
84
+ * Options for {@link formatErrors }.
85
+ */
86
+ export type FormatConfigErrorsOptions = {
87
+ /**
88
+ * - Raw JSON config (as string)
89
+ */
90
+ json?: string | undefined;
91
+ /**
92
+ * - Whether to format errors as a CLI-friendly string
93
+ */
94
+ pretty?: boolean | undefined;
95
+ /**
96
+ * - Specific ID of a prop; otherwise entire schema
97
+ */
98
+ schemaId?: string | undefined;
99
+ };
100
+ //# sourceMappingURL=config-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../lib/config-file.js"],"names":[],"mappings":"AAkEA;;;;;;;;;;;;;;GAcG;AACH,sCAPW,OAAO,KAAK,EAAE,WAAW,EAAE,WAC3B,oBAAoB,CAAC,QAAQ,CAAC,GAAC,GAAG,iDAIhC,MAAM,CAUlB;AAED;;;;;;;;GAQG;AACH,yGAFa,QAAQ,oBAAoB,CAAC,CAwCzC;AAED;;;;GAIG;AACH,wCAHW,YAAY,GACV,sBAAsB,CAgClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAoBY,WAAW,2BAAoB,WAAW,CAAC,CAAC;;;;2BAK5C,OAAO,eAAe,EAAE,YAAY;;;;qCAKpC,OAAO,eAAe,EAAE,sBAAsB;;;;sBAK9C,MAAM"}