appium 2.0.0-beta.19 → 2.0.0-beta.22

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 (105) hide show
  1. package/build/check-npm-pack-files.js +23 -0
  2. package/build/commands-yml/parse.js +319 -0
  3. package/build/commands-yml/validator.js +130 -0
  4. package/build/index.js +19 -0
  5. package/build/lib/appium-config.schema.json +0 -0
  6. package/build/lib/appium.js +84 -69
  7. package/build/lib/cli/args.js +87 -223
  8. package/build/lib/cli/extension-command.js +2 -2
  9. package/build/lib/cli/extension.js +14 -6
  10. package/build/lib/cli/parser.js +146 -106
  11. package/build/lib/config-file.js +141 -0
  12. package/build/lib/config.js +28 -77
  13. package/build/lib/driver-config.js +41 -20
  14. package/build/lib/ext-config-io.js +165 -0
  15. package/build/lib/extension-config.js +110 -60
  16. package/build/lib/grid-register.js +19 -21
  17. package/build/lib/main.js +135 -72
  18. package/build/lib/plugin-config.js +18 -9
  19. package/build/lib/schema/appium-config-schema.js +253 -0
  20. package/build/lib/schema/arg-spec.js +120 -0
  21. package/build/lib/schema/cli-args.js +188 -0
  22. package/build/lib/schema/cli-transformers.js +76 -0
  23. package/build/lib/schema/index.js +36 -0
  24. package/build/lib/schema/keywords.js +72 -0
  25. package/build/lib/schema/schema.js +357 -0
  26. package/build/lib/utils.js +24 -33
  27. package/build/postinstall.js +90 -0
  28. package/build/test/cli/cli-e2e-specs.js +221 -0
  29. package/build/test/cli/cli-helpers.js +86 -0
  30. package/build/test/cli/cli-specs.js +71 -0
  31. package/build/test/cli/fixtures/test-driver/package.json +27 -0
  32. package/build/test/cli/schema-args-specs.js +48 -0
  33. package/build/test/cli/schema-e2e-specs.js +47 -0
  34. package/build/test/config-e2e-specs.js +112 -0
  35. package/build/test/config-file-e2e-specs.js +209 -0
  36. package/build/test/config-file-specs.js +281 -0
  37. package/build/test/config-specs.js +159 -0
  38. package/build/test/driver-e2e-specs.js +435 -0
  39. package/build/test/driver-specs.js +321 -0
  40. package/build/test/ext-config-io-specs.js +181 -0
  41. package/build/test/extension-config-specs.js +365 -0
  42. package/build/test/fixtures/allow-feat.txt +5 -0
  43. package/build/test/fixtures/caps.json +3 -0
  44. package/build/test/fixtures/config/allow-insecure.txt +3 -0
  45. package/build/test/fixtures/config/appium.config.bad-nodeconfig.json +5 -0
  46. package/build/test/fixtures/config/appium.config.bad.json +32 -0
  47. package/build/test/fixtures/config/appium.config.ext-good.json +9 -0
  48. package/build/test/fixtures/config/appium.config.ext-unknown-props.json +10 -0
  49. package/build/test/fixtures/config/appium.config.good.js +40 -0
  50. package/build/test/fixtures/config/appium.config.good.json +33 -0
  51. package/build/test/fixtures/config/appium.config.good.yaml +30 -0
  52. package/build/test/fixtures/config/appium.config.invalid.json +31 -0
  53. package/build/test/fixtures/config/appium.config.security-array.json +5 -0
  54. package/build/test/fixtures/config/appium.config.security-delimited.json +5 -0
  55. package/build/test/fixtures/config/appium.config.security-path.json +5 -0
  56. package/build/test/fixtures/config/driver-fake.config.json +8 -0
  57. package/build/test/fixtures/config/nodeconfig.json +3 -0
  58. package/build/test/fixtures/config/plugin-fake.config.json +0 -0
  59. package/build/test/fixtures/default-args.js +35 -0
  60. package/build/test/fixtures/deny-feat.txt +5 -0
  61. package/build/test/fixtures/driver.schema.js +20 -0
  62. package/build/test/fixtures/extensions.yaml +27 -0
  63. package/build/test/fixtures/flattened-schema.js +504 -0
  64. package/build/test/fixtures/plugin.schema.js +20 -0
  65. package/build/test/fixtures/schema-with-extensions.js +28 -0
  66. package/build/test/grid-register-specs.js +74 -0
  67. package/build/test/helpers.js +75 -0
  68. package/build/test/logger-specs.js +76 -0
  69. package/build/test/npm-specs.js +20 -0
  70. package/build/test/parser-specs.js +314 -0
  71. package/build/test/plugin-e2e-specs.js +316 -0
  72. package/build/test/schema/arg-spec-specs.js +70 -0
  73. package/build/test/schema/cli-args-specs.js +431 -0
  74. package/build/test/schema/schema-specs.js +389 -0
  75. package/build/test/utils-specs.js +266 -0
  76. package/index.js +11 -0
  77. package/lib/appium-config.schema.json +278 -0
  78. package/lib/appium.js +99 -75
  79. package/lib/cli/args.js +138 -335
  80. package/lib/cli/extension-command.js +7 -6
  81. package/lib/cli/extension.js +12 -4
  82. package/lib/cli/parser.js +251 -96
  83. package/lib/config-file.js +227 -0
  84. package/lib/config.js +63 -79
  85. package/lib/driver-config.js +66 -11
  86. package/lib/ext-config-io.js +287 -0
  87. package/lib/extension-config.js +209 -66
  88. package/lib/grid-register.js +24 -21
  89. package/lib/main.js +145 -71
  90. package/lib/plugin-config.js +33 -3
  91. package/lib/schema/appium-config-schema.js +287 -0
  92. package/lib/schema/arg-spec.js +222 -0
  93. package/lib/schema/cli-args.js +285 -0
  94. package/lib/schema/cli-transformers.js +123 -0
  95. package/lib/schema/index.js +2 -0
  96. package/lib/schema/keywords.js +135 -0
  97. package/lib/schema/schema.js +577 -0
  98. package/lib/utils.js +29 -52
  99. package/package.json +17 -16
  100. package/types/appium-config.d.ts +197 -0
  101. package/types/types.d.ts +201 -0
  102. package/build/lib/cli/argparse-actions.js +0 -104
  103. package/build/lib/cli/parser-helpers.js +0 -106
  104. package/lib/cli/argparse-actions.js +0 -77
  105. package/lib/cli/parser-helpers.js +0 -106
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium",
3
- "version": "2.0.0-beta.19",
3
+ "version": "2.0.0-beta.22",
4
4
  "description": "Automation for Apps.",
5
5
  "keywords": [
6
6
  "automation",
@@ -21,9 +21,8 @@
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "author": "https://github.com/appium",
24
- "main": "./build/lib/main.js",
25
24
  "bin": {
26
- "appium": "./build/lib/main.js"
25
+ "appium": "index.js"
27
26
  },
28
27
  "directories": {
29
28
  "lib": "./lib"
@@ -31,22 +30,26 @@
31
30
  "files": [
32
31
  "bin",
33
32
  "lib",
34
- "build/lib",
35
- "postinstall.js"
33
+ "build",
34
+ "index.js",
35
+ "postinstall.js",
36
+ "types"
36
37
  ],
37
38
  "scripts": {
38
39
  "generate-docs": "gulp transpile && node ./build/commands-yml/parse.js",
39
40
  "postinstall": "node ./postinstall.js",
40
- "install-fake-driver": "node . driver install --source=local ../fake-driver",
41
41
  "upload": "gulp github-upload",
42
42
  "zip": "zip -qr appium.zip .",
43
43
  "zip-and-upload": "npm run zip && npm run upload"
44
44
  },
45
45
  "dependencies": {
46
- "@appium/base-driver": "^8.1.2",
47
- "@appium/base-plugin": "1.7.2",
48
- "@appium/support": "^2.55.0",
49
- "@babel/runtime": "7.16.0",
46
+ "@appium/base-driver": "^8.2.1",
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.1",
52
+ "ajv-formats": "2.1.1",
50
53
  "argparse": "2.0.1",
51
54
  "async-lock": "1.3.0",
52
55
  "asyncbox": "2.9.2",
@@ -54,21 +57,19 @@
54
57
  "bluebird": "3.7.2",
55
58
  "continuation-local-storage": "3.2.1",
56
59
  "find-up": "5.0.0",
60
+ "lilconfig": "2.0.4",
57
61
  "lodash": "4.17.21",
58
62
  "longjohn": "0.2.12",
59
63
  "npmlog": "5.0.1",
60
64
  "ora": "5.4.1",
65
+ "resolve-from": "5.0.0",
61
66
  "semver": "7.3.5",
62
- "source-map-support": "0.5.20",
67
+ "source-map-support": "0.5.21",
63
68
  "teen_process": "1.16.0",
64
69
  "winston": "3.3.3",
65
70
  "word-wrap": "1.2.3",
66
71
  "yaml": "1.10.2"
67
72
  },
68
- "devDependencies": {
69
- "@appium/fake-driver": "^3.1.0",
70
- "@appium/gulp-plugins": "^5.5.4"
71
- },
72
73
  "engines": {
73
74
  "node": ">=12",
74
75
  "npm": ">=6"
@@ -78,5 +79,5 @@
78
79
  "tag": "next"
79
80
  },
80
81
  "homepage": "https://appium.io",
81
- "gitHead": "71357e52e1b6211241975ca349411f2df92628fc"
82
+ "gitHead": "e36a70105880b845e99e2c8a958403f6253f45b6"
82
83
  }
@@ -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
+ }
@@ -0,0 +1,201 @@
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
+ showConfig: boolean;
164
+
165
+ /**
166
+ * If true, open a REPL
167
+ */
168
+ shell: boolean;
169
+
170
+ /**
171
+ * If true, throw on error instead of exit. Not supported via CLI, but rather
172
+ * only programmatic usage.
173
+ */
174
+ throwInsteadOfExit: boolean;
175
+
176
+ /**
177
+ * Possible subcommands
178
+ */
179
+ subcommand:
180
+ | typeof DRIVER_SUBCOMMAND
181
+ | typeof PLUGIN_SUBCOMMAND
182
+ | typeof SERVER_SUBCOMMAND;
183
+
184
+ /**
185
+ * Subcommands of `driver` subcommand
186
+ */
187
+ driverCommand: CliExtensionSubcommands;
188
+
189
+ /**
190
+ * Subcommands of `plugin` subcommand
191
+ */
192
+ pluginCommand: CliExtensionSubcommands;
193
+ }
194
+
195
+ /**
196
+ * The Appium configuration as a flattened object, parsed via CLI args _and_ any
197
+ * CLI args unsupported by the config file.
198
+ * @todo Does not make any assumptions about property names derived from
199
+ * extensions.
200
+ */
201
+ export type ParsedArgs = ParsedArgsFromConfig & Partial<MoreArgs>;
@@ -1,104 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.StoreDeprecatedTrueAction = exports.StoreDeprecatedDefaultCapabilityTrueAction = exports.StoreDeprecatedDefaultCapabilityAction = exports.StoreDeprecatedAction = exports.DEFAULT_CAPS_ARG = void 0;
7
-
8
- require("source-map-support/register");
9
-
10
- var _argparse = require("argparse");
11
-
12
- const DEFAULT_CAPS_ARG = '--default-capabilities';
13
- exports.DEFAULT_CAPS_ARG = DEFAULT_CAPS_ARG;
14
-
15
- class StoreDeprecatedAction extends _argparse.Action {
16
- constructor(options = {}) {
17
- const opts = Object.assign({}, options);
18
- let helpPrefix = '[DEPRECATED]';
19
-
20
- if (opts.deprecated_for) {
21
- helpPrefix = `[DEPRECATED, use ${opts.deprecated_for} instead]`;
22
- delete opts.deprecated_for;
23
- }
24
-
25
- if (opts.help) {
26
- opts.help = `${helpPrefix} - ${opts.help}`;
27
- } else {
28
- opts.help = helpPrefix;
29
- }
30
-
31
- super(opts);
32
- }
33
-
34
- call(parser, namespace, values) {
35
- namespace[this.dest] = values;
36
- }
37
-
38
- }
39
-
40
- exports.StoreDeprecatedAction = StoreDeprecatedAction;
41
-
42
- class StoreDeprecatedTrueAction extends StoreDeprecatedAction {
43
- constructor(options = {}) {
44
- super(Object.assign({}, options, {
45
- const: true,
46
- nargs: 0
47
- }));
48
- }
49
-
50
- call(parser, namespace) {
51
- namespace[this.dest] = this.const;
52
- }
53
-
54
- }
55
-
56
- exports.StoreDeprecatedTrueAction = StoreDeprecatedTrueAction;
57
-
58
- class StoreDeprecatedDefaultCapabilityAction extends StoreDeprecatedAction {
59
- constructor(options = {}) {
60
- super(Object.assign({}, options, {
61
- deprecated_for: DEFAULT_CAPS_ARG
62
- }));
63
- }
64
-
65
- _writeDefaultCap(namespace, value) {
66
- namespace[this.dest] = value;
67
-
68
- if (value === this.default) {
69
- return;
70
- }
71
-
72
- if (!namespace.defaultCapabilities) {
73
- namespace.defaultCapabilities = {};
74
- }
75
-
76
- namespace.defaultCapabilities[this.dest] = value;
77
- }
78
-
79
- call(parser, namespace, values) {
80
- this._writeDefaultCap(namespace, values);
81
- }
82
-
83
- }
84
-
85
- exports.StoreDeprecatedDefaultCapabilityAction = StoreDeprecatedDefaultCapabilityAction;
86
-
87
- class StoreDeprecatedDefaultCapabilityTrueAction extends StoreDeprecatedDefaultCapabilityAction {
88
- constructor(options = {}) {
89
- super(Object.assign({}, options, {
90
- const: true,
91
- nargs: 0
92
- }));
93
- }
94
-
95
- call(parser, namespace) {
96
- this._writeDefaultCap(namespace, this.const);
97
- }
98
-
99
- }
100
-
101
- exports.StoreDeprecatedDefaultCapabilityTrueAction = StoreDeprecatedDefaultCapabilityTrueAction;require('source-map-support').install();
102
-
103
-
104
- //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9jbGkvYXJncGFyc2UtYWN0aW9ucy5qcyJdLCJuYW1lcyI6WyJERUZBVUxUX0NBUFNfQVJHIiwiU3RvcmVEZXByZWNhdGVkQWN0aW9uIiwiQWN0aW9uIiwiY29uc3RydWN0b3IiLCJvcHRpb25zIiwib3B0cyIsIk9iamVjdCIsImFzc2lnbiIsImhlbHBQcmVmaXgiLCJkZXByZWNhdGVkX2ZvciIsImhlbHAiLCJjYWxsIiwicGFyc2VyIiw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