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.
- 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} +9 -26
- 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/{grid-register.js → bootstrap/grid-v3-register.js} +28 -13
- 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.map +1 -1
- package/build/lib/cli/args.js +9 -9
- package/build/lib/cli/args.js.map +1 -1
- package/build/lib/cli/extension-command.d.ts +95 -95
- package/build/lib/cli/extension-command.d.ts.map +1 -1
- package/build/lib/cli/extension-command.js +18 -18
- package/build/lib/cli/extension-command.js.map +1 -1
- package/build/lib/cli/extension.d.ts +1 -1
- package/build/lib/cli/extension.d.ts.map +1 -1
- package/build/lib/cli/extension.js +5 -5
- package/build/lib/cli/extension.js.map +1 -1
- package/build/lib/cli/parser.d.ts +8 -8
- package/build/lib/cli/parser.d.ts.map +1 -1
- package/build/lib/cli/parser.js +49 -49
- package/build/lib/cli/parser.js.map +1 -1
- package/build/lib/cli/setup-command.js +6 -6
- package/build/lib/cli/setup-command.js.map +1 -1
- package/build/lib/cli/utils.d.ts +17 -17
- package/build/lib/cli/utils.d.ts.map +1 -1
- package/build/lib/cli/utils.js +29 -29
- package/build/lib/cli/utils.js.map +1 -1
- package/build/lib/doctor/doctor.d.ts +2 -2
- package/build/lib/doctor/doctor.d.ts.map +1 -1
- package/build/lib/doctor/doctor.js +6 -6
- 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/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/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.js +2 -2
- package/build/lib/schema/cli-args.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 +2 -0
- 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/schema.d.ts +15 -15
- package/build/lib/schema/schema.d.ts.map +1 -1
- package/build/lib/schema/schema.js +37 -37
- package/build/lib/schema/schema.js.map +1 -1
- package/build/lib/utils.d.ts +0 -81
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +1 -248
- 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/{config-file.ts → bootstrap/config-file.ts} +29 -63
- package/lib/{grid-register.ts → bootstrap/grid-v3-register.ts} +35 -35
- 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.ts +10 -10
- package/lib/cli/extension-command.ts +132 -132
- package/lib/cli/extension.ts +7 -7
- package/lib/cli/parser.ts +50 -50
- package/lib/cli/setup-command.ts +2 -2
- package/lib/cli/utils.ts +33 -33
- package/lib/doctor/doctor.ts +8 -8
- 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/main.ts +60 -0
- package/lib/schema/cli-args-guards.ts +67 -0
- package/lib/schema/cli-args.ts +1 -1
- package/lib/schema/format-errors.ts +43 -0
- package/lib/schema/index.ts +2 -0
- package/lib/schema/schema.ts +51 -52
- package/lib/utils.ts +0 -331
- package/package.json +12 -13
- package/scripts/autoinstall-extensions.js +3 -0
- package/build/lib/config-file.d.ts +0 -57
- 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 -68
- package/build/lib/config.d.ts.map +0 -1
- package/build/lib/config.js +0 -358
- package/build/lib/config.js.map +0 -1
- package/build/lib/grid-register.d.ts +0 -35
- package/build/lib/grid-register.d.ts.map +0 -1
- package/build/lib/grid-register.js.map +0 -1
- package/lib/config.ts +0 -377
- 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/main.js +0 -545
|
@@ -1,284 +1,177 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export function resolveEsmEntryPoint(exportsValue: any): string | undefined;
|
|
1
|
+
import type { ExtensionType } from '@appium/types';
|
|
2
|
+
import type { ExtClass, ExtManifest, ExtName, ExtRecord, InstallType } from 'appium/types';
|
|
3
|
+
import type { SchemaObject } from 'ajv';
|
|
4
|
+
import type { ExtensionList } from '../cli/extension-command';
|
|
5
|
+
import type { Manifest } from './manifest';
|
|
8
6
|
/**
|
|
9
7
|
* "npm" install type
|
|
10
8
|
* Used when extension was installed by npm package name
|
|
11
9
|
* @remarks _All_ extensions are installed _by_ `npm`, but only this one means the package name was
|
|
12
10
|
* used to specify it
|
|
13
11
|
*/
|
|
14
|
-
export const INSTALL_TYPE_NPM
|
|
12
|
+
export declare const INSTALL_TYPE_NPM = "npm";
|
|
15
13
|
/**
|
|
16
14
|
* "local" install type
|
|
17
15
|
* Used when extension was installed from a local path
|
|
18
16
|
*/
|
|
19
|
-
export const INSTALL_TYPE_LOCAL
|
|
17
|
+
export declare const INSTALL_TYPE_LOCAL = "local";
|
|
20
18
|
/**
|
|
21
19
|
* "github" install type
|
|
22
20
|
* Used when extension was installed via GitHub URL
|
|
23
21
|
*/
|
|
24
|
-
export const INSTALL_TYPE_GITHUB
|
|
22
|
+
export declare const INSTALL_TYPE_GITHUB = "github";
|
|
25
23
|
/**
|
|
26
24
|
* "git" install type
|
|
27
25
|
* Used when extensions was installed via Git URL
|
|
28
26
|
*/
|
|
29
|
-
export const INSTALL_TYPE_GIT
|
|
27
|
+
export declare const INSTALL_TYPE_GIT = "git";
|
|
30
28
|
/**
|
|
31
29
|
* "dev" install type
|
|
32
30
|
* Used when automatically detected as a working copy
|
|
33
31
|
*/
|
|
34
|
-
export const INSTALL_TYPE_DEV
|
|
35
|
-
|
|
36
|
-
export
|
|
32
|
+
export declare const INSTALL_TYPE_DEV = "dev";
|
|
33
|
+
export declare const INSTALL_TYPES: Set<InstallType>;
|
|
34
|
+
export type ExtManifestProblem = {
|
|
35
|
+
err: string;
|
|
36
|
+
val: unknown;
|
|
37
|
+
};
|
|
38
|
+
export type ExtManifestWithSchema<E extends ExtensionType> = ExtManifest<E> & {
|
|
39
|
+
schema: NonNullable<ExtManifest<E>['schema']>;
|
|
40
|
+
};
|
|
41
|
+
export type ExtensionConfigMutationOpts = {
|
|
42
|
+
write?: boolean;
|
|
43
|
+
};
|
|
37
44
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* Subclasses should provide the generic parameter to implement.
|
|
41
|
-
* @template {ExtensionType} ExtType
|
|
45
|
+
* Shared configuration and validation for installed Appium extensions (drivers or plugins).
|
|
46
|
+
* Subclasses fix the extension kind; do not instantiate this class directly.
|
|
42
47
|
*/
|
|
43
|
-
export class ExtensionConfig<ExtType extends ExtensionType> {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* @returns {import('ajv').SchemaObject|undefined}
|
|
53
|
-
*/
|
|
54
|
-
private static _readExtensionSchema;
|
|
55
|
-
/**
|
|
56
|
-
* Returns `true` if a specific {@link ExtManifest} object has a `schema` prop.
|
|
57
|
-
* The {@link ExtManifest} object becomes a {@link ExtManifestWithSchema} object.
|
|
58
|
-
* @template {ExtensionType} ExtType
|
|
59
|
-
* @param {ExtManifest<ExtType>} extManifest
|
|
60
|
-
* @returns {extManifest is ExtManifestWithSchema<ExtType>}
|
|
61
|
-
*/
|
|
62
|
-
static extDataHasSchema<ExtType_1 extends ExtensionType>(extManifest: ExtManifest<ExtType_1>): extManifest is ExtManifestWithSchema<ExtType_1>;
|
|
63
|
-
/**
|
|
64
|
-
* @protected
|
|
65
|
-
* @param {ExtType} extensionType - Type of extension
|
|
66
|
-
* @param {Manifest} manifest - `Manifest` instance
|
|
67
|
-
*/
|
|
68
|
-
protected constructor();
|
|
69
|
-
/**
|
|
70
|
-
* The type of extension this class is responsible for.
|
|
71
|
-
* @type {ExtType}
|
|
72
|
-
*/
|
|
73
|
-
extensionType: ExtType;
|
|
74
|
-
/**
|
|
75
|
-
* Manifest data for the extensions of this type.
|
|
76
|
-
*
|
|
77
|
-
* This data should _not_ be written to by anything but {@linkcode Manifest}.
|
|
78
|
-
* @type {Readonly<ExtRecord<ExtType>>}
|
|
79
|
-
*/
|
|
80
|
-
installedExtensions: Readonly<ExtRecord<ExtType>>;
|
|
81
|
-
/** @type {import('@appium/types').AppiumLogger} */
|
|
82
|
-
log: import("@appium/types").AppiumLogger;
|
|
83
|
-
/** @type {Manifest} */
|
|
84
|
-
manifest: Manifest;
|
|
85
|
-
get manifestPath(): string;
|
|
48
|
+
export declare abstract class ExtensionConfig<ExtType extends ExtensionType> {
|
|
49
|
+
#private;
|
|
50
|
+
readonly extensionType: ExtType;
|
|
51
|
+
readonly manifest: Manifest;
|
|
52
|
+
installedExtensions: ExtRecord<ExtType>;
|
|
53
|
+
protected constructor(extensionType: ExtType, manifest: Manifest);
|
|
54
|
+
/** Path to `extensions.yaml` after the manifest has been read; otherwise undefined. */
|
|
55
|
+
get manifestPath(): string | undefined;
|
|
56
|
+
/** `APPIUM_HOME` directory this config is tied to. */
|
|
86
57
|
get appiumHome(): string;
|
|
87
58
|
/**
|
|
88
|
-
*
|
|
59
|
+
* Type guard: manifest entry includes a `schema` path or inline schema object.
|
|
89
60
|
*
|
|
90
|
-
* @param
|
|
91
|
-
* @param {ExtManifest<ExtType>} extManifest
|
|
92
|
-
* @returns {ExtManifestProblem[]}
|
|
61
|
+
* @param extManifest - Parsed extension metadata
|
|
93
62
|
*/
|
|
94
|
-
|
|
63
|
+
static extDataHasSchema<E extends ExtensionType>(extManifest: ExtManifest<E>): extManifest is ExtManifestWithSchema<E>;
|
|
64
|
+
private static _readExtensionSchema;
|
|
95
65
|
/**
|
|
96
|
-
*
|
|
66
|
+
* Collects blocking validation issues for one extension (generic fields, type-specific rules, and schema).
|
|
97
67
|
*
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
100
|
-
* @returns {Promise<string[]>}
|
|
68
|
+
* @param extName - Extension key as stored in the manifest
|
|
69
|
+
* @param extManifest - Manifest entry for that extension
|
|
101
70
|
*/
|
|
102
|
-
|
|
71
|
+
getProblems(extName: string, extManifest: ExtManifest<ExtType>): Promise<ExtManifestProblem[]>;
|
|
103
72
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* @param
|
|
108
|
-
* @
|
|
73
|
+
* Collects non-fatal issues for one extension (e.g. manifest quirks, peer dependency mismatches).
|
|
74
|
+
* Warnings do not by themselves prevent loading.
|
|
75
|
+
*
|
|
76
|
+
* @param extName - Extension key as stored in the manifest
|
|
77
|
+
* @param extManifest - Manifest entry for that extension
|
|
109
78
|
*/
|
|
110
|
-
|
|
79
|
+
getWarnings(extName: string, extManifest: ExtManifest<ExtType>): Promise<string[]>;
|
|
111
80
|
/**
|
|
81
|
+
* Turns per-extension errors and warnings into human-readable log lines for console output.
|
|
112
82
|
*
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
83
|
+
* @param errorMap - Extension name to list of blocking problems
|
|
84
|
+
* @param warningMap - Extension name to list of warning strings
|
|
115
85
|
*/
|
|
116
|
-
getValidationResultSummaries(errorMap?: Map<
|
|
86
|
+
getValidationResultSummaries(errorMap?: Map<string, ExtManifestProblem[]>, warningMap?: Map<string, string[]>): {
|
|
117
87
|
errorSummaries: string[];
|
|
118
88
|
warningSummaries: string[];
|
|
119
89
|
};
|
|
120
90
|
/**
|
|
121
|
-
*
|
|
91
|
+
* Records a new installed extension in the manifest and optionally persists immediately.
|
|
122
92
|
*
|
|
123
|
-
*
|
|
93
|
+
* @param extName - Manifest key for the extension
|
|
94
|
+
* @param extManifest - Full manifest payload
|
|
124
95
|
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @protected
|
|
128
|
-
* @param {ExtRecord<ExtType>} exts - Lookup of extension names to {@linkcode ExtManifest} objects
|
|
129
|
-
* @returns {Promise<ExtRecord<ExtType>>} The same lookup, but picking only error-free extensions
|
|
96
|
+
* Pass `{ write: false }` to defer flushing until a later manifest write.
|
|
130
97
|
*/
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Retrieves listing data for extensions via command class.
|
|
134
|
-
*
|
|
135
|
-
* This is an expensive operation, so the result is cached. Currently, there is no
|
|
136
|
-
* use case for invalidating the cache.
|
|
137
|
-
* @protected
|
|
138
|
-
* @returns {Promise<import('../cli/extension-command').ExtensionList<ExtType>>}
|
|
139
|
-
*/
|
|
140
|
-
protected getListData(): Promise<import("../cli/extension-command").ExtensionList<ExtType>>;
|
|
98
|
+
addExtension(extName: string, extManifest: ExtManifest<ExtType>, { write }?: ExtensionConfigMutationOpts): Promise<void>;
|
|
141
99
|
/**
|
|
142
|
-
*
|
|
100
|
+
* Merges new metadata into an existing extension entry and optionally writes the manifest.
|
|
143
101
|
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
102
|
+
* @param extName - Installed extension to update
|
|
103
|
+
* @param extManifest - Fields to merge over the current entry
|
|
146
104
|
*
|
|
147
|
-
*
|
|
148
|
-
* @param {ExtName<ExtType>} extName
|
|
149
|
-
* @returns {Promise<string[]>}
|
|
150
|
-
*/
|
|
151
|
-
getGenericConfigWarnings(extManifest: ExtManifest<ExtType>, extName: ExtName<ExtType>): Promise<string[]>;
|
|
152
|
-
/**
|
|
153
|
-
* Returns list of unrecoverable errors (if any) for the given extension _if_ it has a `schema` property.
|
|
154
|
-
*
|
|
155
|
-
* @param {ExtManifest<ExtType>} extManifest - Extension data (from manifest)
|
|
156
|
-
* @param {ExtName<ExtType>} extName - Extension name (from manifest)
|
|
157
|
-
* @returns {ExtManifestProblem[]}
|
|
158
|
-
*/
|
|
159
|
-
getSchemaProblems(extManifest: ExtManifest<ExtType>, extName: ExtName<ExtType>): ExtManifestProblem[];
|
|
160
|
-
/**
|
|
161
|
-
* Return a list of generic unrecoverable errors for the given extension
|
|
162
|
-
* @param {ExtManifest<ExtType>} extManifest - Extension data (from manifest)
|
|
163
|
-
* @param {ExtName<ExtType>} extName - Extension name (from manifest)
|
|
164
|
-
* @returns {ExtManifestProblem[]}
|
|
165
|
-
*/
|
|
166
|
-
getGenericConfigProblems(extManifest: ExtManifest<ExtType>, extName: ExtName<ExtType>): ExtManifestProblem[];
|
|
167
|
-
/**
|
|
168
|
-
* @abstract
|
|
169
|
-
* @param {ExtManifest<ExtType>} extManifest
|
|
170
|
-
* @param {ExtName<ExtType>} extName
|
|
171
|
-
* @returns {ExtManifestProblem[]}
|
|
172
|
-
*/
|
|
173
|
-
getConfigProblems(extManifest: ExtManifest<ExtType>, extName: ExtName<ExtType>): ExtManifestProblem[];
|
|
174
|
-
/**
|
|
175
|
-
* @param {string} extName
|
|
176
|
-
* @param {ExtManifest<ExtType>} extManifest
|
|
177
|
-
* @param {ExtensionConfigMutationOpts} opts
|
|
178
|
-
* @returns {Promise<void>}
|
|
179
|
-
*/
|
|
180
|
-
addExtension(extName: string, extManifest: ExtManifest<ExtType>, { write }?: ExtensionConfigMutationOpts): Promise<void>;
|
|
181
|
-
/**
|
|
182
|
-
* @param {ExtName<ExtType>} extName
|
|
183
|
-
* @param {ExtManifest<ExtType>} extManifest
|
|
184
|
-
* @param {ExtensionConfigMutationOpts} opts
|
|
185
|
-
* @returns {Promise<void>}
|
|
105
|
+
* Pass `{ write: false }` to defer flushing until a later manifest write.
|
|
186
106
|
*/
|
|
187
107
|
updateExtension(extName: ExtName<ExtType>, extManifest: ExtManifest<ExtType>, { write }?: ExtensionConfigMutationOpts): Promise<void>;
|
|
188
108
|
/**
|
|
189
|
-
*
|
|
109
|
+
* Drops an extension from the manifest and optionally persists immediately.
|
|
110
|
+
*
|
|
111
|
+
* @param extName - Installed extension to remove
|
|
190
112
|
*
|
|
191
|
-
*
|
|
192
|
-
* @param {ExtensionConfigMutationOpts} opts
|
|
193
|
-
* @returns {Promise<void>}
|
|
113
|
+
* Pass `{ write: false }` to defer flushing until a later manifest write.
|
|
194
114
|
*/
|
|
195
115
|
removeExtension(extName: ExtName<ExtType>, { write }?: ExtensionConfigMutationOpts): Promise<void>;
|
|
196
116
|
/**
|
|
197
|
-
*
|
|
198
|
-
* @returns {void}
|
|
117
|
+
* Logs installed extensions to the console. Subclasses may use `activeNames` to annotate active plugins.
|
|
199
118
|
*/
|
|
200
|
-
print(
|
|
119
|
+
print(_activeNames?: ExtName<ExtType>[]): void;
|
|
201
120
|
/**
|
|
202
|
-
*
|
|
203
|
-
* @param {ExtName<ExtType>} extName - Extension name
|
|
204
|
-
* @param {ExtManifest<ExtType>} extManifest - Extension data
|
|
205
|
-
* @returns {string}
|
|
206
|
-
* @abstract
|
|
207
|
-
*/
|
|
208
|
-
extensionDesc(extName: ExtName<ExtType>, extManifest: ExtManifest<ExtType>): string;
|
|
209
|
-
/**
|
|
210
|
-
* Returns--with reasonable accuracy--the path on disk to the extension.
|
|
121
|
+
* Root directory of an installed extension, preferring `installPath` and falling back to `node_modules/<pkgName>`.
|
|
211
122
|
*
|
|
212
|
-
*
|
|
213
|
-
* @param {keyof typeof this.installedExtensions} extName
|
|
214
|
-
* @returns {string}
|
|
123
|
+
* @param extName - Installed extension key
|
|
215
124
|
*/
|
|
216
|
-
getInstallPath(extName: keyof
|
|
125
|
+
getInstallPath(extName: keyof ExtRecord<ExtType> & string): string;
|
|
217
126
|
/**
|
|
127
|
+
* Dynamically imports the extension entry point and returns the exported main class constructor.
|
|
218
128
|
*
|
|
219
|
-
* @param
|
|
220
|
-
* @returns {Promise<[string, string]>}
|
|
129
|
+
* @param extName - Installed extension to load
|
|
221
130
|
*/
|
|
222
|
-
|
|
131
|
+
requireAsync(extName: ExtName<ExtType>): Promise<ExtClass<ExtType>>;
|
|
132
|
+
/** Whether the manifest lists an extension under the given name. */
|
|
133
|
+
isInstalled(extName: string): boolean;
|
|
223
134
|
/**
|
|
224
|
-
* Loads extension
|
|
135
|
+
* Loads the extension’s config schema from disk or inline JSON and registers it for CLI/config validation.
|
|
225
136
|
*
|
|
226
|
-
* @param
|
|
227
|
-
* @
|
|
137
|
+
* @param extName - Extension key
|
|
138
|
+
* @param extManifest - Manifest entry that includes `schema`
|
|
228
139
|
*/
|
|
229
|
-
|
|
140
|
+
readExtensionSchema(extName: string, extManifest: ExtManifestWithSchema<ExtType>): Promise<SchemaObject | undefined>;
|
|
141
|
+
/** Optional async warnings for this extension kind; override in subclasses when needed. */
|
|
142
|
+
protected getConfigWarnings(_extManifest: ExtManifest<ExtType>, _extName: string): Promise<string[]>;
|
|
230
143
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
144
|
+
* Validates all entries in `exts`, logs summaries, and removes keys that have blocking errors.
|
|
145
|
+
* Intended for subclasses’ `validate` implementation.
|
|
233
146
|
*/
|
|
234
|
-
|
|
147
|
+
protected _validate(exts: ExtRecord<ExtType>): Promise<ExtRecord<ExtType>>;
|
|
235
148
|
/**
|
|
236
|
-
*
|
|
237
|
-
* register it with the schema registrar.
|
|
238
|
-
* @param {ExtName<ExtType>} extName - Name of extension
|
|
239
|
-
* @param {ExtManifestWithSchema<ExtType>} extManifest - Extension data
|
|
240
|
-
* @returns {import('ajv').SchemaObject|undefined}
|
|
149
|
+
* Fetches `appium driver|plugin list`-style data via the CLI command class; result is cached.
|
|
241
150
|
*/
|
|
242
|
-
|
|
243
|
-
#private;
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* An issue with the {@linkcode ExtManifest} for a particular extension.
|
|
247
|
-
*
|
|
248
|
-
* The existance of such an object implies that the extension cannot be loaded.
|
|
249
|
-
*/
|
|
250
|
-
export type ExtManifestProblem = {
|
|
151
|
+
protected getListData(): Promise<ExtensionList<ExtType>>;
|
|
251
152
|
/**
|
|
252
|
-
*
|
|
153
|
+
* Warnings about manifest install fields and Appium peer dependency compatibility for one extension.
|
|
253
154
|
*/
|
|
254
|
-
|
|
155
|
+
protected getGenericConfigWarnings(extManifest: ExtManifest<ExtType>, extName: string): Promise<string[]>;
|
|
156
|
+
/** Validates and registers extension CLI/config schema when the manifest defines a `schema` field. */
|
|
157
|
+
protected getSchemaProblems(extManifest: ExtManifest<ExtType>, extName: string): Promise<ExtManifestProblem[]>;
|
|
158
|
+
/** Blocking issues for required manifest fields shared by all extensions (version, package name, main class). */
|
|
159
|
+
protected getGenericConfigProblems(extManifest: ExtManifest<ExtType>, extName: string): ExtManifestProblem[];
|
|
160
|
+
/** Driver- or plugin-specific blocking validation; override in subclasses when needed. */
|
|
161
|
+
protected getConfigProblems(_extManifest: ExtManifest<ExtType>, _extName: string): ExtManifestProblem[];
|
|
162
|
+
private _resolveExtension;
|
|
255
163
|
/**
|
|
256
|
-
* -
|
|
164
|
+
* One-line human description for list output; implemented per extension kind.
|
|
165
|
+
*
|
|
166
|
+
* @param extName - Manifest key
|
|
167
|
+
* @param extManifest - Entry used for version and kind-specific labels
|
|
257
168
|
*/
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* An optional logging function provided to an {@link ExtensionConfig} subclass.
|
|
262
|
-
*/
|
|
263
|
-
export type ExtensionLogFn = (...args: any[]) => void;
|
|
264
|
-
export type ExtensionType = import("@appium/types").ExtensionType;
|
|
265
|
-
export type Manifest = import("./manifest").Manifest;
|
|
266
|
-
export type InstallType = import("appium/types").InstallType;
|
|
267
|
-
export type ExtManifest<ExtType extends ExtensionType> = import("appium/types").ExtManifest<ExtType>;
|
|
268
|
-
export type ExtManifestWithSchema<ExtType extends ExtensionType> = ExtManifest<ExtType> & {
|
|
269
|
-
schema: NonNullable<ExtManifest<ExtType>["schema"]>;
|
|
270
|
-
};
|
|
271
|
-
export type ExtName<ExtType extends ExtensionType> = import("appium/types").ExtName<ExtType>;
|
|
272
|
-
export type ExtClass<ExtType extends ExtensionType> = import("appium/types").ExtClass<ExtType>;
|
|
273
|
-
export type ExtRecord<ExtType extends ExtensionType> = import("appium/types").ExtRecord<ExtType>;
|
|
274
|
-
export type ExtCommand<ExtType extends ExtensionType> = import("../cli/extension").ExtCommand<ExtType>;
|
|
169
|
+
abstract extensionDesc(extName: ExtName<ExtType>, extManifest: ExtManifest<ExtType>): string;
|
|
170
|
+
}
|
|
275
171
|
/**
|
|
276
|
-
*
|
|
172
|
+
* Resolves a package `exports` field (string, `"."`, or `"import"`) to a relative entry path for ESM packages.
|
|
173
|
+
*
|
|
174
|
+
* @param exportsValue - `package.json` `exports` value or nested fragment
|
|
277
175
|
*/
|
|
278
|
-
export
|
|
279
|
-
/**
|
|
280
|
-
* Whether or not to write the manifest to disk after a mutation operation
|
|
281
|
-
*/
|
|
282
|
-
write?: boolean | undefined;
|
|
283
|
-
};
|
|
176
|
+
export declare function resolveEsmEntryPoint(exportsValue: unknown): string | undefined;
|
|
284
177
|
//# sourceMappingURL=extension-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-config.d.ts","sourceRoot":"","sources":["../../../lib/extension/extension-config.
|
|
1
|
+
{"version":3,"file":"extension-config.d.ts","sourceRoot":"","sources":["../../../lib/extension/extension-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AACzF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,KAAK,CAAC;AAStC,OAAO,KAAK,EACV,aAAa,EAGd,MAAM,0BAA0B,CAAC;AASlC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGzC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAC1C;;;GAGG;AACH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAEtC,eAAO,MAAM,aAAa,kBAMxB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAC,CAAC;AAE7D,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,aAAa,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