appium 2.0.0-beta.25 → 2.0.0-beta.28

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 (191) hide show
  1. package/build/lib/appium.d.ts +215 -0
  2. package/build/lib/appium.d.ts.map +1 -0
  3. package/build/lib/appium.js +94 -101
  4. package/build/lib/cli/args.d.ts +20 -0
  5. package/build/lib/cli/args.d.ts.map +1 -0
  6. package/build/lib/cli/args.js +19 -39
  7. package/build/lib/cli/driver-command.d.ts +36 -0
  8. package/build/lib/cli/driver-command.d.ts.map +1 -0
  9. package/build/lib/cli/driver-command.js +10 -13
  10. package/build/lib/cli/extension-command.d.ts +345 -0
  11. package/build/lib/cli/extension-command.d.ts.map +1 -0
  12. package/build/lib/cli/extension-command.js +117 -94
  13. package/build/lib/cli/extension.d.ts +14 -0
  14. package/build/lib/cli/extension.d.ts.map +1 -0
  15. package/build/lib/cli/extension.js +14 -22
  16. package/build/lib/cli/parser.d.ts +79 -0
  17. package/build/lib/cli/parser.d.ts.map +1 -0
  18. package/build/lib/cli/parser.js +9 -19
  19. package/build/lib/cli/plugin-command.d.ts +39 -0
  20. package/build/lib/cli/plugin-command.d.ts.map +1 -0
  21. package/build/lib/cli/plugin-command.js +9 -14
  22. package/build/lib/cli/utils.d.ts +29 -0
  23. package/build/lib/cli/utils.d.ts.map +1 -0
  24. package/build/lib/cli/utils.js +2 -4
  25. package/build/lib/config-file.d.ts +100 -0
  26. package/build/lib/config-file.d.ts.map +1 -0
  27. package/build/lib/config-file.js +2 -4
  28. package/build/lib/config.d.ts +40 -0
  29. package/build/lib/config.d.ts.map +1 -0
  30. package/build/lib/config.js +8 -7
  31. package/build/lib/constants.d.ts +48 -0
  32. package/build/lib/constants.d.ts.map +1 -0
  33. package/build/lib/constants.js +60 -0
  34. package/build/lib/extension/driver-config.d.ts +84 -0
  35. package/build/lib/extension/driver-config.d.ts.map +1 -0
  36. package/build/lib/extension/driver-config.js +190 -0
  37. package/build/lib/extension/extension-config.d.ts +170 -0
  38. package/build/lib/extension/extension-config.d.ts.map +1 -0
  39. package/build/lib/extension/extension-config.js +297 -0
  40. package/build/lib/extension/index.d.ts +39 -0
  41. package/build/lib/extension/index.d.ts.map +1 -0
  42. package/build/lib/extension/index.js +77 -0
  43. package/build/lib/extension/manifest.d.ts +174 -0
  44. package/build/lib/extension/manifest.d.ts.map +1 -0
  45. package/build/lib/extension/manifest.js +246 -0
  46. package/build/lib/extension/package-changed.d.ts +11 -0
  47. package/build/lib/extension/package-changed.d.ts.map +1 -0
  48. package/build/lib/extension/package-changed.js +68 -0
  49. package/build/lib/extension/plugin-config.d.ts +62 -0
  50. package/build/lib/extension/plugin-config.d.ts.map +1 -0
  51. package/build/lib/extension/plugin-config.js +87 -0
  52. package/build/lib/grid-register.d.ts +10 -0
  53. package/build/lib/grid-register.d.ts.map +1 -0
  54. package/build/lib/grid-register.js +2 -4
  55. package/build/lib/logger.d.ts +3 -0
  56. package/build/lib/logger.d.ts.map +1 -0
  57. package/build/lib/logger.js +2 -4
  58. package/build/lib/logsink.d.ts +4 -0
  59. package/build/lib/logsink.d.ts.map +1 -0
  60. package/build/lib/logsink.js +2 -4
  61. package/build/lib/main.d.ts +51 -0
  62. package/build/lib/main.d.ts.map +1 -0
  63. package/build/lib/main.js +40 -68
  64. package/build/lib/schema/arg-spec.d.ts +143 -0
  65. package/build/lib/schema/arg-spec.d.ts.map +1 -0
  66. package/build/lib/schema/arg-spec.js +11 -14
  67. package/build/lib/schema/cli-args.d.ts +19 -0
  68. package/build/lib/schema/cli-args.d.ts.map +1 -0
  69. package/build/lib/schema/cli-args.js +2 -4
  70. package/build/lib/schema/cli-transformers.d.ts +5 -0
  71. package/build/lib/schema/cli-transformers.d.ts.map +1 -0
  72. package/build/lib/schema/cli-transformers.js +2 -4
  73. package/build/lib/schema/index.d.ts +3 -0
  74. package/build/lib/schema/index.d.ts.map +1 -0
  75. package/build/lib/schema/index.js +2 -4
  76. package/build/lib/schema/keywords.d.ts +24 -0
  77. package/build/lib/schema/keywords.d.ts.map +1 -0
  78. package/build/lib/schema/keywords.js +2 -4
  79. package/build/lib/schema/schema.d.ts +259 -0
  80. package/build/lib/schema/schema.d.ts.map +1 -0
  81. package/build/lib/schema/schema.js +57 -39
  82. package/build/lib/utils.d.ts +66 -0
  83. package/build/lib/utils.d.ts.map +1 -0
  84. package/build/lib/utils.js +6 -35
  85. package/build/tsconfig.tsbuildinfo +1 -0
  86. package/lib/appium.js +188 -117
  87. package/lib/cli/args.js +19 -24
  88. package/lib/cli/driver-command.js +19 -8
  89. package/lib/cli/extension-command.js +314 -184
  90. package/lib/cli/extension.js +18 -16
  91. package/lib/cli/parser.js +7 -16
  92. package/lib/cli/plugin-command.js +16 -7
  93. package/lib/cli/utils.js +1 -1
  94. package/lib/config-file.js +6 -7
  95. package/lib/config.js +17 -12
  96. package/lib/constants.js +78 -0
  97. package/lib/extension/driver-config.js +249 -0
  98. package/lib/extension/extension-config.js +458 -0
  99. package/lib/extension/index.js +102 -0
  100. package/lib/extension/manifest.js +486 -0
  101. package/lib/extension/package-changed.js +63 -0
  102. package/lib/extension/plugin-config.js +113 -0
  103. package/lib/grid-register.js +4 -4
  104. package/lib/logsink.js +4 -0
  105. package/lib/main.js +54 -92
  106. package/lib/schema/arg-spec.js +11 -7
  107. package/lib/schema/cli-args.js +1 -1
  108. package/lib/schema/cli-transformers.js +0 -1
  109. package/lib/schema/keywords.js +1 -2
  110. package/lib/schema/schema.js +62 -31
  111. package/lib/utils.js +48 -45
  112. package/package.json +30 -24
  113. package/{postinstall.js → scripts/postinstall.js} +1 -1
  114. package/types/appium-manifest.d.ts +61 -0
  115. package/types/cli.d.ts +134 -0
  116. package/types/extension.d.ts +56 -0
  117. package/types/external-manifest.d.ts +58 -0
  118. package/types/index.d.ts +7 -0
  119. package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
  120. package/build/check-npm-pack-files.js +0 -23
  121. package/build/commands-yml/parse.js +0 -319
  122. package/build/commands-yml/validator.js +0 -130
  123. package/build/index.js +0 -19
  124. package/build/lib/appium-config.schema.json +0 -0
  125. package/build/lib/cli/npm.js +0 -220
  126. package/build/lib/driver-config.js +0 -100
  127. package/build/lib/drivers.js +0 -100
  128. package/build/lib/ext-config-io.js +0 -165
  129. package/build/lib/extension-config.js +0 -320
  130. package/build/lib/plugin-config.js +0 -69
  131. package/build/lib/plugins.js +0 -18
  132. package/build/lib/schema/appium-config-schema.js +0 -253
  133. package/build/postinstall.js +0 -90
  134. package/build/test/cli/cli-e2e-specs.js +0 -221
  135. package/build/test/cli/cli-helpers.js +0 -86
  136. package/build/test/cli/cli-specs.js +0 -71
  137. package/build/test/cli/fixtures/test-driver/package.json +0 -27
  138. package/build/test/cli/schema-args-specs.js +0 -48
  139. package/build/test/cli/schema-e2e-specs.js +0 -47
  140. package/build/test/config-e2e-specs.js +0 -112
  141. package/build/test/config-file-e2e-specs.js +0 -191
  142. package/build/test/config-file-specs.js +0 -281
  143. package/build/test/config-specs.js +0 -258
  144. package/build/test/driver-e2e-specs.js +0 -435
  145. package/build/test/driver-specs.js +0 -386
  146. package/build/test/ext-config-io-specs.js +0 -181
  147. package/build/test/extension-config-specs.js +0 -365
  148. package/build/test/fixtures/allow-feat.txt +0 -5
  149. package/build/test/fixtures/caps.json +0 -3
  150. package/build/test/fixtures/config/allow-insecure.txt +0 -3
  151. package/build/test/fixtures/config/appium.config.bad-nodeconfig.json +0 -5
  152. package/build/test/fixtures/config/appium.config.bad.json +0 -32
  153. package/build/test/fixtures/config/appium.config.ext-good.json +0 -9
  154. package/build/test/fixtures/config/appium.config.ext-unknown-props.json +0 -10
  155. package/build/test/fixtures/config/appium.config.good.js +0 -40
  156. package/build/test/fixtures/config/appium.config.good.json +0 -33
  157. package/build/test/fixtures/config/appium.config.good.yaml +0 -30
  158. package/build/test/fixtures/config/appium.config.invalid.json +0 -31
  159. package/build/test/fixtures/config/appium.config.security-array.json +0 -5
  160. package/build/test/fixtures/config/appium.config.security-delimited.json +0 -5
  161. package/build/test/fixtures/config/appium.config.security-path.json +0 -5
  162. package/build/test/fixtures/config/driver-fake.config.json +0 -8
  163. package/build/test/fixtures/config/nodeconfig.json +0 -3
  164. package/build/test/fixtures/config/plugin-fake.config.json +0 -0
  165. package/build/test/fixtures/default-args.js +0 -35
  166. package/build/test/fixtures/deny-feat.txt +0 -5
  167. package/build/test/fixtures/driver.schema.js +0 -20
  168. package/build/test/fixtures/extensions.yaml +0 -27
  169. package/build/test/fixtures/flattened-schema.js +0 -532
  170. package/build/test/fixtures/plugin.schema.js +0 -20
  171. package/build/test/fixtures/schema-with-extensions.js +0 -28
  172. package/build/test/grid-register-specs.js +0 -74
  173. package/build/test/helpers.js +0 -75
  174. package/build/test/logger-specs.js +0 -76
  175. package/build/test/npm-specs.js +0 -20
  176. package/build/test/parser-specs.js +0 -319
  177. package/build/test/plugin-e2e-specs.js +0 -316
  178. package/build/test/schema/arg-spec-specs.js +0 -70
  179. package/build/test/schema/cli-args-specs.js +0 -408
  180. package/build/test/schema/schema-specs.js +0 -407
  181. package/build/test/utils-specs.js +0 -288
  182. package/lib/cli/npm.js +0 -251
  183. package/lib/driver-config.js +0 -101
  184. package/lib/drivers.js +0 -84
  185. package/lib/ext-config-io.js +0 -287
  186. package/lib/extension-config.js +0 -366
  187. package/lib/plugin-config.js +0 -63
  188. package/lib/plugins.js +0 -13
  189. package/lib/schema/appium-config-schema.js +0 -287
  190. package/types/appium-config.d.ts +0 -197
  191. package/types/types.d.ts +0 -206
@@ -1,287 +0,0 @@
1
- // @ts-check
2
-
3
- const schema = /** @type {const} */ ({
4
- $schema: 'http://json-schema.org/draft-07/schema',
5
- additionalProperties: false,
6
- description: 'A schema for Appium configuration files',
7
- properties: {
8
- server: {
9
- additionalProperties: false,
10
- description: 'Configuration when running Appium as a server',
11
- properties: {
12
- address: {
13
- $comment:
14
- 'I think hostname covers both DNS and IPv4...could be wrong',
15
- appiumCliAliases: ['a'],
16
- default: '0.0.0.0',
17
- description: 'IP address to listen on',
18
- format: 'hostname',
19
- title: 'address config',
20
- type: 'string',
21
- },
22
- 'allow-cors': {
23
- description:
24
- 'Whether the Appium server should allow web browser connections from any host',
25
- title: 'allow-cors config',
26
- type: 'boolean',
27
- default: false,
28
- },
29
- 'allow-insecure': {
30
- appiumCliTransformer: 'csv',
31
- default: [],
32
- description:
33
- '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.',
34
- items: {
35
- type: 'string',
36
- },
37
- title: 'allow-insecure config',
38
- type: 'array',
39
- uniqueItems: true,
40
- },
41
- 'base-path': {
42
- appiumCliAliases: ['pa'],
43
- default: '',
44
- description:
45
- 'Base path to use as the prefix for all webdriver routes running on the server',
46
- title: 'base-path config',
47
- type: 'string',
48
- },
49
- 'callback-address': {
50
- appiumCliAliases: ['ca'],
51
- description: 'Callback IP address (default: same as "address")',
52
- title: 'callback-address config',
53
- type: 'string',
54
- },
55
- 'callback-port': {
56
- appiumCliAliases: ['cp'],
57
- default: 4723,
58
- description: 'Callback port (default: same as "port")',
59
- maximum: 65535,
60
- minimum: 1,
61
- title: 'callback-port config',
62
- type: 'integer',
63
- },
64
- 'debug-log-spacing': {
65
- default: false,
66
- description:
67
- 'Add exaggerated spacing in logs to help with visual inspection',
68
- title: 'debug-log-spacing config',
69
- type: 'boolean',
70
- },
71
- 'default-capabilities': {
72
- $comment: 'TODO',
73
- appiumCliAliases: ['dc'],
74
- description:
75
- '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.',
76
- title: 'default-capabilities config',
77
- type: 'object',
78
- },
79
- 'deny-insecure': {
80
- $comment: 'Allowed values are defined by drivers',
81
- appiumCliTransformer: 'csv',
82
- default: [],
83
- description:
84
- '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.',
85
- items: {
86
- type: 'string',
87
- },
88
- title: 'deny-insecure config',
89
- type: 'array',
90
- uniqueItems: true,
91
- },
92
- driver: {
93
- description:
94
- 'Driver-specific configuration. Keys should correspond to driver package names',
95
- properties: {},
96
- title: 'driver config',
97
- type: 'object',
98
- },
99
- 'keep-alive-timeout': {
100
- appiumCliAliases: ['ka'],
101
- default: 600,
102
- description:
103
- '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.',
104
- minimum: 0,
105
- title: 'keep-alive-timeout config',
106
- type: 'integer',
107
- },
108
- 'local-timezone': {
109
- default: false,
110
- description: 'Use local timezone for timestamps',
111
- title: 'local-timezone config',
112
- type: 'boolean',
113
- },
114
- log: {
115
- appiumCliAliases: ['g'],
116
- appiumCliDest: 'logFile',
117
- description: 'Also send log output to this file',
118
- title: 'log config',
119
- type: 'string',
120
- },
121
- 'log-filters': {
122
- $comment: 'TODO',
123
- description: 'One or more log filtering rules',
124
- items: {
125
- type: 'string',
126
- },
127
- title: 'log-filters config',
128
- type: 'array',
129
- },
130
- 'log-level': {
131
- appiumCliDest: 'loglevel',
132
- default: 'debug',
133
- description: 'Log level (console[:file])',
134
- enum: [
135
- 'info',
136
- 'info:debug',
137
- 'info:info',
138
- 'info:warn',
139
- 'info:error',
140
- 'warn',
141
- 'warn:debug',
142
- 'warn:info',
143
- 'warn:warn',
144
- 'warn:error',
145
- 'error',
146
- 'error:debug',
147
- 'error:info',
148
- 'error:warn',
149
- 'error:error',
150
- 'debug',
151
- 'debug:debug',
152
- 'debug:info',
153
- 'debug:warn',
154
- 'debug:error',
155
- ],
156
- title: 'log-level config',
157
- type: 'string',
158
- },
159
- 'log-no-colors': {
160
- default: false,
161
- description: 'Do not use color in console output',
162
- title: 'log-no-colors config',
163
- type: 'boolean',
164
- },
165
- 'log-timestamp': {
166
- default: false,
167
- description: 'Show timestamps in console output',
168
- title: 'log-timestamp config',
169
- type: 'boolean',
170
- },
171
- 'long-stacktrace': {
172
- default: false,
173
- description:
174
- 'Add long stack traces to log entries. Recommended for debugging only.',
175
- title: 'long-stacktrace config',
176
- type: 'boolean',
177
- },
178
- 'no-perms-check': {
179
- default: false,
180
- description:
181
- 'Do not check that needed files are readable and/or writable',
182
- title: 'no-perms-check config',
183
- type: 'boolean',
184
- },
185
- nodeconfig: {
186
- $comment:
187
- 'Selenium Grid 3 is unmaintained and Selenium Grid 4 no longer supports this file.',
188
- description:
189
- 'Path to configuration JSON file to register Appium as a node with Selenium Grid 3; otherwise the configuration itself',
190
- title: 'nodeconfig config',
191
- type: 'object',
192
- },
193
- plugin: {
194
- description:
195
- 'Plugin-specific configuration. Keys should correspond to plugin package names',
196
- properties: {},
197
- title: 'plugin config',
198
- type: 'object',
199
- },
200
- port: {
201
- appiumCliAliases: ['p'],
202
- default: 4723,
203
- description: 'Port to listen on',
204
- maximum: 65535,
205
- minimum: 1,
206
- title: 'port config',
207
- type: 'integer',
208
- },
209
- 'relaxed-security': {
210
- default: false,
211
- description:
212
- '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"',
213
- title: 'relaxed-security config',
214
- type: 'boolean',
215
- appiumCliDest: 'relaxedSecurityEnabled'
216
- },
217
- 'session-override': {
218
- default: false,
219
- description: 'Enables session override (clobbering)',
220
- title: 'session-override config',
221
- type: 'boolean',
222
- },
223
- 'strict-caps': {
224
- default: false,
225
- description:
226
- 'Cause sessions to fail if desired caps are sent in that Appium does not recognize as valid for the selected device',
227
- title: 'strict-caps config',
228
- type: 'boolean',
229
- },
230
- tmp: {
231
- appiumCliDest: 'tmpDir',
232
- description:
233
- 'Absolute path to directory Appium can use to manage temp files. Defaults to C:\\Windows\\Temp on Windows and /tmp otherwise.',
234
- title: 'tmp config',
235
- type: 'string',
236
- },
237
- 'trace-dir': {
238
- description:
239
- 'Absolute path to directory Appium can use to save iOS instrument traces; defaults to <tmp>/appium-instruments',
240
- title: 'trace-dir config',
241
- type: 'string',
242
- },
243
- 'use-drivers': {
244
- appiumCliDescription:
245
- 'A list of drivers to activate. Can be a comma-delimited string or path to CSV file. By default, all installed drivers will be activated.',
246
- default: [],
247
- description:
248
- 'A list of drivers to activate. By default, all installed drivers will be activated.',
249
- items: {
250
- type: 'string',
251
- },
252
- title: 'use-drivers config',
253
- type: 'array',
254
- uniqueItems: true,
255
- },
256
- 'use-plugins': {
257
- appiumCliDescription:
258
- 'A list of plugins to activate. Can be a comma-delimited string, path to CSV file, or the string "all" to use all installed plugins.',
259
- default: [],
260
- description:
261
- 'A list of plugins to activate. To activate all plugins, the value should be an array with a single item "all".',
262
- items: {
263
- type: 'string',
264
- },
265
- title: 'use-plugins config',
266
- type: 'array',
267
- uniqueItems: true,
268
- },
269
- webhook: {
270
- $comment:
271
- 'This should probably use a uri-template format to restrict the protocol to http/https',
272
- appiumCliAliases: ['G'],
273
- description: 'Also send log output to this http listener',
274
- format: 'uri',
275
- title: 'webhook config',
276
- type: 'string',
277
- },
278
- },
279
- title: 'server config',
280
- type: 'object',
281
- },
282
- },
283
- title: 'Appium Configuration',
284
- type: 'object',
285
- });
286
-
287
- export default schema;
@@ -1,197 +0,0 @@
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
- }
package/types/types.d.ts DELETED
@@ -1,206 +0,0 @@
1
- import {transformers} from '../lib/schema/cli-transformers';
2
- import {SERVER_SUBCOMMAND} from '../lib/cli/parser';
3
- import {
4
- DRIVER_TYPE as DRIVER_SUBCOMMAND,
5
- PLUGIN_TYPE as PLUGIN_SUBCOMMAND,
6
- } from '../lib/ext-config-io';
7
- import appiumConfigSchema from '../lib/schema/appium-config-schema';
8
- import {AppiumConfiguration, ServerConfig} from './appium-config';
9
-
10
- /**
11
- * Converts a kebab-cased string into a camel-cased string.
12
- */
13
- export type KebabToCamel<S extends string> =
14
- S extends `${infer P1}-${infer P2}${infer P3}`
15
- ? `${Lowercase<P1>}${Uppercase<P2>}${KebabToCamel<P3>}`
16
- : Lowercase<S>;
17
-
18
- /**
19
- * Converts an object with kebab-cased keys into camel-cased keys.
20
- */
21
- type ObjectToCamel<T> = {
22
- [K in keyof T as KebabToCamel<string & K>]: T[K] extends Record<string, any>
23
- ? KeysToCamelCase<T[K]>
24
- : T[K];
25
- };
26
-
27
- /**
28
- * Converts an object or array to have camel-cased keys.
29
- */
30
- export type KeysToCamelCase<T> = {
31
- [K in keyof T as KebabToCamel<string & K>]: T[K] extends Array<any>
32
- ? KeysToCamelCase<T[K][number]>[]
33
- : ObjectToCamel<T[K]>;
34
- };
35
-
36
- /**
37
- * The Appium configuration as it would be in a configuration file.
38
- */
39
- export type AppiumConfig = Partial<AppiumConfiguration>;
40
-
41
- /**
42
- * Certain properties have an `appiumCliDest` prop, which affects the shape of
43
- * {@link ParsedArgs}. This type helps recognize these properties.
44
- *
45
- * See `../lib/schema/keywords` for definition of `appiumCliDest`.
46
- */
47
- interface WithDest {
48
- appiumCliDest: string;
49
- }
50
-
51
- /**
52
- * Some properties have a `default` prop, which means practically they will not
53
- * be `undefined` upon parsing.
54
- *
55
- * We use this to ensure that the {@link ParsedArgs} makes guarantees
56
- * about the presence of properties.
57
- */
58
- interface WithDefault {
59
- default: any;
60
- }
61
-
62
- interface WithCliTransformer {
63
- appiumCliTransformer: keyof typeof transformers;
64
- }
65
-
66
- interface WithTypeArray {
67
- type: 'array';
68
- }
69
- interface WithTypeObject {
70
- type: 'object';
71
- }
72
- type WithTransformer = WithCliTransformer | WithTypeArray | WithTypeObject;
73
-
74
- /**
75
- * Derive the "constant" type of the server properties from the schema.
76
- */
77
- type AppiumServerSchema =
78
- typeof appiumConfigSchema['properties']['server']['properties'];
79
-
80
- /**
81
- * Properties of `T` with keys `appiumCliDest` prop _or_ just camel-cased.
82
- */
83
- type NormalizedServerConfig = {
84
- [Prop in keyof ServerConfigMapping as AppiumServerSchema[Prop] extends WithDest
85
- ? AppiumServerSchema[Prop]['appiumCliDest']
86
- : KebabToCamel<Prop>]: ServerConfig[Prop];
87
- };
88
-
89
- /**
90
- * "Normalized" config, which is like the flattened config (camel-cased keys),
91
- * but not flattened.
92
- */
93
- export type NormalizedAppiumConfig = {
94
- server: NormalizedServerConfig;
95
- };
96
-
97
- /**
98
- * Utility type to associate {@link AppiumServerSchema} with
99
- * {@link ServerConfig}.
100
- */
101
- type ServerConfigMapping = {
102
- [Prop in keyof Required<ServerConfig>]: AppiumServerSchema[Prop];
103
- };
104
-
105
- /**
106
- * This type checks if `appiumCliDest` is present in the object via
107
- * {@link WithDest}, and uses the _value_ of that property for the key name;
108
- * otherwise uses the camel-cased value of the key name.
109
- */
110
- type SetKeyForProp<Prop extends keyof ServerConfigMapping> =
111
- AppiumServerSchema[Prop] extends WithDest
112
- ? AppiumServerSchema[Prop]['appiumCliDest']
113
- : KebabToCamel<Prop>;
114
-
115
- /**
116
- * Checks for the existence of default values, and ensures those properties will
117
- * be defined (eliminate `| undefined` from the type).
118
- */
119
- type DefaultForProp<Prop extends keyof ServerConfigMapping> =
120
- AppiumServerSchema[Prop] extends WithDefault
121
- ? NonNullable<ServerConfig[Prop]>
122
- : ServerConfig[Prop];
123
-
124
- /**
125
- * The final shape of the parsed CLI arguments.
126
- */
127
- type ParsedArgsFromConfig = {
128
- [Prop in keyof ServerConfigMapping as SetKeyForProp<Prop>]: DefaultForProp<Prop>;
129
- };
130
-
131
- /**
132
- * Possible subcommands for the `appium` CLI.
133
- */
134
- type CliSubCommands =
135
- | typeof SERVER_SUBCOMMAND
136
- | typeof DRIVER_SUBCOMMAND
137
- | typeof PLUGIN_SUBCOMMAND;
138
-
139
- /**
140
- * Possible subcommands of {@link DRIVER_SUBCOMMAND} or
141
- * {@link PLUGIN_SUBCOMMAND}.
142
- */
143
- type CliExtensionSubcommands =
144
- | 'list'
145
- | 'install'
146
- | 'uninstall'
147
- | 'update'
148
- | 'run';
149
-
150
- /**
151
- * Random stuff that may appear in the parsed args which has no equivalent in a
152
- * config file.
153
- */
154
- interface MoreArgs {
155
- /**
156
- * Path to config file, if any
157
- */
158
- configFile: string;
159
-
160
- /**
161
- * If true, show the build info and exit
162
- */
163
- showBuildInfo: boolean;
164
-
165
- /**
166
- * If true, show config and exit
167
- */
168
- showConfig: boolean;
169
-
170
- /**
171
- * If true, open a REPL
172
- */
173
- shell: boolean;
174
-
175
- /**
176
- * If true, throw on error instead of exit. Not supported via CLI, but rather
177
- * only programmatic usage.
178
- */
179
- throwInsteadOfExit: boolean;
180
-
181
- /**
182
- * Possible subcommands
183
- */
184
- subcommand:
185
- | typeof DRIVER_SUBCOMMAND
186
- | typeof PLUGIN_SUBCOMMAND
187
- | typeof SERVER_SUBCOMMAND;
188
-
189
- /**
190
- * Subcommands of `driver` subcommand
191
- */
192
- driverCommand: CliExtensionSubcommands;
193
-
194
- /**
195
- * Subcommands of `plugin` subcommand
196
- */
197
- pluginCommand: CliExtensionSubcommands;
198
- }
199
-
200
- /**
201
- * The Appium configuration as a flattened object, parsed via CLI args _and_ any
202
- * CLI args unsupported by the config file.
203
- * @todo Does not make any assumptions about property names derived from
204
- * extensions.
205
- */
206
- export type ParsedArgs = ParsedArgsFromConfig & Partial<MoreArgs>;