appium 3.2.2 → 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.
- package/build/lib/appium.d.ts +147 -205
- package/build/lib/appium.d.ts.map +1 -1
- package/build/lib/appium.js +169 -282
- package/build/lib/appium.js.map +1 -1
- package/build/lib/bidi-commands.d.ts.map +1 -1
- package/build/lib/bidi-commands.js +11 -11
- package/build/lib/bidi-commands.js.map +1 -1
- package/build/lib/bootstrap/appium-initializer.d.ts +21 -0
- package/build/lib/bootstrap/appium-initializer.d.ts.map +1 -0
- package/build/lib/bootstrap/appium-initializer.js +146 -0
- package/build/lib/bootstrap/appium-initializer.js.map +1 -0
- package/build/lib/bootstrap/appium-main-runner.d.ts +22 -0
- package/build/lib/bootstrap/appium-main-runner.d.ts.map +1 -0
- package/build/lib/bootstrap/appium-main-runner.js +109 -0
- package/build/lib/bootstrap/appium-main-runner.js.map +1 -0
- package/build/lib/bootstrap/config-file.d.ts +37 -0
- package/build/lib/bootstrap/config-file.d.ts.map +1 -0
- package/build/lib/{config-file.js → bootstrap/config-file.js} +62 -138
- package/build/lib/bootstrap/config-file.js.map +1 -0
- package/build/lib/bootstrap/grid-v3-register.d.ts +20 -0
- package/build/lib/bootstrap/grid-v3-register.d.ts.map +1 -0
- package/build/lib/bootstrap/grid-v3-register.js +185 -0
- package/build/lib/bootstrap/grid-v3-register.js.map +1 -0
- package/build/lib/bootstrap/init-types.d.ts +16 -0
- package/build/lib/bootstrap/init-types.d.ts.map +1 -0
- package/build/lib/bootstrap/init-types.js +3 -0
- package/build/lib/bootstrap/init-types.js.map +1 -0
- package/build/lib/bootstrap/main-helpers.d.ts +55 -0
- package/build/lib/bootstrap/main-helpers.d.ts.map +1 -0
- package/build/lib/bootstrap/main-helpers.js +187 -0
- package/build/lib/bootstrap/main-helpers.js.map +1 -0
- package/build/lib/bootstrap/node-helpers.d.ts +32 -0
- package/build/lib/bootstrap/node-helpers.d.ts.map +1 -0
- package/build/lib/bootstrap/node-helpers.js +201 -0
- package/build/lib/bootstrap/node-helpers.js.map +1 -0
- package/build/lib/bootstrap/startup-config.d.ts +22 -0
- package/build/lib/bootstrap/startup-config.d.ts.map +1 -0
- package/build/lib/bootstrap/startup-config.js +111 -0
- package/build/lib/bootstrap/startup-config.js.map +1 -0
- package/build/lib/cli/args.d.ts +16 -12
- package/build/lib/cli/args.d.ts.map +1 -1
- package/build/lib/cli/args.js +20 -40
- package/build/lib/cli/args.js.map +1 -1
- package/build/lib/cli/driver-command.d.ts +51 -93
- package/build/lib/cli/driver-command.d.ts.map +1 -1
- package/build/lib/cli/driver-command.js +11 -66
- package/build/lib/cli/driver-command.js.map +1 -1
- package/build/lib/cli/extension-command.d.ts +173 -377
- package/build/lib/cli/extension-command.d.ts.map +1 -1
- package/build/lib/cli/extension-command.js +387 -656
- package/build/lib/cli/extension-command.js.map +1 -1
- package/build/lib/cli/extension.d.ts +10 -15
- package/build/lib/cli/extension.d.ts.map +1 -1
- package/build/lib/cli/extension.js +15 -33
- package/build/lib/cli/extension.js.map +1 -1
- package/build/lib/cli/parser.d.ts +37 -66
- package/build/lib/cli/parser.d.ts.map +1 -1
- package/build/lib/cli/parser.js +69 -104
- package/build/lib/cli/parser.js.map +1 -1
- package/build/lib/cli/plugin-command.d.ts +50 -90
- package/build/lib/cli/plugin-command.d.ts.map +1 -1
- package/build/lib/cli/plugin-command.js +11 -63
- package/build/lib/cli/plugin-command.js.map +1 -1
- package/build/lib/cli/setup-command.d.ts +21 -26
- package/build/lib/cli/setup-command.d.ts.map +1 -1
- package/build/lib/cli/setup-command.js +19 -61
- package/build/lib/cli/setup-command.js.map +1 -1
- package/build/lib/cli/utils.d.ts +33 -35
- package/build/lib/cli/utils.d.ts.map +1 -1
- package/build/lib/cli/utils.js +48 -50
- package/build/lib/cli/utils.js.map +1 -1
- package/build/lib/constants.d.ts +23 -23
- package/build/lib/constants.d.ts.map +1 -1
- package/build/lib/constants.js +10 -15
- package/build/lib/constants.js.map +1 -1
- package/build/lib/doctor/doctor.d.ts +40 -57
- package/build/lib/doctor/doctor.d.ts.map +1 -1
- package/build/lib/doctor/doctor.js +31 -62
- package/build/lib/doctor/doctor.js.map +1 -1
- package/build/lib/extension/driver-config.d.ts +18 -77
- package/build/lib/extension/driver-config.d.ts.map +1 -1
- package/build/lib/extension/driver-config.js +37 -125
- package/build/lib/extension/driver-config.js.map +1 -1
- package/build/lib/extension/extension-config.d.ts +103 -210
- package/build/lib/extension/extension-config.d.ts.map +1 -1
- package/build/lib/extension/extension-config.js +180 -342
- package/build/lib/extension/extension-config.js.map +1 -1
- package/build/lib/extension/index.d.ts +12 -29
- package/build/lib/extension/index.d.ts.map +1 -1
- package/build/lib/extension/index.js +33 -75
- package/build/lib/extension/index.js.map +1 -1
- package/build/lib/extension/manifest-migrations.d.ts +3 -20
- package/build/lib/extension/manifest-migrations.d.ts.map +1 -1
- package/build/lib/extension/manifest-migrations.js +20 -101
- package/build/lib/extension/manifest-migrations.js.map +1 -1
- package/build/lib/extension/manifest.d.ts +61 -107
- package/build/lib/extension/manifest.d.ts.map +1 -1
- package/build/lib/extension/manifest.js +181 -356
- package/build/lib/extension/manifest.js.map +1 -1
- package/build/lib/extension/package-changed.d.ts +1 -3
- package/build/lib/extension/package-changed.d.ts.map +1 -1
- package/build/lib/extension/package-changed.js +8 -15
- package/build/lib/extension/package-changed.js.map +1 -1
- package/build/lib/extension/plugin-config.d.ts +10 -52
- package/build/lib/extension/plugin-config.d.ts.map +1 -1
- package/build/lib/extension/plugin-config.js +11 -63
- package/build/lib/extension/plugin-config.js.map +1 -1
- package/build/lib/helpers/build.d.ts +22 -0
- package/build/lib/helpers/build.d.ts.map +1 -0
- package/build/lib/helpers/build.js +109 -0
- package/build/lib/helpers/build.js.map +1 -0
- package/build/lib/helpers/capability.d.ts +38 -0
- package/build/lib/helpers/capability.d.ts.map +1 -0
- package/build/lib/helpers/capability.js +128 -0
- package/build/lib/helpers/capability.js.map +1 -0
- package/build/lib/helpers/network.d.ts +14 -0
- package/build/lib/helpers/network.d.ts.map +1 -0
- package/build/lib/helpers/network.js +35 -0
- package/build/lib/helpers/network.js.map +1 -0
- package/build/lib/insecure-features.js +6 -6
- package/build/lib/insecure-features.js.map +1 -1
- package/build/lib/inspector-commands.d.ts +6 -0
- package/build/lib/inspector-commands.d.ts.map +1 -1
- package/build/lib/inspector-commands.js +6 -0
- package/build/lib/inspector-commands.js.map +1 -1
- package/build/lib/logger.d.ts +2 -3
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +2 -3
- package/build/lib/logger.js.map +1 -1
- package/build/lib/logsink.d.ts +13 -22
- package/build/lib/logsink.d.ts.map +1 -1
- package/build/lib/logsink.js +48 -103
- package/build/lib/logsink.js.map +1 -1
- package/build/lib/main.d.ts +15 -58
- package/build/lib/main.d.ts.map +1 -1
- package/build/lib/main.js +25 -425
- package/build/lib/main.js.map +1 -1
- package/build/lib/schema/arg-spec.d.ts +32 -107
- package/build/lib/schema/arg-spec.d.ts.map +1 -1
- package/build/lib/schema/arg-spec.js +11 -107
- package/build/lib/schema/arg-spec.js.map +1 -1
- package/build/lib/schema/cli-args-guards.d.ts +34 -0
- package/build/lib/schema/cli-args-guards.d.ts.map +1 -0
- package/build/lib/schema/cli-args-guards.js +49 -0
- package/build/lib/schema/cli-args-guards.js.map +1 -0
- package/build/lib/schema/cli-args.d.ts +3 -15
- package/build/lib/schema/cli-args.d.ts.map +1 -1
- package/build/lib/schema/cli-args.js +17 -107
- package/build/lib/schema/cli-args.js.map +1 -1
- package/build/lib/schema/cli-transformers.d.ts +15 -12
- package/build/lib/schema/cli-transformers.d.ts.map +1 -1
- package/build/lib/schema/cli-transformers.js +15 -45
- package/build/lib/schema/cli-transformers.js.map +1 -1
- package/build/lib/schema/format-errors.d.ts +28 -0
- package/build/lib/schema/format-errors.d.ts.map +1 -0
- package/build/lib/schema/format-errors.js +29 -0
- package/build/lib/schema/format-errors.js.map +1 -0
- package/build/lib/schema/index.d.ts +4 -2
- package/build/lib/schema/index.d.ts.map +1 -1
- package/build/lib/schema/index.js +2 -0
- package/build/lib/schema/index.js.map +1 -1
- package/build/lib/schema/keywords.d.ts +12 -20
- package/build/lib/schema/keywords.d.ts.map +1 -1
- package/build/lib/schema/keywords.js +6 -51
- package/build/lib/schema/keywords.js.map +1 -1
- package/build/lib/schema/schema.d.ts +106 -231
- package/build/lib/schema/schema.d.ts.map +1 -1
- package/build/lib/schema/schema.js +88 -358
- package/build/lib/schema/schema.js.map +1 -1
- package/build/lib/utils.d.ts +7 -267
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +10 -409
- package/build/lib/utils.js.map +1 -1
- package/lib/{appium.js → appium.ts} +297 -341
- package/lib/bidi-commands.ts +10 -14
- package/lib/bootstrap/appium-initializer.ts +212 -0
- package/lib/bootstrap/appium-main-runner.ts +172 -0
- package/lib/bootstrap/config-file.ts +178 -0
- package/lib/bootstrap/grid-v3-register.ts +250 -0
- package/lib/bootstrap/init-types.ts +31 -0
- package/lib/bootstrap/main-helpers.ts +223 -0
- package/lib/bootstrap/node-helpers.ts +180 -0
- package/lib/bootstrap/startup-config.ts +143 -0
- package/lib/cli/{args.js → args.ts} +45 -56
- package/lib/cli/driver-command.ts +122 -0
- package/lib/cli/{extension-command.js → extension-command.ts} +827 -906
- package/lib/cli/extension.ts +65 -0
- package/lib/cli/{parser.js → parser.ts} +93 -116
- package/lib/cli/plugin-command.ts +117 -0
- package/lib/cli/{setup-command.js → setup-command.ts} +59 -74
- package/lib/cli/utils.ts +97 -0
- package/lib/{constants.js → constants.ts} +30 -41
- package/lib/doctor/{doctor.js → doctor.ts} +82 -92
- package/lib/extension/driver-config.ts +165 -0
- package/lib/extension/{extension-config.js → extension-config.ts} +291 -405
- package/lib/extension/index.ts +143 -0
- package/lib/extension/manifest-migrations.ts +57 -0
- package/lib/extension/manifest.ts +369 -0
- package/lib/extension/{package-changed.js → package-changed.ts} +9 -18
- package/lib/extension/plugin-config.ts +62 -0
- package/lib/helpers/build.ts +111 -0
- package/lib/helpers/capability.ts +171 -0
- package/lib/helpers/network.ts +30 -0
- package/lib/insecure-features.ts +1 -1
- package/lib/inspector-commands.ts +6 -1
- package/lib/{logger.js → logger.ts} +1 -2
- package/lib/{logsink.js → logsink.ts} +91 -137
- package/lib/main.ts +60 -0
- package/lib/schema/arg-spec.ts +131 -0
- package/lib/schema/cli-args-guards.ts +67 -0
- package/lib/schema/cli-args.ts +171 -0
- package/lib/schema/cli-transformers.ts +83 -0
- package/lib/schema/format-errors.ts +43 -0
- package/lib/schema/index.ts +4 -0
- package/lib/schema/keywords.ts +96 -0
- package/lib/schema/schema.ts +448 -0
- package/lib/utils.ts +73 -0
- package/package.json +17 -18
- package/scripts/autoinstall-extensions.js +3 -0
- package/build/lib/config-file.d.ts +0 -100
- package/build/lib/config-file.d.ts.map +0 -1
- package/build/lib/config-file.js.map +0 -1
- package/build/lib/config.d.ts +0 -70
- package/build/lib/config.d.ts.map +0 -1
- package/build/lib/config.js +0 -390
- package/build/lib/config.js.map +0 -1
- package/build/lib/grid-register.d.ts +0 -10
- package/build/lib/grid-register.d.ts.map +0 -1
- package/build/lib/grid-register.js +0 -134
- package/build/lib/grid-register.js.map +0 -1
- package/lib/cli/driver-command.js +0 -174
- package/lib/cli/extension.js +0 -74
- package/lib/cli/plugin-command.js +0 -164
- package/lib/cli/utils.js +0 -91
- package/lib/config-file.js +0 -228
- package/lib/config.js +0 -389
- package/lib/extension/driver-config.js +0 -245
- package/lib/extension/index.js +0 -169
- package/lib/extension/manifest-migrations.js +0 -136
- package/lib/extension/manifest.js +0 -550
- package/lib/extension/plugin-config.js +0 -112
- package/lib/grid-register.js +0 -146
- package/lib/main.js +0 -545
- package/lib/schema/arg-spec.js +0 -229
- package/lib/schema/cli-args.js +0 -254
- package/lib/schema/cli-transformers.js +0 -113
- package/lib/schema/index.js +0 -2
- package/lib/schema/keywords.js +0 -136
- package/lib/schema/schema.js +0 -725
- package/lib/utils.js +0 -512
|
@@ -1,143 +1,68 @@
|
|
|
1
|
+
import type { ExtensionType } from '@appium/types';
|
|
1
2
|
/**
|
|
2
3
|
* The original ID of the Appium config schema.
|
|
3
4
|
* We use this in the CLI to convert it to `argparse` options.
|
|
4
5
|
*/
|
|
5
|
-
export const APPIUM_CONFIG_SCHEMA_ID
|
|
6
|
+
export declare const APPIUM_CONFIG_SCHEMA_ID = "appium.json";
|
|
6
7
|
/**
|
|
7
8
|
* The schema prop containing server-related options. Everything in here
|
|
8
9
|
* is "native" to Appium.
|
|
9
|
-
* Used by {@link flattenSchema} for transforming the schema into CLI args.
|
|
10
10
|
*/
|
|
11
|
-
export const SERVER_PROP_NAME
|
|
11
|
+
export declare const SERVER_PROP_NAME = "server";
|
|
12
|
+
export interface ArgSpecOptions<D = unknown> {
|
|
13
|
+
extName?: string;
|
|
14
|
+
extType?: ExtensionType;
|
|
15
|
+
dest?: string;
|
|
16
|
+
defaultValue?: D;
|
|
17
|
+
}
|
|
12
18
|
/**
|
|
13
19
|
* An `ArgSpec` is a class representing metadata about an argument (or config
|
|
14
20
|
* option) used for cross-referencing.
|
|
15
21
|
*
|
|
16
|
-
* This class has no instance methods
|
|
17
|
-
*
|
|
22
|
+
* This class has no instance methods beyond stringification and is effectively
|
|
23
|
+
* a read-only struct.
|
|
18
24
|
*/
|
|
19
|
-
export class ArgSpec<D> {
|
|
25
|
+
export declare class ArgSpec<D = unknown> {
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly extType?: ExtensionType;
|
|
28
|
+
readonly extName?: string;
|
|
29
|
+
readonly ref: string;
|
|
30
|
+
readonly arg: string;
|
|
31
|
+
readonly dest: string;
|
|
32
|
+
readonly rawDest: string;
|
|
33
|
+
readonly defaultValue?: D;
|
|
34
|
+
/**
|
|
35
|
+
* Builds computed fields and assigns them to the instance.
|
|
36
|
+
* Use {@link ArgSpec.create} instead of `new ArgSpec()`.
|
|
37
|
+
*/
|
|
38
|
+
constructor(name: string, { extType, extName, dest, defaultValue }?: ArgSpecOptions<D>);
|
|
20
39
|
/**
|
|
21
|
-
* Return the schema ID (`$id`) for the
|
|
22
|
-
*
|
|
23
|
-
* If you need the "root" or "base" schema ID, use {@link ArgSpec.toSchemaBaseRef} instead.
|
|
24
|
-
* @param {string} name - Argument name
|
|
25
|
-
* @param {ExtensionType} [extType] - Extension type
|
|
26
|
-
* @param {string} [extName] - Extension name
|
|
27
|
-
* @returns {string} Schema ID
|
|
40
|
+
* Return the schema ID (`$id`) for the argument given the parameters.
|
|
28
41
|
*/
|
|
29
42
|
static toSchemaRef(name: string, extType?: ExtensionType, extName?: string): string;
|
|
30
43
|
/**
|
|
31
|
-
* Return the schema ID for an extension or
|
|
32
|
-
* @param {ExtensionType} [extType] - Extension type
|
|
33
|
-
* @param {string} [extName] - Extension name
|
|
44
|
+
* Return the root schema ID for an extension or Appium base schema.
|
|
34
45
|
*/
|
|
35
46
|
static toSchemaBaseRef(extType?: ExtensionType, extName?: string): string;
|
|
36
47
|
/**
|
|
37
|
-
* Return the unique
|
|
38
|
-
* @param {string} name - Argument name
|
|
39
|
-
* @param {ExtensionType} [extType] - Extension type
|
|
40
|
-
* @param {string} [extName] - Extension name
|
|
41
|
-
* @returns {string} Unique ID
|
|
48
|
+
* Return the unique CLI argument key for the argument.
|
|
42
49
|
*/
|
|
43
50
|
static toArg(name: string, extType?: ExtensionType, extName?: string): string;
|
|
44
51
|
/**
|
|
45
|
-
* Normalizes a raw extension name (not including
|
|
46
|
-
* @param {string} extName - Extension name
|
|
47
|
-
* @returns {string} Normalized extension name
|
|
52
|
+
* Normalizes a raw extension name (not including type).
|
|
48
53
|
*/
|
|
49
54
|
static toNormalizedExtName(extName: string): string;
|
|
50
55
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @param {string} schemaId - Root schema ID
|
|
53
|
-
* @returns { {extType?: ExtensionType, normalizedExtName?: string} }
|
|
56
|
+
* Parse root schema ID (`<extType>-<normalizedExtName>.json`) to extension info.
|
|
54
57
|
*/
|
|
55
58
|
static extensionInfoFromRootSchemaId(schemaId: string): {
|
|
56
59
|
extType?: ExtensionType;
|
|
57
60
|
normalizedExtName?: string;
|
|
58
61
|
};
|
|
59
62
|
/**
|
|
60
|
-
* Creates
|
|
61
|
-
*
|
|
62
|
-
* @param {string} name - The canonical name of the argument. Corresponds to a key in a schema's
|
|
63
|
-
* `properties` property.
|
|
64
|
-
* @template D
|
|
65
|
-
* @param {ArgSpecOptions<D>} [opts] - Options
|
|
66
|
-
* @returns {Readonly<ArgSpec>}
|
|
67
|
-
*/
|
|
68
|
-
static create<D_1>(name: string, opts?: ArgSpecOptions<D_1>): Readonly<ArgSpec<any>>;
|
|
69
|
-
/**
|
|
70
|
-
* Builds some computed fields and assigns them to the instance.
|
|
71
|
-
*
|
|
72
|
-
* Undefined properties are not assigned.
|
|
73
|
-
*
|
|
74
|
-
* The _constructor_ is private. Use {@link ArgSpec.create} instead.
|
|
75
|
-
* @private
|
|
76
|
-
* @param {string} name
|
|
77
|
-
* @param {ArgSpecOptions<D>} opts
|
|
78
|
-
*/
|
|
79
|
-
private constructor();
|
|
80
|
-
/**
|
|
81
|
-
* The canonical name of the argument. Corresponds to key in schema's `properties` prop.
|
|
82
|
-
* @type {string}
|
|
83
|
-
*/
|
|
84
|
-
name: string;
|
|
85
|
-
/**
|
|
86
|
-
* The `ExtensionType` of the argument. This will be set if the arg came from an extension;
|
|
87
|
-
* otherwise it will be `undefined`.
|
|
88
|
-
* @type {ExtensionType|undefined}
|
|
89
|
-
*/
|
|
90
|
-
extType: ExtensionType | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* The name of the extension, if this argument came from an extension.
|
|
93
|
-
*
|
|
94
|
-
* Otherwise `undefined`.
|
|
95
|
-
* @type {string|undefined}
|
|
96
|
-
*/
|
|
97
|
-
extName: string | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* The schema ID (`$id`) for the argument. This is automatically determined, and any user-provided `$id`s will be overwritten.
|
|
100
|
-
*
|
|
101
|
-
* @type {string}
|
|
102
|
-
*/
|
|
103
|
-
ref: string;
|
|
104
|
-
/**
|
|
105
|
-
* The CLI argument, sans leading dashes.
|
|
106
|
-
* @type {string}
|
|
107
|
-
*/
|
|
108
|
-
arg: string;
|
|
109
|
-
/**
|
|
110
|
-
* The desired keypath for the argument after arguments have been parsed.
|
|
111
|
-
*
|
|
112
|
-
* Typically this is camelCased. If the arg came from an extension, it will be prefixed with
|
|
113
|
-
* `<extType>.<extName>.`
|
|
114
|
-
* @type {string}
|
|
115
|
-
*/
|
|
116
|
-
dest: string;
|
|
117
|
-
/**
|
|
118
|
-
* The same as {@link ArgSpec.dest} but without the leading `<extType>.<extName>.` prefix.
|
|
119
|
-
*/
|
|
120
|
-
rawDest: string;
|
|
121
|
-
/**
|
|
122
|
-
* Whatever the default value of this argument is, as specified by the
|
|
123
|
-
* `default` property of the schema.
|
|
124
|
-
* @type {D|undefined}
|
|
125
|
-
*/
|
|
126
|
-
defaultValue: D | undefined;
|
|
127
|
-
/**
|
|
128
|
-
* String representation, useful for debugging
|
|
129
|
-
* @returns {string}
|
|
63
|
+
* Creates a frozen `ArgSpec`.
|
|
130
64
|
*/
|
|
65
|
+
static create<D = unknown>(name: string, opts?: ArgSpecOptions<D>): Readonly<ArgSpec<D>>;
|
|
131
66
|
toString(): string;
|
|
132
67
|
}
|
|
133
|
-
/**
|
|
134
|
-
* Options for {@link ArgSpec.create}
|
|
135
|
-
*/
|
|
136
|
-
export type ArgSpecOptions<D> = {
|
|
137
|
-
extName?: string | undefined;
|
|
138
|
-
extType?: import("@appium/types").ExtensionType | undefined;
|
|
139
|
-
dest?: string | undefined;
|
|
140
|
-
defaultValue?: D | undefined;
|
|
141
|
-
};
|
|
142
|
-
export type ExtensionType = import("@appium/types").ExtensionType;
|
|
143
68
|
//# sourceMappingURL=arg-spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arg-spec.d.ts","sourceRoot":"","sources":["../../../lib/schema/arg-spec.
|
|
1
|
+
{"version":3,"file":"arg-spec.d.ts","sourceRoot":"","sources":["../../../lib/schema/arg-spec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AACrD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAIzC,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,CAAC,CAAC;CAClB;AAED;;;;;;GAMG;AACH,qBAAa,OAAO,CAAC,CAAC,GAAG,OAAO;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAE1B;;;OAGG;gBACS,IAAI,EAAE,MAAM,EAAE,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAC,GAAE,cAAc,CAAC,CAAC,CAAM;IAgBxF;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAQnF;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAOzE;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ7E;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAInD;;OAEG;IACH,MAAM,CAAC,6BAA6B,CAClC,QAAQ,EAAE,MAAM,GACf;QAAC,OAAO,CAAC,EAAE,aAAa,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAC;IAYxD;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAIxF,QAAQ,IAAI,MAAM;CAOnB"}
|
|
@@ -13,89 +13,33 @@ exports.APPIUM_CONFIG_SCHEMA_ID = 'appium.json';
|
|
|
13
13
|
/**
|
|
14
14
|
* The schema prop containing server-related options. Everything in here
|
|
15
15
|
* is "native" to Appium.
|
|
16
|
-
* Used by {@link flattenSchema} for transforming the schema into CLI args.
|
|
17
16
|
*/
|
|
18
17
|
exports.SERVER_PROP_NAME = 'server';
|
|
19
|
-
/**
|
|
20
|
-
* Used to parse extension info from a schema ID.
|
|
21
|
-
*/
|
|
22
18
|
const SCHEMA_ID_REGEXP = /^(?<extType>.+?)-(?<normalizedExtName>.+)\.json$/;
|
|
23
|
-
/**
|
|
24
|
-
* Avoid typos by using constants!
|
|
25
|
-
*/
|
|
26
19
|
const PROPERTIES = 'properties';
|
|
27
20
|
/**
|
|
28
21
|
* An `ArgSpec` is a class representing metadata about an argument (or config
|
|
29
22
|
* option) used for cross-referencing.
|
|
30
23
|
*
|
|
31
|
-
* This class has no instance methods
|
|
32
|
-
*
|
|
24
|
+
* This class has no instance methods beyond stringification and is effectively
|
|
25
|
+
* a read-only struct.
|
|
33
26
|
*/
|
|
34
27
|
class ArgSpec {
|
|
35
|
-
/**
|
|
36
|
-
* The canonical name of the argument. Corresponds to key in schema's `properties` prop.
|
|
37
|
-
* @type {string}
|
|
38
|
-
*/
|
|
39
28
|
name;
|
|
40
|
-
/**
|
|
41
|
-
* The `ExtensionType` of the argument. This will be set if the arg came from an extension;
|
|
42
|
-
* otherwise it will be `undefined`.
|
|
43
|
-
* @type {ExtensionType|undefined}
|
|
44
|
-
*/
|
|
45
29
|
extType;
|
|
46
|
-
/**
|
|
47
|
-
* The name of the extension, if this argument came from an extension.
|
|
48
|
-
*
|
|
49
|
-
* Otherwise `undefined`.
|
|
50
|
-
* @type {string|undefined}
|
|
51
|
-
*/
|
|
52
30
|
extName;
|
|
53
|
-
/**
|
|
54
|
-
* The schema ID (`$id`) for the argument. This is automatically determined, and any user-provided `$id`s will be overwritten.
|
|
55
|
-
*
|
|
56
|
-
* @type {string}
|
|
57
|
-
*/
|
|
58
31
|
ref;
|
|
59
|
-
/**
|
|
60
|
-
* The CLI argument, sans leading dashes.
|
|
61
|
-
* @type {string}
|
|
62
|
-
*/
|
|
63
32
|
arg;
|
|
64
|
-
/**
|
|
65
|
-
* The desired keypath for the argument after arguments have been parsed.
|
|
66
|
-
*
|
|
67
|
-
* Typically this is camelCased. If the arg came from an extension, it will be prefixed with
|
|
68
|
-
* `<extType>.<extName>.`
|
|
69
|
-
* @type {string}
|
|
70
|
-
*/
|
|
71
33
|
dest;
|
|
72
|
-
/**
|
|
73
|
-
* The same as {@link ArgSpec.dest} but without the leading `<extType>.<extName>.` prefix.
|
|
74
|
-
*/
|
|
75
34
|
rawDest;
|
|
76
|
-
/**
|
|
77
|
-
* Whatever the default value of this argument is, as specified by the
|
|
78
|
-
* `default` property of the schema.
|
|
79
|
-
* @type {D|undefined}
|
|
80
|
-
*/
|
|
81
35
|
defaultValue;
|
|
82
36
|
/**
|
|
83
|
-
* Builds
|
|
84
|
-
*
|
|
85
|
-
* Undefined properties are not assigned.
|
|
86
|
-
*
|
|
87
|
-
* The _constructor_ is private. Use {@link ArgSpec.create} instead.
|
|
88
|
-
* @private
|
|
89
|
-
* @param {string} name
|
|
90
|
-
* @param {ArgSpecOptions<D>} opts
|
|
37
|
+
* Builds computed fields and assigns them to the instance.
|
|
38
|
+
* Use {@link ArgSpec.create} instead of `new ArgSpec()`.
|
|
91
39
|
*/
|
|
92
40
|
constructor(name, { extType, extName, dest, defaultValue } = {}) {
|
|
93
|
-
// we must normalize the extension name to fit into our convention for CLI
|
|
94
|
-
// args.
|
|
95
41
|
const arg = ArgSpec.toArg(name, extType, extName);
|
|
96
42
|
const ref = ArgSpec.toSchemaRef(name, extType, extName);
|
|
97
|
-
// if no explicit `dest` provided, just camelCase the name to avoid needing
|
|
98
|
-
// to use bracket syntax when accessing props on the parsed args object.
|
|
99
43
|
const rawDest = lodash_1.default.camelCase(dest ?? name);
|
|
100
44
|
const destKeypath = extType && extName ? [extType, extName, rawDest].join('.') : rawDest;
|
|
101
45
|
this.defaultValue = defaultValue;
|
|
@@ -108,13 +52,7 @@ class ArgSpec {
|
|
|
108
52
|
this.rawDest = rawDest;
|
|
109
53
|
}
|
|
110
54
|
/**
|
|
111
|
-
* Return the schema ID (`$id`) for the
|
|
112
|
-
*
|
|
113
|
-
* If you need the "root" or "base" schema ID, use {@link ArgSpec.toSchemaBaseRef} instead.
|
|
114
|
-
* @param {string} name - Argument name
|
|
115
|
-
* @param {ExtensionType} [extType] - Extension type
|
|
116
|
-
* @param {string} [extName] - Extension name
|
|
117
|
-
* @returns {string} Schema ID
|
|
55
|
+
* Return the schema ID (`$id`) for the argument given the parameters.
|
|
118
56
|
*/
|
|
119
57
|
static toSchemaRef(name, extType, extName) {
|
|
120
58
|
const baseRef = ArgSpec.toSchemaBaseRef(extType, extName);
|
|
@@ -124,9 +62,7 @@ class ArgSpec {
|
|
|
124
62
|
return [`${baseRef}#`, PROPERTIES, exports.SERVER_PROP_NAME, PROPERTIES, name].join('/');
|
|
125
63
|
}
|
|
126
64
|
/**
|
|
127
|
-
* Return the schema ID for an extension or
|
|
128
|
-
* @param {ExtensionType} [extType] - Extension type
|
|
129
|
-
* @param {string} [extName] - Extension name
|
|
65
|
+
* Return the root schema ID for an extension or Appium base schema.
|
|
130
66
|
*/
|
|
131
67
|
static toSchemaBaseRef(extType, extName) {
|
|
132
68
|
if (extType && extName) {
|
|
@@ -135,11 +71,7 @@ class ArgSpec {
|
|
|
135
71
|
return exports.APPIUM_CONFIG_SCHEMA_ID;
|
|
136
72
|
}
|
|
137
73
|
/**
|
|
138
|
-
* Return the unique
|
|
139
|
-
* @param {string} name - Argument name
|
|
140
|
-
* @param {ExtensionType} [extType] - Extension type
|
|
141
|
-
* @param {string} [extName] - Extension name
|
|
142
|
-
* @returns {string} Unique ID
|
|
74
|
+
* Return the unique CLI argument key for the argument.
|
|
143
75
|
*/
|
|
144
76
|
static toArg(name, extType, extName) {
|
|
145
77
|
const properName = lodash_1.default.kebabCase(name.replace(/^--?/, ''));
|
|
@@ -149,44 +81,28 @@ class ArgSpec {
|
|
|
149
81
|
return properName;
|
|
150
82
|
}
|
|
151
83
|
/**
|
|
152
|
-
* Normalizes a raw extension name (not including
|
|
153
|
-
* @param {string} extName - Extension name
|
|
154
|
-
* @returns {string} Normalized extension name
|
|
84
|
+
* Normalizes a raw extension name (not including type).
|
|
155
85
|
*/
|
|
156
86
|
static toNormalizedExtName(extName) {
|
|
157
87
|
return lodash_1.default.kebabCase(extName);
|
|
158
88
|
}
|
|
159
89
|
/**
|
|
160
|
-
*
|
|
161
|
-
* @param {string} schemaId - Root schema ID
|
|
162
|
-
* @returns { {extType?: ExtensionType, normalizedExtName?: string} }
|
|
90
|
+
* Parse root schema ID (`<extType>-<normalizedExtName>.json`) to extension info.
|
|
163
91
|
*/
|
|
164
92
|
static extensionInfoFromRootSchemaId(schemaId) {
|
|
165
93
|
const matches = schemaId.match(SCHEMA_ID_REGEXP);
|
|
166
94
|
if (matches?.groups) {
|
|
167
|
-
const { extType, normalizedExtName } =
|
|
168
|
-
/** @type { {extType: ExtensionType, normalizedExtName: string} } */ (matches.groups);
|
|
95
|
+
const { extType, normalizedExtName } = matches.groups;
|
|
169
96
|
return { extType, normalizedExtName };
|
|
170
97
|
}
|
|
171
98
|
return {};
|
|
172
99
|
}
|
|
173
100
|
/**
|
|
174
|
-
* Creates
|
|
175
|
-
*
|
|
176
|
-
* @param {string} name - The canonical name of the argument. Corresponds to a key in a schema's
|
|
177
|
-
* `properties` property.
|
|
178
|
-
* @template D
|
|
179
|
-
* @param {ArgSpecOptions<D>} [opts] - Options
|
|
180
|
-
* @returns {Readonly<ArgSpec>}
|
|
101
|
+
* Creates a frozen `ArgSpec`.
|
|
181
102
|
*/
|
|
182
103
|
static create(name, opts) {
|
|
183
104
|
return Object.freeze(new ArgSpec(name, opts));
|
|
184
105
|
}
|
|
185
|
-
/**
|
|
186
|
-
* String representation, useful for debugging
|
|
187
|
-
* @returns {string}
|
|
188
|
-
*/
|
|
189
|
-
/* istanbul ignore next */
|
|
190
106
|
toString() {
|
|
191
107
|
let str = `[ArgSpec] ${this.name} (${this.ref})`;
|
|
192
108
|
if (this.extType && this.extName) {
|
|
@@ -196,16 +112,4 @@ class ArgSpec {
|
|
|
196
112
|
}
|
|
197
113
|
}
|
|
198
114
|
exports.ArgSpec = ArgSpec;
|
|
199
|
-
/**
|
|
200
|
-
* Options for {@link ArgSpec.create}
|
|
201
|
-
* @template D
|
|
202
|
-
* @typedef ArgSpecOptions
|
|
203
|
-
* @property {string} [extName]
|
|
204
|
-
* @property {ExtensionType} [extType]
|
|
205
|
-
* @property {string} [dest]
|
|
206
|
-
* @property {D} [defaultValue]
|
|
207
|
-
*/
|
|
208
|
-
/**
|
|
209
|
-
* @typedef {import('@appium/types').ExtensionType} ExtensionType
|
|
210
|
-
*/
|
|
211
115
|
//# sourceMappingURL=arg-spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arg-spec.js","sourceRoot":"","sources":["../../../lib/schema/arg-spec.
|
|
1
|
+
{"version":3,"file":"arg-spec.js","sourceRoot":"","sources":["../../../lib/schema/arg-spec.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Args, CliCommand, CliCommandDriver, CliCommandPlugin, CliCommandServer, CliCommandSetup, CliExtensionCommand, CliExtensionSubcommand, CliCommandSetupSubcommand } from 'appium/types';
|
|
2
|
+
type AnyArgs = Args<CliCommand, CliExtensionSubcommand | CliCommandSetupSubcommand | void>;
|
|
3
|
+
/**
|
|
4
|
+
* Type guard: args are for the server command.
|
|
5
|
+
*
|
|
6
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
7
|
+
*/
|
|
8
|
+
export declare function isServerCommandArgs(args: AnyArgs): args is Args<CliCommandServer, void>;
|
|
9
|
+
/**
|
|
10
|
+
* Type guard: args are for the setup command.
|
|
11
|
+
*
|
|
12
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
13
|
+
*/
|
|
14
|
+
export declare function isSetupCommandArgs(args: AnyArgs): args is Args<CliCommandSetup, CliCommandSetupSubcommand>;
|
|
15
|
+
/**
|
|
16
|
+
* Type guard: args are for an extension command (driver or plugin).
|
|
17
|
+
*
|
|
18
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
19
|
+
*/
|
|
20
|
+
export declare function isExtensionCommandArgs(args: AnyArgs): args is Args<CliExtensionCommand, CliExtensionSubcommand>;
|
|
21
|
+
/**
|
|
22
|
+
* Type guard: args are for a driver extension command.
|
|
23
|
+
*
|
|
24
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
25
|
+
*/
|
|
26
|
+
export declare function isDriverCommandArgs(args: AnyArgs): args is Args<CliCommandDriver, CliExtensionSubcommand>;
|
|
27
|
+
/**
|
|
28
|
+
* Type guard: args are for a plugin extension command.
|
|
29
|
+
*
|
|
30
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
31
|
+
*/
|
|
32
|
+
export declare function isPluginCommandArgs(args: AnyArgs): args is Args<CliCommandPlugin, CliExtensionSubcommand>;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=cli-args-guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-args-guards.d.ts","sourceRoot":"","sources":["../../../lib/schema/cli-args-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAGtB,KAAK,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,sBAAsB,GAAG,yBAAyB,GAAG,IAAI,CAAC,CAAC;AAE3F;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAEvF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAExD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAExD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isServerCommandArgs = isServerCommandArgs;
|
|
4
|
+
exports.isSetupCommandArgs = isSetupCommandArgs;
|
|
5
|
+
exports.isExtensionCommandArgs = isExtensionCommandArgs;
|
|
6
|
+
exports.isDriverCommandArgs = isDriverCommandArgs;
|
|
7
|
+
exports.isPluginCommandArgs = isPluginCommandArgs;
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
/**
|
|
10
|
+
* Type guard: args are for the server command.
|
|
11
|
+
*
|
|
12
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
13
|
+
*/
|
|
14
|
+
function isServerCommandArgs(args) {
|
|
15
|
+
return args.subcommand === constants_1.SERVER_SUBCOMMAND;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Type guard: args are for the setup command.
|
|
19
|
+
*
|
|
20
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
21
|
+
*/
|
|
22
|
+
function isSetupCommandArgs(args) {
|
|
23
|
+
return args.subcommand === constants_1.SETUP_SUBCOMMAND;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Type guard: args are for an extension command (driver or plugin).
|
|
27
|
+
*
|
|
28
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
29
|
+
*/
|
|
30
|
+
function isExtensionCommandArgs(args) {
|
|
31
|
+
return args.subcommand === constants_1.DRIVER_TYPE || args.subcommand === constants_1.PLUGIN_TYPE;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Type guard: args are for a driver extension command.
|
|
35
|
+
*
|
|
36
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
37
|
+
*/
|
|
38
|
+
function isDriverCommandArgs(args) {
|
|
39
|
+
return args.subcommand === constants_1.DRIVER_TYPE;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Type guard: args are for a plugin extension command.
|
|
43
|
+
*
|
|
44
|
+
* @param args - Parsed args before full subcommand-specific narrowing
|
|
45
|
+
*/
|
|
46
|
+
function isPluginCommandArgs(args) {
|
|
47
|
+
return args.subcommand === constants_1.PLUGIN_TYPE;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=cli-args-guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-args-guards.js","sourceRoot":"","sources":["../../../lib/schema/cli-args-guards.ts"],"names":[],"mappings":";;AAoBA,kDAEC;AAOD,gDAIC;AAOD,wDAIC;AAOD,kDAIC;AAOD,kDAIC;AAvDD,4CAA2F;AAI3F;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,IAAa;IAC/C,OAAO,IAAI,CAAC,UAAU,KAAK,6BAAiB,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAChC,IAAa;IAEb,OAAO,IAAI,CAAC,UAAU,KAAK,4BAAgB,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CACpC,IAAa;IAEb,OAAO,IAAI,CAAC,UAAU,KAAK,uBAAW,IAAI,IAAI,CAAC,UAAU,KAAK,uBAAW,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CACjC,IAAa;IAEb,OAAO,IAAI,CAAC,UAAU,KAAK,uBAAW,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CACjC,IAAa;IAEb,OAAO,IAAI,CAAC,UAAU,KAAK,uBAAW,CAAC;AACzC,CAAC"}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
+
import type { ArgumentDefinitions } from '../cli/args';
|
|
1
2
|
/**
|
|
2
3
|
* Converts the finalized, flattened schema representation into
|
|
3
|
-
* ArgumentDefinitions for handoff to `argparse`.
|
|
4
|
-
*
|
|
5
|
-
* @throws If schema has not been added to ajv (via `finalizeSchema()`)
|
|
6
|
-
* @returns {import('../cli/args').ArgumentDefinitions} A map of arrays of
|
|
7
|
-
* aliases to `argparse` arguments; empty if no schema found
|
|
4
|
+
* `ArgumentDefinitions` for handoff to `argparse`.
|
|
8
5
|
*/
|
|
9
|
-
export function toParserArgs():
|
|
10
|
-
/**
|
|
11
|
-
* <T>
|
|
12
|
-
*/
|
|
13
|
-
export type FormatValidator<T extends string | number> = import("ajv/dist/types").FormatValidator<T>;
|
|
14
|
-
/**
|
|
15
|
-
* A JSON 7 schema with our custom keywords.
|
|
16
|
-
*/
|
|
17
|
-
export type AppiumJSONSchema = import("./keywords").AppiumJSONSchemaKeywords & import("json-schema").JSONSchema7;
|
|
18
|
-
export type ArgSpec = import("./arg-spec").ArgSpec<any>;
|
|
6
|
+
export declare function toParserArgs(): ArgumentDefinitions;
|
|
19
7
|
//# sourceMappingURL=cli-args.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../../../lib/schema/cli-args.
|
|
1
|
+
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../../../lib/schema/cli-args.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAiBrD;;;GAGG;AACH,wBAAgB,YAAY,IAAI,mBAAmB,CAKlD"}
|