appium 2.0.0-beta.2 → 2.0.0-beta.23

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 (122) hide show
  1. package/README.md +9 -9
  2. package/build/check-npm-pack-files.js +23 -0
  3. package/build/commands-yml/parse.js +319 -0
  4. package/build/commands-yml/validator.js +130 -0
  5. package/build/index.js +19 -0
  6. package/build/lib/appium-config.schema.json +0 -0
  7. package/build/lib/appium.js +160 -53
  8. package/build/lib/cli/args.js +115 -279
  9. package/build/lib/cli/driver-command.js +11 -1
  10. package/build/lib/cli/extension-command.js +60 -8
  11. package/build/lib/cli/extension.js +30 -7
  12. package/build/lib/cli/npm.js +43 -29
  13. package/build/lib/cli/parser.js +156 -89
  14. package/build/lib/cli/plugin-command.js +11 -1
  15. package/build/lib/cli/utils.js +29 -3
  16. package/build/lib/config-file.js +141 -0
  17. package/build/lib/config.js +53 -65
  18. package/build/lib/driver-config.js +42 -19
  19. package/build/lib/drivers.js +8 -4
  20. package/build/lib/ext-config-io.js +165 -0
  21. package/build/lib/extension-config.js +130 -61
  22. package/build/lib/grid-register.js +22 -24
  23. package/build/lib/logger.js +3 -3
  24. package/build/lib/logsink.js +11 -13
  25. package/build/lib/main.js +197 -77
  26. package/build/lib/plugin-config.js +21 -11
  27. package/build/lib/plugins.js +4 -2
  28. package/build/lib/schema/appium-config-schema.js +253 -0
  29. package/build/lib/schema/arg-spec.js +120 -0
  30. package/build/lib/schema/cli-args.js +188 -0
  31. package/build/lib/schema/cli-transformers.js +76 -0
  32. package/build/lib/schema/index.js +36 -0
  33. package/build/lib/schema/keywords.js +72 -0
  34. package/build/lib/schema/schema.js +357 -0
  35. package/build/lib/utils.js +44 -99
  36. package/build/postinstall.js +90 -0
  37. package/build/test/cli/cli-e2e-specs.js +221 -0
  38. package/build/test/cli/cli-helpers.js +86 -0
  39. package/build/test/cli/cli-specs.js +71 -0
  40. package/build/test/cli/fixtures/test-driver/package.json +27 -0
  41. package/build/test/cli/schema-args-specs.js +48 -0
  42. package/build/test/cli/schema-e2e-specs.js +47 -0
  43. package/build/test/config-e2e-specs.js +112 -0
  44. package/build/test/config-file-e2e-specs.js +209 -0
  45. package/build/test/config-file-specs.js +281 -0
  46. package/build/test/config-specs.js +159 -0
  47. package/build/test/driver-e2e-specs.js +435 -0
  48. package/build/test/driver-specs.js +321 -0
  49. package/build/test/ext-config-io-specs.js +181 -0
  50. package/build/test/extension-config-specs.js +365 -0
  51. package/build/test/fixtures/allow-feat.txt +5 -0
  52. package/build/test/fixtures/caps.json +3 -0
  53. package/build/test/fixtures/config/allow-insecure.txt +3 -0
  54. package/build/test/fixtures/config/appium.config.bad-nodeconfig.json +5 -0
  55. package/build/test/fixtures/config/appium.config.bad.json +32 -0
  56. package/build/test/fixtures/config/appium.config.ext-good.json +9 -0
  57. package/build/test/fixtures/config/appium.config.ext-unknown-props.json +10 -0
  58. package/build/test/fixtures/config/appium.config.good.js +40 -0
  59. package/build/test/fixtures/config/appium.config.good.json +33 -0
  60. package/build/test/fixtures/config/appium.config.good.yaml +30 -0
  61. package/build/test/fixtures/config/appium.config.invalid.json +31 -0
  62. package/build/test/fixtures/config/appium.config.security-array.json +5 -0
  63. package/build/test/fixtures/config/appium.config.security-delimited.json +5 -0
  64. package/build/test/fixtures/config/appium.config.security-path.json +5 -0
  65. package/build/test/fixtures/config/driver-fake.config.json +8 -0
  66. package/build/test/fixtures/config/nodeconfig.json +3 -0
  67. package/build/test/fixtures/config/plugin-fake.config.json +0 -0
  68. package/build/test/fixtures/default-args.js +35 -0
  69. package/build/test/fixtures/deny-feat.txt +5 -0
  70. package/build/test/fixtures/driver.schema.js +20 -0
  71. package/build/test/fixtures/extensions.yaml +27 -0
  72. package/build/test/fixtures/flattened-schema.js +504 -0
  73. package/build/test/fixtures/plugin.schema.js +20 -0
  74. package/build/test/fixtures/schema-with-extensions.js +28 -0
  75. package/build/test/grid-register-specs.js +74 -0
  76. package/build/test/helpers.js +75 -0
  77. package/build/test/logger-specs.js +76 -0
  78. package/build/test/npm-specs.js +20 -0
  79. package/build/test/parser-specs.js +314 -0
  80. package/build/test/plugin-e2e-specs.js +316 -0
  81. package/build/test/schema/arg-spec-specs.js +70 -0
  82. package/build/test/schema/cli-args-specs.js +431 -0
  83. package/build/test/schema/schema-specs.js +389 -0
  84. package/build/test/utils-specs.js +266 -0
  85. package/index.js +11 -0
  86. package/lib/appium-config.schema.json +278 -0
  87. package/lib/appium.js +207 -65
  88. package/lib/cli/args.js +174 -375
  89. package/lib/cli/driver-command.js +4 -0
  90. package/lib/cli/extension-command.js +70 -5
  91. package/lib/cli/extension.js +25 -5
  92. package/lib/cli/npm.js +86 -18
  93. package/lib/cli/parser.js +257 -79
  94. package/lib/cli/plugin-command.js +4 -0
  95. package/lib/cli/utils.js +21 -1
  96. package/lib/config-file.js +227 -0
  97. package/lib/config.js +84 -63
  98. package/lib/driver-config.js +66 -11
  99. package/lib/drivers.js +4 -1
  100. package/lib/ext-config-io.js +287 -0
  101. package/lib/extension-config.js +225 -67
  102. package/lib/grid-register.js +27 -24
  103. package/lib/logger.js +1 -1
  104. package/lib/logsink.js +10 -7
  105. package/lib/main.js +214 -77
  106. package/lib/plugin-config.js +35 -6
  107. package/lib/plugins.js +1 -0
  108. package/lib/schema/appium-config-schema.js +287 -0
  109. package/lib/schema/arg-spec.js +222 -0
  110. package/lib/schema/cli-args.js +285 -0
  111. package/lib/schema/cli-transformers.js +123 -0
  112. package/lib/schema/index.js +2 -0
  113. package/lib/schema/keywords.js +135 -0
  114. package/lib/schema/schema.js +577 -0
  115. package/lib/utils.js +42 -88
  116. package/package.json +55 -84
  117. package/postinstall.js +71 -0
  118. package/types/appium-config.d.ts +197 -0
  119. package/types/types.d.ts +201 -0
  120. package/CHANGELOG.md +0 -3515
  121. package/build/lib/cli/parser-helpers.js +0 -82
  122. package/lib/cli/parser-helpers.js +0 -79
package/lib/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import logger from './logger';
3
- import { processCapabilities, PROTOCOLS } from 'appium-base-driver';
4
- import findRoot from 'find-root';
3
+ import { processCapabilities, PROTOCOLS } from '@appium/base-driver';
4
+ import { fs } from '@appium/support';
5
5
 
6
6
  const W3C_APPIUM_PREFIX = 'appium';
7
7
 
@@ -47,19 +47,19 @@ function parseCapsForInnerDriver (jsonwpCapabilities, w3cCapabilities, constrain
47
47
  const hasW3CCaps = _.isPlainObject(w3cCapabilities) &&
48
48
  (_.has(w3cCapabilities, 'alwaysMatch') || _.has(w3cCapabilities, 'firstMatch'));
49
49
  const hasJSONWPCaps = _.isPlainObject(jsonwpCapabilities);
50
- let protocol = null;
51
50
  let desiredCaps = {};
52
51
  let processedW3CCapabilities = null;
53
52
  let processedJsonwpCapabilities = null;
54
53
 
55
- if (!hasJSONWPCaps && !hasW3CCaps) {
54
+ if (!hasW3CCaps) {
56
55
  return {
57
56
  protocol: PROTOCOLS.W3C,
58
- error: new Error('Either JSONWP or W3C capabilities should be provided'),
57
+ error: new Error('W3C capabilities should be provided'),
59
58
  };
60
59
  }
61
60
 
62
- const {W3C, MJSONWP} = PROTOCOLS;
61
+ const {W3C} = PROTOCOLS;
62
+ const protocol = W3C;
63
63
 
64
64
  // Make sure we don't mutate the original arguments
65
65
  jsonwpCapabilities = _.cloneDeep(jsonwpCapabilities);
@@ -101,56 +101,24 @@ function parseCapsForInnerDriver (jsonwpCapabilities, w3cCapabilities, constrain
101
101
 
102
102
  // Get MJSONWP caps
103
103
  if (hasJSONWPCaps) {
104
- protocol = MJSONWP;
105
- desiredCaps = jsonwpCapabilities;
106
104
  processedJsonwpCapabilities = {...jsonwpCapabilities};
107
105
  }
108
106
 
109
107
  // Get W3C caps
110
108
  if (hasW3CCaps) {
111
- protocol = W3C;
112
109
  // Call the process capabilities algorithm to find matching caps on the W3C
113
110
  // (see: https://github.com/jlipps/simple-wd-spec#processing-capabilities)
114
- let isFixingNeededForW3cCaps = false;
115
111
  try {
116
112
  desiredCaps = processCapabilities(w3cCapabilities, constraints, true);
117
113
  } catch (error) {
118
- if (!hasJSONWPCaps) {
119
- return {
120
- desiredCaps,
121
- processedJsonwpCapabilities,
122
- processedW3CCapabilities,
123
- protocol,
124
- error,
125
- };
126
- }
127
114
  logger.info(`Could not parse W3C capabilities: ${error.message}`);
128
- isFixingNeededForW3cCaps = true;
129
- }
130
-
131
- if (hasJSONWPCaps && !isFixingNeededForW3cCaps) {
132
- const differingKeys = _.difference(_.keys(removeAppiumPrefixes(processedJsonwpCapabilities)), _.keys(removeAppiumPrefixes(desiredCaps)));
133
- if (!_.isEmpty(differingKeys)) {
134
- logger.info(`The following capabilities were provided in the JSONWP desired capabilities that are missing ` +
135
- `in W3C capabilities: ${JSON.stringify(differingKeys)}`);
136
- isFixingNeededForW3cCaps = true;
137
- }
138
- }
139
-
140
- if (isFixingNeededForW3cCaps && hasJSONWPCaps) {
141
- logger.info('Trying to fix W3C capabilities by merging them with JSONWP caps');
142
- w3cCapabilities = fixW3cCapabilities(w3cCapabilities, jsonwpCapabilities);
143
- try {
144
- desiredCaps = processCapabilities(w3cCapabilities, constraints, true);
145
- } catch (error) {
146
- logger.warn(`Could not parse fixed W3C capabilities: ${error.message}. Falling back to JSONWP protocol`);
147
- return {
148
- desiredCaps: processedJsonwpCapabilities,
149
- processedJsonwpCapabilities,
150
- processedW3CCapabilities: null,
151
- protocol: MJSONWP,
152
- };
153
- }
115
+ return {
116
+ desiredCaps,
117
+ processedJsonwpCapabilities,
118
+ processedW3CCapabilities,
119
+ protocol,
120
+ error,
121
+ };
154
122
  }
155
123
 
156
124
  // Create a new w3c capabilities payload that contains only the matching caps in `alwaysMatch`
@@ -163,47 +131,6 @@ function parseCapsForInnerDriver (jsonwpCapabilities, w3cCapabilities, constrain
163
131
  return {desiredCaps, processedJsonwpCapabilities, processedW3CCapabilities, protocol};
164
132
  }
165
133
 
166
- /**
167
- * This helper method tries to fix corrupted W3C capabilities by
168
- * merging them to existing JSONWP capabilities.
169
- *
170
- * @param {Object} w3cCaps W3C capabilities
171
- * @param {Object} jsonwpCaps JSONWP capabilities
172
- * @return {Object} Fixed W3C capabilities
173
- */
174
- function fixW3cCapabilities (w3cCaps, jsonwpCaps) {
175
- const result = {
176
- firstMatch: w3cCaps.firstMatch || [],
177
- alwaysMatch: w3cCaps.alwaysMatch || {},
178
- };
179
- const keysToInsert = _.keys(jsonwpCaps);
180
- const removeMatchingKeys = (match) => {
181
- _.pull(keysToInsert, match);
182
- const colonIndex = match.indexOf(':');
183
- if (colonIndex >= 0 && match.length > colonIndex) {
184
- _.pull(keysToInsert, match.substring(colonIndex + 1));
185
- }
186
- if (keysToInsert.includes(`${W3C_APPIUM_PREFIX}:${match}`)) {
187
- _.pull(keysToInsert, `${W3C_APPIUM_PREFIX}:${match}`);
188
- }
189
- };
190
-
191
- for (const firstMatchEntry of result.firstMatch) {
192
- for (const pair of _.toPairs(firstMatchEntry)) {
193
- removeMatchingKeys(pair[0]);
194
- }
195
- }
196
-
197
- for (const pair of _.toPairs(result.alwaysMatch)) {
198
- removeMatchingKeys(pair[0]);
199
- }
200
-
201
- for (const key of keysToInsert) {
202
- result.alwaysMatch[key] = jsonwpCaps[key];
203
- }
204
- return result;
205
- }
206
-
207
134
  /**
208
135
  * Takes a capabilities objects and prefixes capabilities with `appium:`
209
136
  * @param {Object} caps Desired capabilities object
@@ -289,9 +216,36 @@ function pullSettings (caps) {
289
216
  return result;
290
217
  }
291
218
 
292
- const rootDir = findRoot(__dirname);
219
+ const rootDir = fs.findRoot(__dirname);
220
+
221
+
222
+ /**
223
+ * A Map where you can set properties, but only once. And you can't remove anything. So there.
224
+ * @template K,V
225
+ * @extends {Map<K,V>}
226
+ */
227
+ class ReadonlyMap extends Map {
228
+ /**
229
+ * @param {K} key
230
+ * @param {V} value
231
+ */
232
+ set (key, value) {
233
+ if (this.has(key)) {
234
+ throw new Error(`${key} is already set`);
235
+ }
236
+ return super.set(key, value);
237
+ }
238
+
239
+ delete (key) {
240
+ throw new Error(`${key} cannot be deleted`);
241
+ }
242
+
243
+ clear () {
244
+ throw new Error(`Cannot clear ReadonlyMap`);
245
+ }
246
+ }
293
247
 
294
248
  export {
295
249
  inspectObject, parseCapsForInnerDriver, insertAppiumPrefixes, rootDir,
296
- getPackageVersion, pullSettings, removeAppiumPrefixes,
250
+ getPackageVersion, pullSettings, removeAppiumPrefixes, ReadonlyMap
297
251
  };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "appium",
3
+ "version": "2.0.0-beta.23",
3
4
  "description": "Automation for Apps.",
4
- "tags": [
5
+ "keywords": [
5
6
  "automation",
6
7
  "javascript",
7
8
  "selenium",
@@ -11,102 +12,72 @@
11
12
  "firefoxos",
12
13
  "testing"
13
14
  ],
14
- "version": "2.0.0-beta.2",
15
- "author": "https://github.com/appium",
16
- "license": "Apache-2.0",
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/appium/appium.git"
20
- },
21
15
  "bugs": {
22
16
  "url": "https://github.com/appium/appium/issues"
23
17
  },
24
- "engines": {
25
- "node": ">=8",
26
- "npm": ">=6"
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/appium/appium.git"
27
21
  },
28
- "main": "./build/lib/main.js",
22
+ "license": "Apache-2.0",
23
+ "author": "https://github.com/appium",
29
24
  "bin": {
30
- "appium": "./build/lib/main.js"
25
+ "appium": "index.js"
31
26
  },
32
27
  "directories": {
33
- "lib": "./lib",
34
- "doc": "./docs"
28
+ "lib": "./lib"
35
29
  },
36
30
  "files": [
37
31
  "bin",
38
32
  "lib",
39
- "build/lib",
40
- "npm-shrinkwrap.json"
33
+ "build",
34
+ "index.js",
35
+ "postinstall.js",
36
+ "types"
41
37
  ],
42
- "dependencies": {
43
- "@appium/base-plugin": "^1.0.0",
44
- "@babel/runtime": "^7.6.0",
45
- "appium-base-driver": "^7.0.0",
46
- "appium-support": "2.x",
47
- "argparse": "^1.0.10",
48
- "async-lock": "^1.0.0",
49
- "asyncbox": "2.x",
50
- "axios": "^0.20.0",
51
- "bluebird": "3.x",
52
- "continuation-local-storage": "3.x",
53
- "dateformat": "^3.0.3",
54
- "find-root": "^1.1.0",
55
- "lodash": "^4.17.11",
56
- "longjohn": "^0.2.12",
57
- "npmlog": "4.x",
58
- "ora": "^4.0.4",
59
- "semver": "^7.0.0",
60
- "source-map-support": "0.x",
61
- "teen_process": "1.x",
62
- "winston": "3.x",
63
- "word-wrap": "^1.2.3",
64
- "yaml": "^1.7.2"
65
- },
66
38
  "scripts": {
67
- "clean": "rm -rf node_modules && rm -f package-lock.json && npm install",
68
- "prepare": "gulp prepublish",
69
- "prepublishOnly": "npm run prune-shrinkwrap && gulp fixShrinkwrap",
70
- "postpublish": "npm run restore-shrinkwrap",
71
- "prune-shrinkwrap": "!(test -e npm-shrinkwrap.json) || (npm ci --production --ignore-scripts && npm run backup-shrinkwrap && npm shrinkwrap && npm install --only=dev --no-shrinkwrap)",
72
- "restore-shrinkwrap": "!(test -e npm-shrinkwrap.json) || (mv npm-shrinkwrap-backup.json npm-shrinkwrap.json)",
73
- "backup-shrinkwrap": "mv npm-shrinkwrap.json npm-shrinkwrap-backup.json",
74
- "check-pruned-shrinkwrap": "node check-pruned-shrinkwrap.js",
75
- "test": "gulp once",
76
- "e2e-test": "gulp e2e-test",
77
- "watch": "gulp watch",
78
- "build": "gulp transpile",
79
- "mocha": "mocha",
80
- "precommit-msg": "echo 'Pre-commit checks...' && exit 0",
81
- "precommit-test": "REPORTER=dot gulp once",
82
- "lint": "gulp lint",
83
- "lint:fix": "gulp lint --fix",
84
- "coverage": "gulp coveralls",
85
- "generate-docs": "node ./build/commands-yml/parse.js",
86
- "zip": "zip -qr appium.zip .",
39
+ "generate-docs": "gulp transpile && node ./build/commands-yml/parse.js",
40
+ "postinstall": "node ./postinstall.js",
87
41
  "upload": "gulp github-upload",
88
- "zip-and-upload": "npm run zip && npm run upload",
89
- "authorize-ios": "authorize-ios"
42
+ "zip": "zip -qr appium.zip .",
43
+ "zip-and-upload": "npm run zip && npm run upload"
90
44
  },
91
- "pre-commit": [
92
- "precommit-msg",
93
- "precommit-test"
94
- ],
95
- "devDependencies": {
96
- "@appium/fake-plugin": "^0.2.0",
97
- "appium-fake-driver": "^1.0.1",
98
- "appium-gulp-plugins": "^5.2.1",
99
- "chai": "4.x",
100
- "chai-as-promised": "7.x",
101
- "eslint-config-appium": "^4.0.1",
102
- "fancy-log": "^1.3.2",
103
- "gulp": "^4.0.0",
104
- "handlebars": "^4.2.0",
105
- "mocha": "^8.0.1",
106
- "pre-commit": "1.x",
107
- "sinon": "^9.0.0",
108
- "validate.js": "^0.13.0",
109
- "wd": "^1.10.0",
110
- "yaml-js": "^0.2.0"
111
- }
45
+ "dependencies": {
46
+ "@appium/base-driver": "^8.2.2",
47
+ "@appium/base-plugin": "1.8.0",
48
+ "@appium/support": "^2.55.2",
49
+ "@babel/runtime": "7.16.3",
50
+ "@sidvind/better-ajv-errors": "0.9.2",
51
+ "ajv": "8.8.2",
52
+ "ajv-formats": "2.1.1",
53
+ "argparse": "2.0.1",
54
+ "async-lock": "1.3.0",
55
+ "asyncbox": "2.9.2",
56
+ "axios": "0.24.0",
57
+ "bluebird": "3.7.2",
58
+ "continuation-local-storage": "3.2.1",
59
+ "find-up": "5.0.0",
60
+ "lilconfig": "2.0.4",
61
+ "lodash": "4.17.21",
62
+ "longjohn": "0.2.12",
63
+ "npmlog": "5.0.1",
64
+ "ora": "5.4.1",
65
+ "resolve-from": "5.0.0",
66
+ "semver": "7.3.5",
67
+ "source-map-support": "0.5.21",
68
+ "teen_process": "1.16.0",
69
+ "winston": "3.3.3",
70
+ "word-wrap": "1.2.3",
71
+ "yaml": "1.10.2"
72
+ },
73
+ "engines": {
74
+ "node": ">=12",
75
+ "npm": ">=6"
76
+ },
77
+ "publishConfig": {
78
+ "access": "public",
79
+ "tag": "next"
80
+ },
81
+ "homepage": "https://appium.io",
82
+ "gitHead": "280d409df6c02d36b4ffc4d02a95ab3f4649b08c"
112
83
  }
package/postinstall.js ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable no-console, promise/prefer-await-to-then */
3
+
4
+ async function main () {
5
+ const driverEnv = process.env.npm_config_drivers;
6
+ const pluginEnv = process.env.npm_config_plugins;
7
+
8
+ if (!driverEnv && !pluginEnv) {
9
+ console.log('Not auto-installing any drivers or plugins');
10
+ return;
11
+ }
12
+
13
+ let extension;
14
+ try {
15
+ extension = require('./build/lib/cli/extension');
16
+ } catch (e) {
17
+ throw new Error(`Could not load extension CLI file; has the project been transpiled? ` +
18
+ `(${e.message})`);
19
+ }
20
+
21
+ const {DEFAULT_APPIUM_HOME, DRIVER_TYPE, PLUGIN_TYPE} = require('./build/lib/extension-config');
22
+ const {runExtensionCommand} = extension;
23
+ const appiumHome = process.env.npm_config_appium_home || DEFAULT_APPIUM_HOME;
24
+ const specs = [[DRIVER_TYPE, driverEnv], [PLUGIN_TYPE, pluginEnv]];
25
+
26
+ for (const [type, extEnv] of specs) {
27
+ if (extEnv) {
28
+ for (const ext of extEnv.split(',')) {
29
+ try {
30
+ await checkAndInstallExtension({runExtensionCommand, appiumHome, type, ext});
31
+ } catch (e) {
32
+ console.log(`There was an error checking and installing ${type} ${ext}: ${e.message}`);
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+
39
+ async function checkAndInstallExtension ({
40
+ runExtensionCommand,
41
+ appiumHome,
42
+ type,
43
+ ext,
44
+ }) {
45
+ const extList = await runExtensionCommand({
46
+ appiumHome,
47
+ [`${type}Command`]: 'list',
48
+ showInstalled: true,
49
+ suppressOutput: true,
50
+ }, type);
51
+ if (extList[ext]) {
52
+ console.log(`The ${type} ${ext} was already installed, skipping...`);
53
+ return;
54
+ }
55
+ console.log(`Installing the ${type} ${ext}...`);
56
+ await runExtensionCommand({
57
+ appiumHome,
58
+ [`${type}Command`]: 'install',
59
+ [type]: ext,
60
+ suppressOutput: true,
61
+ }, type);
62
+ }
63
+
64
+ if (require.main === module) {
65
+ main().then(() => {
66
+ process.exit(0);
67
+ }).catch((e) => {
68
+ console.error(e);
69
+ process.exit(1);
70
+ });
71
+ }
@@ -0,0 +1,197 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * IP address to listen on
10
+ */
11
+ export type AddressConfig = string;
12
+ /**
13
+ * Whether the Appium server should allow web browser connections from any host
14
+ */
15
+ export type AllowCorsConfig = boolean;
16
+ /**
17
+ * Set which insecure features are allowed to run in this server's sessions. Features are defined on a driver level; see documentation for more details. Note that features defined via "deny-insecure" will be disabled, even if also listed here. If string, a path to a text file containing policy or a comma-delimited list.
18
+ */
19
+ export type AllowInsecureConfig = string[];
20
+ /**
21
+ * Base path to use as the prefix for all webdriver routes running on the server
22
+ */
23
+ export type BasePathConfig = string;
24
+ /**
25
+ * Callback IP address (default: same as "address")
26
+ */
27
+ export type CallbackAddressConfig = string;
28
+ /**
29
+ * Callback port (default: same as "port")
30
+ */
31
+ export type CallbackPortConfig = number;
32
+ /**
33
+ * Add exaggerated spacing in logs to help with visual inspection
34
+ */
35
+ export type DebugLogSpacingConfig = boolean;
36
+ /**
37
+ * Set which insecure features are not allowed to run in this server's sessions. Features are defined on a driver level; see documentation for more details. Features listed here will not be enabled even if also listed in "allow-insecure", and even if "relaxed-security" is enabled. If string, a path to a text file containing policy or a comma-delimited list.
38
+ */
39
+ export type DenyInsecureConfig = string[];
40
+ /**
41
+ * Number of seconds the Appium server should apply as both the keep-alive timeout and the connection timeout for all requests. A value of 0 disables the timeout.
42
+ */
43
+ export type KeepAliveTimeoutConfig = number;
44
+ /**
45
+ * Use local timezone for timestamps
46
+ */
47
+ export type LocalTimezoneConfig = boolean;
48
+ /**
49
+ * Also send log output to this file
50
+ */
51
+ export type LogConfig = string;
52
+ /**
53
+ * One or more log filtering rules
54
+ */
55
+ export type LogFiltersConfig = string[];
56
+ /**
57
+ * Log level (console[:file])
58
+ */
59
+ export type LogLevelConfig =
60
+ | "info"
61
+ | "info:debug"
62
+ | "info:info"
63
+ | "info:warn"
64
+ | "info:error"
65
+ | "warn"
66
+ | "warn:debug"
67
+ | "warn:info"
68
+ | "warn:warn"
69
+ | "warn:error"
70
+ | "error"
71
+ | "error:debug"
72
+ | "error:info"
73
+ | "error:warn"
74
+ | "error:error"
75
+ | "debug"
76
+ | "debug:debug"
77
+ | "debug:info"
78
+ | "debug:warn"
79
+ | "debug:error";
80
+ /**
81
+ * Do not use color in console output
82
+ */
83
+ export type LogNoColorsConfig = boolean;
84
+ /**
85
+ * Show timestamps in console output
86
+ */
87
+ export type LogTimestampConfig = boolean;
88
+ /**
89
+ * Add long stack traces to log entries. Recommended for debugging only.
90
+ */
91
+ export type LongStacktraceConfig = boolean;
92
+ /**
93
+ * Do not check that needed files are readable and/or writable
94
+ */
95
+ export type NoPermsCheckConfig = boolean;
96
+ /**
97
+ * Port to listen on
98
+ */
99
+ export type PortConfig = number;
100
+ /**
101
+ * Disable additional security checks, so it is possible to use some advanced features, provided by drivers supporting this option. Only enable it if all the clients are in the trusted network and it's not the case if a client could potentially break out of the session sandbox. Specific features can be overridden by using "deny-insecure"
102
+ */
103
+ export type RelaxedSecurityConfig = boolean;
104
+ /**
105
+ * Enables session override (clobbering)
106
+ */
107
+ export type SessionOverrideConfig = boolean;
108
+ /**
109
+ * Cause sessions to fail if desired caps are sent in that Appium does not recognize as valid for the selected device
110
+ */
111
+ export type StrictCapsConfig = boolean;
112
+ /**
113
+ * Absolute path to directory Appium can use to manage temp files. Defaults to C:\Windows\Temp on Windows and /tmp otherwise.
114
+ */
115
+ export type TmpConfig = string;
116
+ /**
117
+ * Absolute path to directory Appium can use to save iOS instrument traces; defaults to <tmp>/appium-instruments
118
+ */
119
+ export type TraceDirConfig = string;
120
+ /**
121
+ * A list of drivers to activate. By default, all installed drivers will be activated.
122
+ */
123
+ export type UseDriversConfig = string[];
124
+ /**
125
+ * A list of plugins to activate. To activate all plugins, the value should be an array with a single item "all".
126
+ */
127
+ export type UsePluginsConfig = string[];
128
+ /**
129
+ * Also send log output to this http listener
130
+ */
131
+ export type WebhookConfig = string;
132
+
133
+ /**
134
+ * A schema for Appium configuration files
135
+ */
136
+ export interface AppiumConfiguration {
137
+ server?: ServerConfig;
138
+ }
139
+ /**
140
+ * Configuration when running Appium as a server
141
+ */
142
+ export interface ServerConfig {
143
+ address?: AddressConfig;
144
+ "allow-cors"?: AllowCorsConfig;
145
+ "allow-insecure"?: AllowInsecureConfig;
146
+ "base-path"?: BasePathConfig;
147
+ "callback-address"?: CallbackAddressConfig;
148
+ "callback-port"?: CallbackPortConfig;
149
+ "debug-log-spacing"?: DebugLogSpacingConfig;
150
+ "default-capabilities"?: DefaultCapabilitiesConfig;
151
+ "deny-insecure"?: DenyInsecureConfig;
152
+ driver?: DriverConfig;
153
+ "keep-alive-timeout"?: KeepAliveTimeoutConfig;
154
+ "local-timezone"?: LocalTimezoneConfig;
155
+ log?: LogConfig;
156
+ "log-filters"?: LogFiltersConfig;
157
+ "log-level"?: LogLevelConfig;
158
+ "log-no-colors"?: LogNoColorsConfig;
159
+ "log-timestamp"?: LogTimestampConfig;
160
+ "long-stacktrace"?: LongStacktraceConfig;
161
+ "no-perms-check"?: NoPermsCheckConfig;
162
+ nodeconfig?: NodeconfigConfig;
163
+ plugin?: PluginConfig;
164
+ port?: PortConfig;
165
+ "relaxed-security"?: RelaxedSecurityConfig;
166
+ "session-override"?: SessionOverrideConfig;
167
+ "strict-caps"?: StrictCapsConfig;
168
+ tmp?: TmpConfig;
169
+ "trace-dir"?: TraceDirConfig;
170
+ "use-drivers"?: UseDriversConfig;
171
+ "use-plugins"?: UsePluginsConfig;
172
+ webhook?: WebhookConfig;
173
+ }
174
+ /**
175
+ * Set the default desired capabilities, which will be set on each session unless overridden by received capabilities. If a string, a path to a JSON file containing the capabilities, or raw JSON.
176
+ */
177
+ export interface DefaultCapabilitiesConfig {
178
+ [k: string]: unknown;
179
+ }
180
+ /**
181
+ * Driver-specific configuration. Keys should correspond to driver package names
182
+ */
183
+ export interface DriverConfig {
184
+ [k: string]: unknown;
185
+ }
186
+ /**
187
+ * Path to configuration JSON file to register Appium as a node with Selenium Grid 3; otherwise the configuration itself
188
+ */
189
+ export interface NodeconfigConfig {
190
+ [k: string]: unknown;
191
+ }
192
+ /**
193
+ * Plugin-specific configuration. Keys should correspond to plugin package names
194
+ */
195
+ export interface PluginConfig {
196
+ [k: string]: unknown;
197
+ }