appium 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/build/lib/appium.d.ts +147 -205
  2. package/build/lib/appium.d.ts.map +1 -1
  3. package/build/lib/appium.js +169 -282
  4. package/build/lib/appium.js.map +1 -1
  5. package/build/lib/bidi-commands.d.ts.map +1 -1
  6. package/build/lib/bidi-commands.js +11 -11
  7. package/build/lib/bidi-commands.js.map +1 -1
  8. package/build/lib/bootstrap/appium-initializer.d.ts +21 -0
  9. package/build/lib/bootstrap/appium-initializer.d.ts.map +1 -0
  10. package/build/lib/bootstrap/appium-initializer.js +146 -0
  11. package/build/lib/bootstrap/appium-initializer.js.map +1 -0
  12. package/build/lib/bootstrap/appium-main-runner.d.ts +22 -0
  13. package/build/lib/bootstrap/appium-main-runner.d.ts.map +1 -0
  14. package/build/lib/bootstrap/appium-main-runner.js +109 -0
  15. package/build/lib/bootstrap/appium-main-runner.js.map +1 -0
  16. package/build/lib/bootstrap/config-file.d.ts +37 -0
  17. package/build/lib/bootstrap/config-file.d.ts.map +1 -0
  18. package/build/lib/{config-file.js → bootstrap/config-file.js} +9 -26
  19. package/build/lib/bootstrap/config-file.js.map +1 -0
  20. package/build/lib/bootstrap/grid-v3-register.d.ts +20 -0
  21. package/build/lib/bootstrap/grid-v3-register.d.ts.map +1 -0
  22. package/build/lib/{grid-register.js → bootstrap/grid-v3-register.js} +28 -13
  23. package/build/lib/bootstrap/grid-v3-register.js.map +1 -0
  24. package/build/lib/bootstrap/init-types.d.ts +16 -0
  25. package/build/lib/bootstrap/init-types.d.ts.map +1 -0
  26. package/build/lib/bootstrap/init-types.js +3 -0
  27. package/build/lib/bootstrap/init-types.js.map +1 -0
  28. package/build/lib/bootstrap/main-helpers.d.ts +55 -0
  29. package/build/lib/bootstrap/main-helpers.d.ts.map +1 -0
  30. package/build/lib/bootstrap/main-helpers.js +187 -0
  31. package/build/lib/bootstrap/main-helpers.js.map +1 -0
  32. package/build/lib/bootstrap/node-helpers.d.ts +32 -0
  33. package/build/lib/bootstrap/node-helpers.d.ts.map +1 -0
  34. package/build/lib/bootstrap/node-helpers.js +201 -0
  35. package/build/lib/bootstrap/node-helpers.js.map +1 -0
  36. package/build/lib/bootstrap/startup-config.d.ts +22 -0
  37. package/build/lib/bootstrap/startup-config.d.ts.map +1 -0
  38. package/build/lib/bootstrap/startup-config.js +111 -0
  39. package/build/lib/bootstrap/startup-config.js.map +1 -0
  40. package/build/lib/cli/args.d.ts.map +1 -1
  41. package/build/lib/cli/args.js +9 -9
  42. package/build/lib/cli/args.js.map +1 -1
  43. package/build/lib/cli/extension-command.d.ts +95 -95
  44. package/build/lib/cli/extension-command.d.ts.map +1 -1
  45. package/build/lib/cli/extension-command.js +18 -18
  46. package/build/lib/cli/extension-command.js.map +1 -1
  47. package/build/lib/cli/extension.d.ts +1 -1
  48. package/build/lib/cli/extension.d.ts.map +1 -1
  49. package/build/lib/cli/extension.js +5 -5
  50. package/build/lib/cli/extension.js.map +1 -1
  51. package/build/lib/cli/parser.d.ts +8 -8
  52. package/build/lib/cli/parser.d.ts.map +1 -1
  53. package/build/lib/cli/parser.js +49 -49
  54. package/build/lib/cli/parser.js.map +1 -1
  55. package/build/lib/cli/setup-command.js +6 -6
  56. package/build/lib/cli/setup-command.js.map +1 -1
  57. package/build/lib/cli/utils.d.ts +17 -17
  58. package/build/lib/cli/utils.d.ts.map +1 -1
  59. package/build/lib/cli/utils.js +29 -29
  60. package/build/lib/cli/utils.js.map +1 -1
  61. package/build/lib/doctor/doctor.d.ts +2 -2
  62. package/build/lib/doctor/doctor.d.ts.map +1 -1
  63. package/build/lib/doctor/doctor.js +6 -6
  64. package/build/lib/doctor/doctor.js.map +1 -1
  65. package/build/lib/extension/driver-config.d.ts +18 -77
  66. package/build/lib/extension/driver-config.d.ts.map +1 -1
  67. package/build/lib/extension/driver-config.js +37 -125
  68. package/build/lib/extension/driver-config.js.map +1 -1
  69. package/build/lib/extension/extension-config.d.ts +103 -210
  70. package/build/lib/extension/extension-config.d.ts.map +1 -1
  71. package/build/lib/extension/extension-config.js +180 -342
  72. package/build/lib/extension/extension-config.js.map +1 -1
  73. package/build/lib/extension/index.d.ts +12 -29
  74. package/build/lib/extension/index.d.ts.map +1 -1
  75. package/build/lib/extension/index.js +33 -75
  76. package/build/lib/extension/index.js.map +1 -1
  77. package/build/lib/extension/manifest-migrations.d.ts +3 -20
  78. package/build/lib/extension/manifest-migrations.d.ts.map +1 -1
  79. package/build/lib/extension/manifest-migrations.js +20 -101
  80. package/build/lib/extension/manifest-migrations.js.map +1 -1
  81. package/build/lib/extension/manifest.d.ts +61 -107
  82. package/build/lib/extension/manifest.d.ts.map +1 -1
  83. package/build/lib/extension/manifest.js +181 -356
  84. package/build/lib/extension/manifest.js.map +1 -1
  85. package/build/lib/extension/package-changed.d.ts +1 -3
  86. package/build/lib/extension/package-changed.d.ts.map +1 -1
  87. package/build/lib/extension/package-changed.js +8 -15
  88. package/build/lib/extension/package-changed.js.map +1 -1
  89. package/build/lib/extension/plugin-config.d.ts +10 -52
  90. package/build/lib/extension/plugin-config.d.ts.map +1 -1
  91. package/build/lib/extension/plugin-config.js +11 -63
  92. package/build/lib/extension/plugin-config.js.map +1 -1
  93. package/build/lib/helpers/build.d.ts +22 -0
  94. package/build/lib/helpers/build.d.ts.map +1 -0
  95. package/build/lib/helpers/build.js +109 -0
  96. package/build/lib/helpers/build.js.map +1 -0
  97. package/build/lib/helpers/capability.d.ts +38 -0
  98. package/build/lib/helpers/capability.d.ts.map +1 -0
  99. package/build/lib/helpers/capability.js +128 -0
  100. package/build/lib/helpers/capability.js.map +1 -0
  101. package/build/lib/helpers/network.d.ts +14 -0
  102. package/build/lib/helpers/network.d.ts.map +1 -0
  103. package/build/lib/helpers/network.js +35 -0
  104. package/build/lib/helpers/network.js.map +1 -0
  105. package/build/lib/insecure-features.js +6 -6
  106. package/build/lib/insecure-features.js.map +1 -1
  107. package/build/lib/inspector-commands.d.ts +6 -0
  108. package/build/lib/inspector-commands.d.ts.map +1 -1
  109. package/build/lib/inspector-commands.js +6 -0
  110. package/build/lib/inspector-commands.js.map +1 -1
  111. package/build/lib/logger.d.ts +2 -3
  112. package/build/lib/logger.d.ts.map +1 -1
  113. package/build/lib/logger.js +2 -3
  114. package/build/lib/logger.js.map +1 -1
  115. package/build/lib/main.d.ts +15 -58
  116. package/build/lib/main.d.ts.map +1 -1
  117. package/build/lib/main.js +25 -425
  118. package/build/lib/main.js.map +1 -1
  119. package/build/lib/schema/cli-args-guards.d.ts +34 -0
  120. package/build/lib/schema/cli-args-guards.d.ts.map +1 -0
  121. package/build/lib/schema/cli-args-guards.js +49 -0
  122. package/build/lib/schema/cli-args-guards.js.map +1 -0
  123. package/build/lib/schema/cli-args.js +2 -2
  124. package/build/lib/schema/cli-args.js.map +1 -1
  125. package/build/lib/schema/format-errors.d.ts +28 -0
  126. package/build/lib/schema/format-errors.d.ts.map +1 -0
  127. package/build/lib/schema/format-errors.js +29 -0
  128. package/build/lib/schema/format-errors.js.map +1 -0
  129. package/build/lib/schema/index.d.ts +2 -0
  130. package/build/lib/schema/index.d.ts.map +1 -1
  131. package/build/lib/schema/index.js +2 -0
  132. package/build/lib/schema/index.js.map +1 -1
  133. package/build/lib/schema/schema.d.ts +15 -15
  134. package/build/lib/schema/schema.d.ts.map +1 -1
  135. package/build/lib/schema/schema.js +37 -37
  136. package/build/lib/schema/schema.js.map +1 -1
  137. package/build/lib/utils.d.ts +0 -81
  138. package/build/lib/utils.d.ts.map +1 -1
  139. package/build/lib/utils.js +1 -248
  140. package/build/lib/utils.js.map +1 -1
  141. package/lib/{appium.js → appium.ts} +297 -341
  142. package/lib/bidi-commands.ts +10 -14
  143. package/lib/bootstrap/appium-initializer.ts +212 -0
  144. package/lib/bootstrap/appium-main-runner.ts +172 -0
  145. package/lib/{config-file.ts → bootstrap/config-file.ts} +29 -63
  146. package/lib/{grid-register.ts → bootstrap/grid-v3-register.ts} +35 -35
  147. package/lib/bootstrap/init-types.ts +31 -0
  148. package/lib/bootstrap/main-helpers.ts +223 -0
  149. package/lib/bootstrap/node-helpers.ts +180 -0
  150. package/lib/bootstrap/startup-config.ts +143 -0
  151. package/lib/cli/args.ts +10 -10
  152. package/lib/cli/extension-command.ts +132 -132
  153. package/lib/cli/extension.ts +7 -7
  154. package/lib/cli/parser.ts +50 -50
  155. package/lib/cli/setup-command.ts +2 -2
  156. package/lib/cli/utils.ts +33 -33
  157. package/lib/doctor/doctor.ts +8 -8
  158. package/lib/extension/driver-config.ts +165 -0
  159. package/lib/extension/{extension-config.js → extension-config.ts} +291 -405
  160. package/lib/extension/index.ts +143 -0
  161. package/lib/extension/manifest-migrations.ts +57 -0
  162. package/lib/extension/manifest.ts +369 -0
  163. package/lib/extension/{package-changed.js → package-changed.ts} +9 -18
  164. package/lib/extension/plugin-config.ts +62 -0
  165. package/lib/helpers/build.ts +111 -0
  166. package/lib/helpers/capability.ts +171 -0
  167. package/lib/helpers/network.ts +30 -0
  168. package/lib/insecure-features.ts +1 -1
  169. package/lib/inspector-commands.ts +6 -1
  170. package/lib/{logger.js → logger.ts} +1 -2
  171. package/lib/main.ts +60 -0
  172. package/lib/schema/cli-args-guards.ts +67 -0
  173. package/lib/schema/cli-args.ts +1 -1
  174. package/lib/schema/format-errors.ts +43 -0
  175. package/lib/schema/index.ts +2 -0
  176. package/lib/schema/schema.ts +51 -52
  177. package/lib/utils.ts +0 -331
  178. package/package.json +12 -13
  179. package/scripts/autoinstall-extensions.js +3 -0
  180. package/build/lib/config-file.d.ts +0 -57
  181. package/build/lib/config-file.d.ts.map +0 -1
  182. package/build/lib/config-file.js.map +0 -1
  183. package/build/lib/config.d.ts +0 -68
  184. package/build/lib/config.d.ts.map +0 -1
  185. package/build/lib/config.js +0 -358
  186. package/build/lib/config.js.map +0 -1
  187. package/build/lib/grid-register.d.ts +0 -35
  188. package/build/lib/grid-register.d.ts.map +0 -1
  189. package/build/lib/grid-register.js.map +0 -1
  190. package/lib/config.ts +0 -377
  191. package/lib/extension/driver-config.js +0 -245
  192. package/lib/extension/index.js +0 -169
  193. package/lib/extension/manifest-migrations.js +0 -136
  194. package/lib/extension/manifest.js +0 -550
  195. package/lib/extension/plugin-config.js +0 -112
  196. package/lib/main.js +0 -545
@@ -46,13 +46,13 @@ export const ALLOWED_SCHEMA_EXTENSIONS = Object.freeze(
46
46
  const SCHEMA_KEY = '$schema';
47
47
 
48
48
  class AppiumSchema {
49
+ static #instance: AppiumSchema;
49
50
  #argSpecs = new RoachHotelMap<string, ArgSpec>();
50
51
  #registeredSchemas: Record<ExtensionType, Map<string, SchemaObject>> = {
51
52
  [DRIVER_TYPE]: new Map(),
52
53
  [PLUGIN_TYPE]: new Map(),
53
54
  };
54
55
  #ajv: Ajv;
55
- static #instance: AppiumSchema;
56
56
  #finalizedSchemas: Record<string, StrictSchemaObject> | null = null;
57
57
 
58
58
  private constructor() {
@@ -85,6 +85,36 @@ class AppiumSchema {
85
85
  return AppiumSchema.#instance;
86
86
  }
87
87
 
88
+ /**
89
+ * Returns `true` if filename extension is an allowed schema extension.
90
+ */
91
+ static isAllowedSchemaFileExtension(filename: string): boolean {
92
+ return ALLOWED_SCHEMA_EXTENSIONS.has(path.extname(filename) as AllowedSchemaExtension);
93
+ }
94
+
95
+ /**
96
+ * Returns `true` if schema is a plain object and not async.
97
+ */
98
+ static isSupportedSchemaType(schema: any): schema is SchemaObject {
99
+ return _.isPlainObject(schema) && (schema as any).$async !== true;
100
+ }
101
+
102
+ /**
103
+ * Configures and creates an Ajv instance.
104
+ */
105
+ private static _instantiateAjv(): Ajv {
106
+ const ajv = addFormats(
107
+ new Ajv({
108
+ // without this not much validation actually happens
109
+ allErrors: true,
110
+ })
111
+ );
112
+ _.forEach(keywords, (keyword) => {
113
+ ajv.addKeyword(keyword);
114
+ });
115
+ return ajv;
116
+ }
117
+
88
118
  /**
89
119
  * Returns `true` if a schema has been registered for extension type/name.
90
120
  */
@@ -109,7 +139,7 @@ class AppiumSchema {
109
139
  /**
110
140
  * Finalizes all registered schemas into Ajv and generates arg-spec lookups.
111
141
  */
112
- finalize(): Readonly<Record<string, StrictSchemaObject>> {
142
+ async finalize(): Promise<Readonly<Record<string, StrictSchemaObject>>> {
113
143
  if (this.isFinalized()) {
114
144
  return this.#finalizedSchemas as Record<string, StrictSchemaObject>;
115
145
  }
@@ -137,27 +167,26 @@ class AppiumSchema {
137
167
 
138
168
  const finalizedSchemas: Record<string, StrictSchemaObject> = {};
139
169
 
140
- const finalSchema = _.reduce(
141
- this.#registeredSchemas,
142
- (base: any, extensionSchemas: Map<string, SchemaObject>, extType: ExtensionType) => {
143
- extensionSchemas.forEach((schema, extName) => {
144
- const $ref = ArgSpec.toSchemaBaseRef(extType, extName);
145
- (schema as any).$id = $ref;
146
- (schema as any).additionalProperties = false;
147
- base.properties.server.properties[extType].properties[extName] = {$ref, $comment: extName};
148
- ajv.validateSchema(schema, true);
149
- addArgSpecs((schema as any).properties, extType, extName);
150
- ajv.addSchema(schema, $ref);
151
- finalizedSchemas[$ref] = schema as StrictSchemaObject;
152
- });
153
- return base;
154
- },
155
- baseSchema
156
- ) as StrictSchemaObject;
170
+ for (const [extType, extensionSchemas] of Object.entries(this.#registeredSchemas) as Array<
171
+ [ExtensionType, Map<string, SchemaObject>]
172
+ >) {
173
+ for (const [extName, schema] of extensionSchemas.entries()) {
174
+ const $ref = ArgSpec.toSchemaBaseRef(extType, extName);
175
+ (schema as any).$id = $ref;
176
+ (schema as any).additionalProperties = false;
177
+ baseSchema.properties.server.properties[extType].properties[extName] = {$ref, $comment: extName};
178
+ await ajv.validateSchema(schema, true);
179
+ addArgSpecs((schema as any).properties, extType, extName);
180
+ ajv.addSchema(schema, $ref);
181
+ finalizedSchemas[$ref] = schema as StrictSchemaObject;
182
+ }
183
+ }
184
+
185
+ const finalSchema = baseSchema as StrictSchemaObject;
157
186
 
158
187
  ajv.addSchema(finalSchema, APPIUM_CONFIG_SCHEMA_ID);
159
188
  finalizedSchemas[APPIUM_CONFIG_SCHEMA_ID] = finalSchema;
160
- ajv.validateSchema(finalSchema, true);
189
+ await ajv.validateSchema(finalSchema, true);
161
190
  this.#finalizedSchemas = finalizedSchemas;
162
191
  return Object.freeze(finalizedSchemas);
163
192
  }
@@ -178,7 +207,7 @@ class AppiumSchema {
178
207
  /**
179
208
  * Registers an extension schema.
180
209
  */
181
- registerSchema(extType: ExtensionType, extName: string, schema: SchemaObject): void {
210
+ async registerSchema(extType: ExtensionType, extName: string, schema: SchemaObject): Promise<void> {
182
211
  if (!(extType && extName) || _.isUndefined(schema)) {
183
212
  throw new TypeError('Expected extension type, extension name, and a defined schema');
184
213
  }
@@ -192,7 +221,7 @@ class AppiumSchema {
192
221
  }
193
222
  throw new SchemaNameConflictError(extType, extName);
194
223
  }
195
- this.#ajv.validateSchema(schema, true);
224
+ await this.#ajv.validateSchema(schema, true);
196
225
  this.#registeredSchemas[extType].set(normalizedExtName, schema);
197
226
  }
198
227
 
@@ -322,36 +351,6 @@ class AppiumSchema {
322
351
  return !validator(value) && _.isArray(validator.errors) ? [...validator.errors] : [];
323
352
  }
324
353
 
325
- /**
326
- * Returns `true` if filename extension is an allowed schema extension.
327
- */
328
- static isAllowedSchemaFileExtension(filename: string): boolean {
329
- return ALLOWED_SCHEMA_EXTENSIONS.has(path.extname(filename) as AllowedSchemaExtension);
330
- }
331
-
332
- /**
333
- * Returns `true` if schema is a plain object and not async.
334
- */
335
- static isSupportedSchemaType(schema: any): schema is SchemaObject {
336
- return _.isPlainObject(schema) && (schema as any).$async !== true;
337
- }
338
-
339
- /**
340
- * Configures and creates an Ajv instance.
341
- */
342
- private static _instantiateAjv(): Ajv {
343
- const ajv = addFormats(
344
- new Ajv({
345
- // without this not much validation actually happens
346
- allErrors: true,
347
- })
348
- );
349
- _.forEach(keywords, (keyword) => {
350
- ajv.addKeyword(keyword);
351
- });
352
- return ajv;
353
- }
354
-
355
354
  /**
356
355
  * Retrieves schema validator function from Ajv.
357
356
  */
package/lib/utils.ts CHANGED
@@ -1,177 +1,8 @@
1
- import type {
2
- BaseDriverCapConstraints,
3
- Capabilities,
4
- Constraints,
5
- NSCapabilities,
6
- W3CCapabilities,
7
- } from '@appium/types';
8
- import type {
9
- Args,
10
- CliCommand,
11
- CliCommandDriver,
12
- CliCommandPlugin,
13
- CliCommandServer,
14
- CliCommandSetup,
15
- CliExtensionCommand,
16
- CliExtensionSubcommand,
17
- CliCommandSetupSubcommand,
18
- } from 'appium/types';
19
1
  import _ from 'lodash';
20
- import logger from './logger';
21
- import {
22
- processCapabilities,
23
- STANDARD_CAPS,
24
- errors,
25
- isW3cCaps,
26
- } from '@appium/base-driver';
27
- import {inspect as dump, type InspectOptions} from 'node:util';
28
2
  import {node, fs} from '@appium/support';
29
- import path from 'node:path';
30
- import {SERVER_SUBCOMMAND, DRIVER_TYPE, PLUGIN_TYPE, SETUP_SUBCOMMAND} from './constants';
31
- import os from 'node:os';
32
3
 
33
- const W3C_APPIUM_PREFIX = 'appium';
34
- const STANDARD_CAPS_LOWERCASE = new Set([...STANDARD_CAPS].map((cap) => cap.toLowerCase()));
35
- export const V4_BROADCAST_IP = '0.0.0.0';
36
- export const V6_BROADCAST_IP = '::';
37
4
  export const npmPackage = fs.readPackageJsonFrom(__dirname);
38
5
 
39
- /** If stdout is a TTY; used for tighter control over log output. */
40
- const isStdoutTTY = process.stdout.isTTY;
41
-
42
- /** Result of successfully parsing W3C capabilities for the inner driver. */
43
- export interface ParsedDriverCaps<C extends Constraints = BaseDriverCapConstraints> {
44
- desiredCaps: Capabilities<C>;
45
- processedW3CCapabilities: W3CCapabilities<C>;
46
- }
47
-
48
- /** Result when capability parsing fails or caps are invalid. */
49
- export interface InvalidCaps<C extends Constraints = BaseDriverCapConstraints> {
50
- error: Error;
51
- desiredCaps?: Capabilities<C>;
52
- processedW3CCapabilities?: W3CCapabilities<C>;
53
- }
54
-
55
- /**
56
- * Creates an error when a session receives non-W3C capabilities.
57
- */
58
- export function makeNonW3cCapsError(): Error {
59
- return new errors.SessionNotCreatedError(
60
- 'Session capabilities format must comply to the W3C standard. Make sure your client is up to date. ' +
61
- 'See https://www.w3.org/TR/webdriver/#new-session for more details.'
62
- );
63
- }
64
-
65
- /**
66
- * Logs a value to the console using the info logger (with util.inspect formatting).
67
- */
68
- export const inspect = _.flow(
69
- _.partialRight(dump as (object: unknown, options: InspectOptions) => string, {
70
- colors: true,
71
- depth: null,
72
- compact: !isStdoutTTY,
73
- }),
74
- (...args: unknown[]) => {
75
- logger.info(...args);
76
- }
77
- );
78
-
79
- /**
80
- * Parses W3C capabilities for the inner driver and applies defaults.
81
- *
82
- * @returns Parsed caps or an invalid result with an error.
83
- */
84
- export function parseCapsForInnerDriver<C extends Constraints = BaseDriverCapConstraints>(
85
- w3cCapabilities: W3CCapabilities<C>,
86
- constraints: C = {} as C,
87
- defaultCapabilities: NSCapabilities<C> = {}
88
- ): ParsedDriverCaps<C> | InvalidCaps<C> {
89
- if (!isW3cCaps(w3cCapabilities)) {
90
- return {error: makeNonW3cCapsError()};
91
- }
92
-
93
- let desiredCaps: Capabilities<C> = {} as Capabilities<C>;
94
- // eslint-disable-next-line prefer-const -- assigned in success path after try
95
- let processedW3CCapabilities: W3CCapabilities<C> | undefined;
96
-
97
- w3cCapabilities = _.cloneDeep(w3cCapabilities);
98
- defaultCapabilities = _.cloneDeep(defaultCapabilities);
99
-
100
- if (!_.isEmpty(defaultCapabilities)) {
101
- for (const [defaultCapKey, defaultCapValue] of _.toPairs(defaultCapabilities)) {
102
- let isCapAlreadySet = false;
103
- for (const firstMatchEntry of w3cCapabilities.firstMatch ?? []) {
104
- if (
105
- _.isPlainObject(firstMatchEntry) &&
106
- _.has(removeAppiumPrefixes(firstMatchEntry as NSCapabilities<C>), removeAppiumPrefix(defaultCapKey))
107
- ) {
108
- isCapAlreadySet = true;
109
- break;
110
- }
111
- }
112
- isCapAlreadySet =
113
- isCapAlreadySet ||
114
- (_.isPlainObject(w3cCapabilities.alwaysMatch) &&
115
- _.has(
116
- removeAppiumPrefixes(w3cCapabilities.alwaysMatch),
117
- removeAppiumPrefix(defaultCapKey)
118
- ));
119
- if (isCapAlreadySet) {
120
- continue;
121
- }
122
-
123
- if (_.isEmpty(w3cCapabilities.firstMatch)) {
124
- w3cCapabilities.firstMatch = [{[defaultCapKey]: defaultCapValue}] as W3CCapabilities<C>['firstMatch'];
125
- } else {
126
- (w3cCapabilities.firstMatch[0] as Record<string, unknown>)[defaultCapKey] = defaultCapValue;
127
- }
128
- }
129
- }
130
-
131
- try {
132
- desiredCaps = processCapabilities(w3cCapabilities, constraints, true) as Capabilities<C>;
133
- } catch (error) {
134
- logger.info(`Could not parse W3C capabilities: ${(error as Error).message}`);
135
- return {
136
- desiredCaps,
137
- processedW3CCapabilities,
138
- error: error as Error,
139
- };
140
- }
141
-
142
- processedW3CCapabilities = {
143
- alwaysMatch: {...insertAppiumPrefixes(desiredCaps)},
144
- firstMatch: [{}],
145
- } as W3CCapabilities<C>;
146
-
147
- return {
148
- desiredCaps,
149
- processedW3CCapabilities,
150
- };
151
- }
152
-
153
- /**
154
- * Prefixes capability keys with `appium:` where appropriate.
155
- */
156
- export function insertAppiumPrefixes<C extends Constraints = BaseDriverCapConstraints>(
157
- caps: Capabilities<C>
158
- ): NSCapabilities<C> {
159
- return _.mapKeys(caps, (_, key) =>
160
- STANDARD_CAPS_LOWERCASE.has(key.toLowerCase()) || key.includes(':')
161
- ? key
162
- : `${W3C_APPIUM_PREFIX}:${key}`
163
- ) as NSCapabilities<C>;
164
- }
165
-
166
- /**
167
- * Removes `appium:` prefix from capability keys.
168
- */
169
- export function removeAppiumPrefixes<C extends Constraints = BaseDriverCapConstraints>(
170
- caps: NSCapabilities<C>
171
- ): Capabilities<C> {
172
- return _.mapKeys(caps, (_, key) => removeAppiumPrefix(key)) as Capabilities<C>;
173
- }
174
-
175
6
  /**
176
7
  * Returns the root directory of the Appium module (memoized).
177
8
  *
@@ -185,152 +16,6 @@ export const getAppiumModuleRoot = _.memoize(function getAppiumModuleRoot(): str
185
16
  return selfRoot;
186
17
  });
187
18
 
188
- /**
189
- * Adjusts NODE_PATH so CJS drivers/plugins can load peer deps. Does not work with ESM.
190
- */
191
- export function adjustNodePath(): void {
192
- let appiumModuleSearchRoot: string;
193
- try {
194
- appiumModuleSearchRoot = path.dirname(getAppiumModuleRoot());
195
- } catch (error) {
196
- logger.warn((error as Error).message);
197
- return;
198
- }
199
-
200
- const refreshRequirePaths = (): boolean => {
201
- try {
202
- // Private API; see https://gist.github.com/branneman/8048520#7-the-hack
203
- (require('node:module') as NodeModuleWithInitPaths).Module._initPaths();
204
- return true;
205
- } catch {
206
- return false;
207
- }
208
- };
209
-
210
- if (!process.env.NODE_PATH) {
211
- process.env.NODE_PATH = appiumModuleSearchRoot;
212
- if (refreshRequirePaths()) {
213
- process.env.APPIUM_OMIT_PEER_DEPS = '1';
214
- } else {
215
- delete process.env.NODE_PATH;
216
- }
217
- return;
218
- }
219
-
220
- const nodePathParts = process.env.NODE_PATH.split(path.delimiter);
221
- if (nodePathParts.includes(appiumModuleSearchRoot)) {
222
- process.env.APPIUM_OMIT_PEER_DEPS = '1';
223
- return;
224
- }
225
-
226
- nodePathParts.push(appiumModuleSearchRoot);
227
- process.env.NODE_PATH = nodePathParts.join(path.delimiter);
228
- if (refreshRequirePaths()) {
229
- process.env.APPIUM_OMIT_PEER_DEPS = '1';
230
- } else {
231
- process.env.NODE_PATH = _.without(nodePathParts, appiumModuleSearchRoot).join(path.delimiter);
232
- }
233
- }
234
-
235
- interface NodeModuleWithInitPaths {
236
- Module: {_initPaths(): void};
237
- }
238
-
239
- /**
240
- * Pulls Appium settings from capabilities (mutates caps). Supports
241
- * `settings[key]: value` and `settings: { key: value }`.
242
- *
243
- * @returns Parsed settings object; empty if none found.
244
- */
245
- export function pullSettings(caps: Record<string, unknown> | null | undefined): Record<string, unknown> {
246
- if (!_.isPlainObject(caps) || _.isEmpty(caps)) {
247
- return {};
248
- }
249
-
250
- const result: Record<string, unknown> = {};
251
- const singleSettings: Record<string, unknown> = {};
252
- for (const [key, value] of _.toPairs(caps)) {
253
- let match: RegExpExecArray | null;
254
- if (/^(s|appium:s)ettings$/.test(key) && _.isPlainObject(value)) {
255
- Object.assign(result, value);
256
- delete caps[key];
257
- } else if ((match = /^(s|appium:s)ettings\[(\S+)\]$/.exec(key))) {
258
- singleSettings[match[2]] = value;
259
- delete caps[key];
260
- }
261
- }
262
- if (!_.isEmpty(singleSettings)) {
263
- Object.assign(result, singleSettings);
264
- }
265
- return result;
266
- }
267
-
268
- type AnyArgs = Args<CliCommand, CliExtensionSubcommand | CliCommandSetupSubcommand | void>;
269
-
270
- /**
271
- * Type guard: args are for the server command.
272
- */
273
- export function isServerCommandArgs(args: AnyArgs): args is Args<CliCommandServer, void> {
274
- return args.subcommand === SERVER_SUBCOMMAND;
275
- }
276
-
277
- /**
278
- * Type guard: args are for the setup command.
279
- */
280
- export function isSetupCommandArgs(
281
- args: AnyArgs
282
- ): args is Args<CliCommandSetup, CliCommandSetupSubcommand> {
283
- return args.subcommand === SETUP_SUBCOMMAND;
284
- }
285
-
286
- /**
287
- * Type guard: args are for an extension command (driver or plugin).
288
- */
289
- export function isExtensionCommandArgs(
290
- args: AnyArgs
291
- ): args is Args<CliExtensionCommand, CliExtensionSubcommand> {
292
- return args.subcommand === DRIVER_TYPE || args.subcommand === PLUGIN_TYPE;
293
- }
294
-
295
- /**
296
- * Type guard: args are for a driver extension command.
297
- */
298
- export function isDriverCommandArgs(
299
- args: AnyArgs
300
- ): args is Args<CliCommandDriver, CliExtensionSubcommand> {
301
- return args.subcommand === DRIVER_TYPE;
302
- }
303
-
304
- /**
305
- * Type guard: args are for a plugin extension command.
306
- */
307
- export function isPluginCommandArgs(
308
- args: AnyArgs
309
- ): args is Args<CliCommandPlugin, CliExtensionSubcommand> {
310
- return args.subcommand === PLUGIN_TYPE;
311
- }
312
-
313
- /**
314
- * Returns network interfaces for the given IP family.
315
- *
316
- * @param family - 4 for IPv4, 6 for IPv6, or null for all.
317
- */
318
- export function fetchInterfaces(
319
- family: 4 | 6 | null = null
320
- ): os.NetworkInterfaceInfo[] {
321
- let familyValue: (4 | 6 | string)[] | null = null;
322
- if (family === 4) {
323
- familyValue = [4, 'IPv4'];
324
- } else if (family === 6) {
325
- familyValue = [6, 'IPv6'];
326
- }
327
- const ifaces = _.values(os.networkInterfaces()).filter(Boolean) as os.NetworkInterfaceInfo[][];
328
- return _.flatMap(ifaces).filter(
329
- (info) => !familyValue || familyValue.includes(info.family as 4 | 6 | string)
330
- );
331
- }
332
-
333
-
334
19
  /**
335
20
  * Adler-32 checksum (see https://github.com/SheetJS/js-adler32).
336
21
  */
@@ -386,19 +71,3 @@ export function adler32(str: string, seed: number | null = null): number {
386
71
  }
387
72
  return ((b % 65521) << 16) | (a % 65521);
388
73
  }
389
-
390
- /**
391
- * Returns true if the address is a broadcast IP (0.0.0.0 or ::).
392
- */
393
- export function isBroadcastIp(address: string): boolean {
394
- return [V4_BROADCAST_IP, V6_BROADCAST_IP, `[${V6_BROADCAST_IP}]`].includes(address);
395
- }
396
-
397
- // #region private helpers
398
-
399
- function removeAppiumPrefix(key: string): string {
400
- const prefix = `${W3C_APPIUM_PREFIX}:`;
401
- return _.startsWith(key, prefix) ? key.substring(prefix.length) : key;
402
- }
403
-
404
- // #endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Automation for Apps.",
5
5
  "keywords": [
6
6
  "automation",
@@ -60,29 +60,28 @@
60
60
  "test:unit": "mocha \"./test/unit/**/*.spec.ts\""
61
61
  },
62
62
  "dependencies": {
63
- "@appium/base-driver": "10.3.0",
64
- "@appium/base-plugin": "3.2.0",
65
- "@appium/docutils": "2.3.0",
66
- "@appium/logger": "2.0.6",
63
+ "@appium/base-driver": "10.4.0",
64
+ "@appium/base-plugin": "3.2.1",
65
+ "@appium/docutils": "2.3.1",
66
+ "@appium/logger": "2.0.7",
67
67
  "@appium/schema": "1.1.0",
68
- "@appium/support": "7.1.0",
69
- "@appium/types": "1.3.0",
70
- "@sidvind/better-ajv-errors": "4.0.1",
68
+ "@appium/support": "7.1.1",
69
+ "@appium/types": "1.3.1",
70
+ "@sidvind/better-ajv-errors": "5.0.0",
71
71
  "ajv": "8.18.0",
72
72
  "ajv-formats": "3.0.1",
73
73
  "argparse": "2.0.1",
74
- "async-lock": "1.4.1",
75
74
  "axios": "1.15.0",
76
75
  "bluebird": "3.7.2",
77
76
  "lilconfig": "3.1.3",
78
77
  "lodash": "4.18.1",
79
- "lru-cache": "11.3.3",
78
+ "lru-cache": "11.3.5",
80
79
  "ora": "5.4.1",
81
80
  "package-changed": "3.0.0",
82
81
  "resolve-from": "5.0.0",
83
82
  "semver": "7.7.4",
84
- "teen_process": "4.1.0",
85
- "type-fest": "5.5.0",
83
+ "teen_process": "4.1.1",
84
+ "type-fest": "5.6.0",
86
85
  "winston": "3.19.0",
87
86
  "ws": "8.20.0",
88
87
  "yaml": "2.8.3"
@@ -94,5 +93,5 @@
94
93
  "publishConfig": {
95
94
  "access": "public"
96
95
  },
97
- "gitHead": "7a8965f5c30ffec2ad04ce75903b3960537cef06"
96
+ "gitHead": "17f84265d10944fec06ae7684ae8ad77d1224b50"
98
97
  }
@@ -98,6 +98,9 @@ async function init() {
98
98
  }
99
99
  }
100
100
 
101
+ /**
102
+ * Installs drivers/plugins requested via npm config vars.
103
+ */
101
104
  async function main() {
102
105
  if (!(await init())) {
103
106
  return;
@@ -1,57 +0,0 @@
1
- import { type IOutputError } from '@sidvind/better-ajv-errors';
2
- import type { ErrorObject } from 'ajv';
3
- import type { AppiumConfig, NormalizedAppiumConfig } from '@appium/types';
4
- /**
5
- * Given an array of errors and the result of loading a config file, generate a
6
- * helpful string for the user.
7
- *
8
- * - If `opts` contains a `json` property, this should be the original JSON
9
- * _string_ of the config file. This is only applicable if the config file
10
- * was in JSON format. If present, it will associate line numbers with errors.
11
- * - If `errors` happens to be empty, this will throw.
12
- *
13
- * @throws {TypeError} If `errors` is empty
14
- */
15
- export declare function formatErrors(errors?: ErrorObject[], config?: ReadConfigFileResult['config'] | Record<string, unknown> | string, opts?: FormatConfigErrorsOptions): string | IOutputError[];
16
- /**
17
- * Given an optional path, read a config file. Validates the config file.
18
- *
19
- * Call {@link validate} if you already have a config object.
20
- * @public
21
- * @returns Contains config and filepath, if found, and any errors
22
- */
23
- export declare function readConfigFile(filepath?: string, opts?: ReadConfigFileOptions): Promise<ReadConfigFileResult>;
24
- /**
25
- * Convert schema property names to either a) the value of the `appiumCliDest` property, if any; or b) camel-case
26
- * @returns New object with camel-cased keys (or `dest` keys).
27
- */
28
- export declare function normalizeConfig(config: AppiumConfig): NormalizedAppiumConfig;
29
- /**
30
- * Result of calling {@link readConfigFile}.
31
- */
32
- export interface ReadConfigFileResult {
33
- errors?: ErrorObject[];
34
- filepath?: string;
35
- isEmpty?: boolean;
36
- config?: NormalizedAppiumConfig;
37
- reason?: string | IOutputError[];
38
- }
39
- /**
40
- * Options for {@link readConfigFile}.
41
- */
42
- export interface ReadConfigFileOptions {
43
- pretty?: boolean;
44
- }
45
- /**
46
- * The string should be a raw JSON string.
47
- */
48
- export type RawJson = string;
49
- /**
50
- * Options for {@link formatErrors}.
51
- */
52
- export interface FormatConfigErrorsOptions {
53
- json?: RawJson;
54
- pretty?: boolean;
55
- schemaId?: string;
56
- }
57
- //# sourceMappingURL=config-file.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../lib/config-file.ts"],"names":[],"mappings":"AAAA,OAAwB,EAAC,KAAK,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAC,WAAW,EAAe,MAAM,KAAK,CAAC;AAInD,OAAO,KAAK,EAAC,YAAY,EAAE,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAUxE;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,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