appium 2.0.0-beta.26 → 2.0.0-beta.29
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.
- package/build/lib/appium.d.ts +215 -0
- package/build/lib/appium.d.ts.map +1 -0
- package/build/lib/appium.js +62 -54
- package/build/lib/cli/args.d.ts +20 -0
- package/build/lib/cli/args.d.ts.map +1 -0
- package/build/lib/cli/args.js +1 -1
- package/build/lib/cli/driver-command.d.ts +36 -0
- package/build/lib/cli/driver-command.d.ts.map +1 -0
- package/build/lib/cli/driver-command.js +8 -7
- package/build/lib/cli/extension-command.d.ts +345 -0
- package/build/lib/cli/extension-command.d.ts.map +1 -0
- package/build/lib/cli/extension-command.js +52 -38
- package/build/lib/cli/extension.d.ts +14 -0
- package/build/lib/cli/extension.d.ts.map +1 -0
- package/build/lib/cli/extension.js +7 -2
- package/build/lib/cli/parser.d.ts +79 -0
- package/build/lib/cli/parser.d.ts.map +1 -0
- package/build/lib/cli/parser.js +1 -1
- package/build/lib/cli/plugin-command.d.ts +39 -0
- package/build/lib/cli/plugin-command.d.ts.map +1 -0
- package/build/lib/cli/plugin-command.js +6 -7
- package/build/lib/cli/utils.d.ts +29 -0
- package/build/lib/cli/utils.d.ts.map +1 -0
- package/build/lib/cli/utils.js +1 -1
- package/build/lib/config-file.d.ts +100 -0
- package/build/lib/config-file.d.ts.map +1 -0
- package/build/lib/config-file.js +1 -1
- package/build/lib/config.d.ts +40 -0
- package/build/lib/config.d.ts.map +1 -0
- package/build/lib/config.js +2 -2
- package/build/lib/constants.d.ts +48 -0
- package/build/lib/constants.d.ts.map +1 -0
- package/build/lib/constants.js +1 -1
- package/build/lib/extension/driver-config.d.ts +84 -0
- package/build/lib/extension/driver-config.d.ts.map +1 -0
- package/build/lib/extension/driver-config.js +1 -1
- package/build/lib/extension/extension-config.d.ts +170 -0
- package/build/lib/extension/extension-config.d.ts.map +1 -0
- package/build/lib/extension/extension-config.js +2 -2
- package/build/lib/extension/index.d.ts +39 -0
- package/build/lib/extension/index.d.ts.map +1 -0
- package/build/lib/extension/index.js +1 -1
- package/build/lib/extension/manifest.d.ts +174 -0
- package/build/lib/extension/manifest.d.ts.map +1 -0
- package/build/lib/extension/manifest.js +1 -1
- package/build/lib/extension/package-changed.d.ts +11 -0
- package/build/lib/extension/package-changed.d.ts.map +1 -0
- package/build/lib/extension/package-changed.js +1 -1
- package/build/lib/extension/plugin-config.d.ts +62 -0
- package/build/lib/extension/plugin-config.d.ts.map +1 -0
- package/build/lib/extension/plugin-config.js +1 -1
- package/build/lib/grid-register.d.ts +10 -0
- package/build/lib/grid-register.d.ts.map +1 -0
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logsink.d.ts +4 -0
- package/build/lib/logsink.d.ts.map +1 -0
- package/build/lib/logsink.js +1 -1
- package/build/lib/main.d.ts +51 -0
- package/build/lib/main.d.ts.map +1 -0
- package/build/lib/main.js +1 -1
- package/build/lib/schema/arg-spec.d.ts +143 -0
- package/build/lib/schema/arg-spec.d.ts.map +1 -0
- package/build/lib/schema/arg-spec.js +1 -1
- package/build/lib/schema/cli-args.d.ts +19 -0
- package/build/lib/schema/cli-args.d.ts.map +1 -0
- package/build/lib/schema/cli-args.js +1 -1
- package/build/lib/schema/cli-transformers.d.ts +5 -0
- package/build/lib/schema/cli-transformers.d.ts.map +1 -0
- package/build/lib/schema/cli-transformers.js +1 -1
- package/build/lib/schema/index.d.ts +3 -0
- package/build/lib/schema/index.d.ts.map +1 -0
- package/build/lib/schema/keywords.d.ts +24 -0
- package/build/lib/schema/keywords.d.ts.map +1 -0
- package/build/lib/schema/keywords.js +1 -1
- package/build/lib/schema/schema.d.ts +259 -0
- package/build/lib/schema/schema.d.ts.map +1 -0
- package/build/lib/schema/schema.js +3 -3
- package/build/lib/utils.d.ts +66 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +6 -4
- package/build/tsconfig.tsbuildinfo +1 -0
- package/lib/appium.js +163 -81
- package/lib/cli/args.js +1 -2
- package/lib/cli/driver-command.js +11 -8
- package/lib/cli/extension-command.js +129 -80
- package/lib/cli/extension.js +13 -3
- package/lib/cli/parser.js +1 -2
- package/lib/cli/plugin-command.js +16 -6
- package/lib/cli/utils.js +1 -1
- package/lib/config-file.js +3 -4
- package/lib/config.js +12 -8
- package/lib/constants.js +0 -1
- package/lib/extension/driver-config.js +31 -12
- package/lib/extension/extension-config.js +21 -22
- package/lib/extension/index.js +1 -2
- package/lib/extension/manifest.js +23 -127
- package/lib/extension/package-changed.js +0 -1
- package/lib/extension/plugin-config.js +9 -7
- package/lib/logsink.js +4 -0
- package/lib/main.js +9 -10
- package/lib/schema/arg-spec.js +10 -6
- package/lib/schema/cli-args.js +0 -1
- package/lib/schema/cli-transformers.js +0 -1
- package/lib/schema/keywords.js +0 -1
- package/lib/schema/schema.js +2 -3
- package/lib/utils.js +49 -16
- package/package.json +12 -14
- package/types/appium-manifest.d.ts +61 -0
- package/types/cli.d.ts +134 -0
- package/types/extension.d.ts +56 -0
- package/types/external-manifest.d.ts +58 -0
- package/types/index.d.ts +7 -0
- package/build/lib/appium-config.schema.json +0 -278
- package/build/lib/schema/appium-config-schema.js +0 -251
- package/lib/schema/appium-config-schema.js +0 -287
- package/types/appium-config.d.ts +0 -197
- package/types/types.d.ts +0 -245
package/types/types.d.ts
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DRIVER_TYPE as DRIVER_SUBCOMMAND,
|
|
3
|
-
EXT_SUBCOMMAND_INSTALL,
|
|
4
|
-
EXT_SUBCOMMAND_UPDATE,
|
|
5
|
-
EXT_SUBCOMMAND_RUN,
|
|
6
|
-
EXT_SUBCOMMAND_LIST,
|
|
7
|
-
EXT_SUBCOMMAND_UNINSTALL,
|
|
8
|
-
PLUGIN_TYPE as PLUGIN_SUBCOMMAND,
|
|
9
|
-
SERVER_SUBCOMMAND,
|
|
10
|
-
} from '../lib/constants';
|
|
11
|
-
import appiumConfigSchema from '../lib/schema/appium-config-schema';
|
|
12
|
-
import {transformers} from '../lib/schema/cli-transformers';
|
|
13
|
-
import {AppiumConfiguration, ServerConfig} from './appium-config';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Converts a kebab-cased string into a camel-cased string.
|
|
17
|
-
*/
|
|
18
|
-
export type KebabToCamel<S extends string> =
|
|
19
|
-
S extends `${infer P1}-${infer P2}${infer P3}`
|
|
20
|
-
? `${Lowercase<P1>}${Uppercase<P2>}${KebabToCamel<P3>}`
|
|
21
|
-
: Lowercase<S>;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Converts an object with kebab-cased keys into camel-cased keys.
|
|
25
|
-
*/
|
|
26
|
-
type ObjectToCamel<T> = {
|
|
27
|
-
[K in keyof T as KebabToCamel<string & K>]: T[K] extends Record<string, any>
|
|
28
|
-
? KeysToCamelCase<T[K]>
|
|
29
|
-
: T[K];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Converts an object or array to have camel-cased keys.
|
|
34
|
-
*/
|
|
35
|
-
export type KeysToCamelCase<T> = {
|
|
36
|
-
[K in keyof T as KebabToCamel<string & K>]: T[K] extends Array<any>
|
|
37
|
-
? KeysToCamelCase<T[K][number]>[]
|
|
38
|
-
: ObjectToCamel<T[K]>;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The Appium configuration as it would be in a configuration file.
|
|
43
|
-
*/
|
|
44
|
-
export type AppiumConfig = Partial<AppiumConfiguration>;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Certain properties have an `appiumCliDest` prop, which affects the shape of
|
|
48
|
-
* {@link ParsedArgs}. This type helps recognize these properties.
|
|
49
|
-
*
|
|
50
|
-
* See `../lib/schema/keywords` for definition of `appiumCliDest`.
|
|
51
|
-
*/
|
|
52
|
-
interface WithDest {
|
|
53
|
-
appiumCliDest: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Some properties have a `default` prop, which means practically they will not
|
|
58
|
-
* be `undefined` upon parsing.
|
|
59
|
-
*
|
|
60
|
-
* We use this to ensure that the {@link ParsedArgs} makes guarantees
|
|
61
|
-
* about the presence of properties.
|
|
62
|
-
*/
|
|
63
|
-
interface WithDefault {
|
|
64
|
-
default: any;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface WithCliTransformer {
|
|
68
|
-
appiumCliTransformer: keyof typeof transformers;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
interface WithTypeArray {
|
|
72
|
-
type: 'array';
|
|
73
|
-
}
|
|
74
|
-
interface WithTypeObject {
|
|
75
|
-
type: 'object';
|
|
76
|
-
}
|
|
77
|
-
type WithTransformer = WithCliTransformer | WithTypeArray | WithTypeObject;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Derive the "constant" type of the server properties from the schema.
|
|
81
|
-
*/
|
|
82
|
-
type AppiumServerSchema =
|
|
83
|
-
typeof appiumConfigSchema['properties']['server']['properties'];
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Properties of `T` with keys `appiumCliDest` prop _or_ just camel-cased.
|
|
87
|
-
*/
|
|
88
|
-
type NormalizedServerConfig = {
|
|
89
|
-
[Prop in keyof ServerConfigMapping as AppiumServerSchema[Prop] extends WithDest
|
|
90
|
-
? AppiumServerSchema[Prop]['appiumCliDest']
|
|
91
|
-
: KebabToCamel<Prop>]: ServerConfig[Prop];
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* "Normalized" config, which is like the flattened config (camel-cased keys),
|
|
96
|
-
* but not flattened.
|
|
97
|
-
*/
|
|
98
|
-
export type NormalizedAppiumConfig = {
|
|
99
|
-
server: NormalizedServerConfig;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Utility type to associate {@link AppiumServerSchema} with
|
|
104
|
-
* {@link ServerConfig}.
|
|
105
|
-
*/
|
|
106
|
-
type ServerConfigMapping = {
|
|
107
|
-
[Prop in keyof Required<ServerConfig>]: AppiumServerSchema[Prop];
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* This type checks if `appiumCliDest` is present in the object via
|
|
112
|
-
* {@link WithDest}, and uses the _value_ of that property for the key name;
|
|
113
|
-
* otherwise uses the camel-cased value of the key name.
|
|
114
|
-
*/
|
|
115
|
-
type SetKeyForProp<Prop extends keyof ServerConfigMapping> =
|
|
116
|
-
AppiumServerSchema[Prop] extends WithDest
|
|
117
|
-
? AppiumServerSchema[Prop]['appiumCliDest']
|
|
118
|
-
: KebabToCamel<Prop>;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Checks for the existence of default values, and ensures those properties will
|
|
122
|
-
* be defined (eliminate `| undefined` from the type).
|
|
123
|
-
*/
|
|
124
|
-
type DefaultForProp<Prop extends keyof ServerConfigMapping> =
|
|
125
|
-
AppiumServerSchema[Prop] extends WithDefault
|
|
126
|
-
? NonNullable<ServerConfig[Prop]>
|
|
127
|
-
: ServerConfig[Prop];
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* The final shape of the parsed CLI arguments.
|
|
131
|
-
*/
|
|
132
|
-
type ArgsFromConfig = {
|
|
133
|
-
[Prop in keyof ServerConfigMapping as SetKeyForProp<Prop>]: DefaultForProp<Prop>;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Possible subcommands for the `appium` CLI.
|
|
138
|
-
*/
|
|
139
|
-
type CliSubcommand =
|
|
140
|
-
| typeof SERVER_SUBCOMMAND
|
|
141
|
-
| typeof DRIVER_SUBCOMMAND
|
|
142
|
-
| typeof PLUGIN_SUBCOMMAND;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Possible subcommands of {@link DRIVER_SUBCOMMAND} or
|
|
146
|
-
* {@link PLUGIN_SUBCOMMAND}.
|
|
147
|
-
*/
|
|
148
|
-
export type CliExtensionSubcommand =
|
|
149
|
-
| typeof EXT_SUBCOMMAND_INSTALL
|
|
150
|
-
| typeof EXT_SUBCOMMAND_LIST
|
|
151
|
-
| typeof EXT_SUBCOMMAND_RUN
|
|
152
|
-
| typeof EXT_SUBCOMMAND_UPDATE
|
|
153
|
-
| typeof EXT_SUBCOMMAND_UNINSTALL;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Random stuff that may appear in the parsed args which has no equivalent in a
|
|
157
|
-
* config file.
|
|
158
|
-
*/
|
|
159
|
-
interface MoreArgs {
|
|
160
|
-
/**
|
|
161
|
-
* Path to config file, if any. Does not make sense for this to be allowed in a config file!
|
|
162
|
-
*/
|
|
163
|
-
configFile?: string;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* If true, show the config and exit
|
|
167
|
-
*/
|
|
168
|
-
showConfig?: boolean;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* If true, open a REPL
|
|
172
|
-
*/
|
|
173
|
-
shell?: boolean;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* These arguments are _not_ supported by the CLI, but only via programmatic usage / tests.
|
|
178
|
-
*/
|
|
179
|
-
interface ProgrammaticArgs {
|
|
180
|
-
/**
|
|
181
|
-
* Subcommands of `driver` subcommand
|
|
182
|
-
*/
|
|
183
|
-
driverCommand?: CliExtensionSubcommand;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Subcommands of `plugin` subcommand
|
|
187
|
-
*/
|
|
188
|
-
pluginCommand?: CliExtensionSubcommand;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* If true, throw on error instead of exit.
|
|
192
|
-
*/
|
|
193
|
-
throwInsteadOfExit?: boolean;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Seems to only be used in tests or standalone driver calls
|
|
197
|
-
*/
|
|
198
|
-
logHandler?: (...args: any[]) => void;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Alternate way to set `APPIUM_HOME` for tests. Since we don't want to muck about
|
|
202
|
-
* with the environment, we just set it here.
|
|
203
|
-
*/
|
|
204
|
-
appiumHome?: string;
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* If true, show the build info and exit
|
|
208
|
-
*/
|
|
209
|
-
showBuildInfo: boolean;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* If true, show config and exit
|
|
213
|
-
*/
|
|
214
|
-
showConfig: boolean;
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
interface SubcommandArgs {
|
|
219
|
-
/**
|
|
220
|
-
* Possible subcommands
|
|
221
|
-
*/
|
|
222
|
-
subcommand:
|
|
223
|
-
| typeof DRIVER_SUBCOMMAND
|
|
224
|
-
| typeof PLUGIN_SUBCOMMAND
|
|
225
|
-
| typeof SERVER_SUBCOMMAND;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* The same as {@link ParsedArgs} but with a nullable `subcommand`.
|
|
230
|
-
*/
|
|
231
|
-
export type PartialArgs = ArgsFromConfig &
|
|
232
|
-
MoreArgs &
|
|
233
|
-
ProgrammaticArgs &
|
|
234
|
-
Partial<SubcommandArgs>;
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* The Appium configuration as a flattened object, parsed via CLI args _and_ any
|
|
238
|
-
* CLI args unsupported by the config file.
|
|
239
|
-
* @todo Does not make any assumptions about property names derived from
|
|
240
|
-
* extensions.
|
|
241
|
-
*/
|
|
242
|
-
export type ParsedArgs = ArgsFromConfig &
|
|
243
|
-
MoreArgs &
|
|
244
|
-
ProgrammaticArgs &
|
|
245
|
-
SubcommandArgs;
|