appium 2.0.0-beta.9 → 2.0.0-rc.2
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/LICENSE +1 -1
- package/README.md +149 -58
- package/build/lib/appium.d.ts +229 -0
- package/build/lib/appium.d.ts.map +1 -0
- package/build/lib/appium.js +677 -449
- package/build/lib/appium.js.map +1 -0
- package/build/lib/cli/args.d.ts +17 -0
- package/build/lib/cli/args.d.ts.map +1 -0
- package/build/lib/cli/args.js +263 -300
- package/build/lib/cli/args.js.map +1 -0
- package/build/lib/cli/driver-command.d.ts +102 -0
- package/build/lib/cli/driver-command.d.ts.map +1 -0
- package/build/lib/cli/driver-command.js +131 -81
- package/build/lib/cli/driver-command.js.map +1 -0
- package/build/lib/cli/extension-command.d.ts +402 -0
- package/build/lib/cli/extension-command.d.ts.map +1 -0
- package/build/lib/cli/extension-command.js +799 -383
- package/build/lib/cli/extension-command.js.map +1 -0
- package/build/lib/cli/extension.d.ts +23 -0
- package/build/lib/cli/extension.d.ts.map +1 -0
- package/build/lib/cli/extension.js +70 -68
- package/build/lib/cli/extension.js.map +1 -0
- package/build/lib/cli/parser.d.ts +84 -0
- package/build/lib/cli/parser.d.ts.map +1 -0
- package/build/lib/cli/parser.js +252 -148
- package/build/lib/cli/parser.js.map +1 -0
- package/build/lib/cli/plugin-command.d.ts +99 -0
- package/build/lib/cli/plugin-command.d.ts.map +1 -0
- package/build/lib/cli/plugin-command.js +125 -81
- package/build/lib/cli/plugin-command.js.map +1 -0
- 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 +72 -51
- package/build/lib/cli/utils.js.map +1 -0
- 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 +207 -0
- package/build/lib/config-file.js.map +1 -0
- package/build/lib/config.d.ts +49 -0
- package/build/lib/config.d.ts.map +1 -0
- package/build/lib/config.js +262 -223
- package/build/lib/config.js.map +1 -0
- package/build/lib/constants.d.ts +56 -0
- package/build/lib/constants.d.ts.map +1 -0
- package/build/lib/constants.js +73 -0
- package/build/lib/constants.js.map +1 -0
- package/build/lib/extension/driver-config.d.ts +82 -0
- package/build/lib/extension/driver-config.d.ts.map +1 -0
- package/build/lib/extension/driver-config.js +210 -0
- package/build/lib/extension/driver-config.js.map +1 -0
- package/build/lib/extension/extension-config.d.ts +270 -0
- package/build/lib/extension/extension-config.d.ts.map +1 -0
- package/build/lib/extension/extension-config.js +601 -0
- package/build/lib/extension/extension-config.js.map +1 -0
- package/build/lib/extension/index.d.ts +48 -0
- package/build/lib/extension/index.d.ts.map +1 -0
- package/build/lib/extension/index.js +105 -0
- package/build/lib/extension/index.js.map +1 -0
- package/build/lib/extension/manifest-migrations.d.ts +27 -0
- package/build/lib/extension/manifest-migrations.d.ts.map +1 -0
- package/build/lib/extension/manifest-migrations.js +134 -0
- package/build/lib/extension/manifest-migrations.js.map +1 -0
- package/build/lib/extension/manifest.d.ts +145 -0
- package/build/lib/extension/manifest.d.ts.map +1 -0
- package/build/lib/extension/manifest.js +528 -0
- package/build/lib/extension/manifest.js.map +1 -0
- 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 +62 -0
- package/build/lib/extension/package-changed.js.map +1 -0
- package/build/lib/extension/plugin-config.d.ts +56 -0
- package/build/lib/extension/plugin-config.d.ts.map +1 -0
- package/build/lib/extension/plugin-config.js +102 -0
- package/build/lib/extension/plugin-config.js.map +1 -0
- package/build/lib/grid-register.d.ts +10 -0
- package/build/lib/grid-register.d.ts.map +1 -0
- package/build/lib/grid-register.js +122 -144
- package/build/lib/grid-register.js.map +1 -0
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +5 -17
- package/build/lib/logger.js.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 +189 -184
- package/build/lib/logsink.js.map +1 -0
- package/build/lib/main.d.ts +62 -0
- package/build/lib/main.d.ts.map +1 -0
- package/build/lib/main.js +406 -234
- package/build/lib/main.js.map +1 -0
- 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 +164 -0
- package/build/lib/schema/arg-spec.js.map +1 -0
- 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 +220 -0
- package/build/lib/schema/cli-args.js.map +1 -0
- 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 +124 -0
- package/build/lib/schema/cli-transformers.js.map +1 -0
- package/build/lib/schema/index.d.ts +3 -0
- package/build/lib/schema/index.d.ts.map +1 -0
- package/build/lib/schema/index.js +19 -0
- package/build/lib/schema/index.js.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 +128 -0
- package/build/lib/schema/keywords.js.map +1 -0
- package/build/lib/schema/schema.d.ts +260 -0
- package/build/lib/schema/schema.d.ts.map +1 -0
- package/build/lib/schema/schema.js +640 -0
- package/build/lib/schema/schema.js.map +1 -0
- package/build/lib/utils.d.ts +276 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +372 -192
- package/build/lib/utils.js.map +1 -0
- package/build/types/cli.d.ts +134 -0
- package/build/types/cli.d.ts.map +1 -0
- package/build/types/cli.js +3 -0
- package/build/types/cli.js.map +1 -0
- package/build/types/index.d.ts +15 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +19 -0
- package/build/types/index.js.map +1 -0
- package/build/types/manifest/base.d.ts +135 -0
- package/build/types/manifest/base.d.ts.map +1 -0
- package/build/types/manifest/base.js +3 -0
- package/build/types/manifest/base.js.map +1 -0
- package/build/types/manifest/index.d.ts +21 -0
- package/build/types/manifest/index.d.ts.map +1 -0
- package/build/types/manifest/index.js +42 -0
- package/build/types/manifest/index.js.map +1 -0
- package/build/types/manifest/v3.d.ts +139 -0
- package/build/types/manifest/v3.d.ts.map +1 -0
- package/build/types/manifest/v3.js +3 -0
- package/build/types/manifest/v3.js.map +1 -0
- package/build/types/manifest/v4.d.ts +139 -0
- package/build/types/manifest/v4.d.ts.map +1 -0
- package/build/types/manifest/v4.js +3 -0
- package/build/types/manifest/v4.js.map +1 -0
- package/driver.d.ts +1 -0
- package/driver.js +14 -0
- package/index.js +11 -0
- package/lib/appium.js +545 -188
- package/lib/cli/args.js +275 -407
- package/lib/cli/driver-command.js +132 -24
- package/lib/cli/extension-command.js +751 -272
- package/lib/cli/extension.js +38 -19
- package/lib/cli/parser.js +267 -95
- package/lib/cli/plugin-command.js +122 -22
- package/lib/cli/utils.js +24 -10
- package/lib/config-file.js +220 -0
- package/lib/config.js +243 -132
- package/lib/constants.js +79 -0
- package/lib/extension/driver-config.js +247 -0
- package/lib/extension/extension-config.js +709 -0
- package/lib/extension/index.js +116 -0
- package/lib/extension/manifest-migrations.js +136 -0
- package/lib/extension/manifest.js +580 -0
- package/lib/extension/package-changed.js +64 -0
- package/lib/extension/plugin-config.js +112 -0
- package/lib/grid-register.js +49 -35
- package/lib/logger.js +1 -2
- package/lib/logsink.js +59 -36
- package/lib/main.js +392 -104
- package/lib/schema/arg-spec.js +229 -0
- package/lib/schema/cli-args.js +241 -0
- package/lib/schema/cli-transformers.js +119 -0
- package/lib/schema/index.js +2 -0
- package/lib/schema/keywords.js +136 -0
- package/lib/schema/schema.js +725 -0
- package/lib/utils.js +310 -89
- package/package.json +84 -84
- package/plugin.d.ts +1 -0
- package/plugin.js +13 -0
- package/scripts/autoinstall-extensions.js +243 -0
- package/support.d.ts +1 -0
- package/support.js +13 -0
- package/tsconfig.json +25 -0
- package/types/cli.ts +193 -0
- package/types/index.ts +20 -0
- package/types/manifest/README.md +30 -0
- package/types/manifest/base.ts +158 -0
- package/types/manifest/index.ts +28 -0
- package/types/manifest/v3.ts +161 -0
- package/types/manifest/v4.ts +161 -0
- package/CHANGELOG.md +0 -3669
- package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
- package/build/lib/cli/argparse-actions.js +0 -104
- package/build/lib/cli/npm.js +0 -207
- package/build/lib/cli/parser-helpers.js +0 -93
- package/build/lib/driver-config.js +0 -77
- package/build/lib/drivers.js +0 -99
- package/build/lib/extension-config.js +0 -253
- package/build/lib/plugin-config.js +0 -59
- package/build/lib/plugins.js +0 -16
- package/build/postinstall.js +0 -90
- package/lib/cli/argparse-actions.js +0 -77
- package/lib/cli/npm.js +0 -183
- package/lib/cli/parser-helpers.js +0 -91
- package/lib/driver-config.js +0 -46
- package/lib/drivers.js +0 -84
- package/lib/extension-config.js +0 -209
- package/lib/plugin-config.js +0 -34
- package/lib/plugins.js +0 -11
- package/postinstall.js +0 -71
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
var _ExtensionConfig_listDataCache;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ExtensionConfig = exports.INSTALL_TYPES = exports.INSTALL_TYPE_DEV = exports.INSTALL_TYPE_GIT = exports.INSTALL_TYPE_GITHUB = exports.INSTALL_TYPE_LOCAL = exports.INSTALL_TYPE_NPM = void 0;
|
|
19
|
+
const support_1 = require("@appium/support");
|
|
20
|
+
const bluebird_1 = __importDefault(require("bluebird"));
|
|
21
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
22
|
+
const path_1 = __importDefault(require("path"));
|
|
23
|
+
const resolve_from_1 = __importDefault(require("resolve-from"));
|
|
24
|
+
const semver_1 = require("semver");
|
|
25
|
+
const extension_1 = require("../cli/extension");
|
|
26
|
+
const config_1 = require("../config");
|
|
27
|
+
const logger_1 = __importDefault(require("../logger"));
|
|
28
|
+
const schema_1 = require("../schema/schema");
|
|
29
|
+
/**
|
|
30
|
+
* "npm" install type
|
|
31
|
+
* Used when extension was installed by npm package name
|
|
32
|
+
* @remarks _All_ extensions are installed _by_ `npm`, but only this one means the package name was
|
|
33
|
+
* used to specify it
|
|
34
|
+
*/
|
|
35
|
+
exports.INSTALL_TYPE_NPM = 'npm';
|
|
36
|
+
/**
|
|
37
|
+
* "local" install type
|
|
38
|
+
* Used when extension was installed from a local path
|
|
39
|
+
*/
|
|
40
|
+
exports.INSTALL_TYPE_LOCAL = 'local';
|
|
41
|
+
/**
|
|
42
|
+
* "github" install type
|
|
43
|
+
* Used when extension was installed via GitHub URL
|
|
44
|
+
*/
|
|
45
|
+
exports.INSTALL_TYPE_GITHUB = 'github';
|
|
46
|
+
/**
|
|
47
|
+
* "git" install type
|
|
48
|
+
* Used when extensions was installed via Git URL
|
|
49
|
+
*/
|
|
50
|
+
exports.INSTALL_TYPE_GIT = 'git';
|
|
51
|
+
/**
|
|
52
|
+
* "dev" install type
|
|
53
|
+
* Used when automatically detected as a working copy
|
|
54
|
+
*/
|
|
55
|
+
exports.INSTALL_TYPE_DEV = 'dev';
|
|
56
|
+
/** @type {Set<InstallType>} */
|
|
57
|
+
exports.INSTALL_TYPES = new Set([
|
|
58
|
+
exports.INSTALL_TYPE_GIT,
|
|
59
|
+
exports.INSTALL_TYPE_GITHUB,
|
|
60
|
+
exports.INSTALL_TYPE_LOCAL,
|
|
61
|
+
exports.INSTALL_TYPE_NPM,
|
|
62
|
+
exports.INSTALL_TYPE_DEV,
|
|
63
|
+
]);
|
|
64
|
+
/**
|
|
65
|
+
* This class is abstract. It should not be instantiated directly.
|
|
66
|
+
*
|
|
67
|
+
* Subclasses should provide the generic parameter to implement.
|
|
68
|
+
* @template {ExtensionType} ExtType
|
|
69
|
+
*/
|
|
70
|
+
class ExtensionConfig {
|
|
71
|
+
/**
|
|
72
|
+
* @protected
|
|
73
|
+
* @param {ExtType} extensionType - Type of extension
|
|
74
|
+
* @param {Manifest} manifest - `Manifest` instance
|
|
75
|
+
*/
|
|
76
|
+
constructor(extensionType, manifest) {
|
|
77
|
+
/**
|
|
78
|
+
* @type {import('../cli/extension-command').ExtensionList<ExtType>|undefined}
|
|
79
|
+
*/
|
|
80
|
+
_ExtensionConfig_listDataCache.set(this, void 0);
|
|
81
|
+
this.extensionType = extensionType;
|
|
82
|
+
this.installedExtensions = manifest.getExtensionData(extensionType);
|
|
83
|
+
this.manifest = manifest;
|
|
84
|
+
}
|
|
85
|
+
get manifestPath() {
|
|
86
|
+
return this.manifest.manifestPath;
|
|
87
|
+
}
|
|
88
|
+
get appiumHome() {
|
|
89
|
+
return this.manifest.appiumHome;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns a list of errors for a given extension.
|
|
93
|
+
*
|
|
94
|
+
* @param {ExtName<ExtType>} extName
|
|
95
|
+
* @param {ExtManifest<ExtType>} extManifest
|
|
96
|
+
* @returns {ExtManifestProblem[]}
|
|
97
|
+
*/
|
|
98
|
+
getProblems(extName, extManifest) {
|
|
99
|
+
return [
|
|
100
|
+
...this.getGenericConfigProblems(extManifest, extName),
|
|
101
|
+
...this.getConfigProblems(extManifest, extName),
|
|
102
|
+
...this.getSchemaProblems(extManifest, extName),
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Returns a list of warnings for a given extension.
|
|
107
|
+
*
|
|
108
|
+
* @param {ExtName<ExtType>} extName
|
|
109
|
+
* @param {ExtManifest<ExtType>} extManifest
|
|
110
|
+
* @returns {Promise<string[]>}
|
|
111
|
+
*/
|
|
112
|
+
async getWarnings(extName, extManifest) {
|
|
113
|
+
const [genericConfigWarnings, configWarnings] = await bluebird_1.default.all([
|
|
114
|
+
this.getGenericConfigWarnings(extManifest, extName),
|
|
115
|
+
this.getConfigWarnings(extManifest, extName),
|
|
116
|
+
]);
|
|
117
|
+
return [...genericConfigWarnings, ...configWarnings];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Returns a list of extension-type-specific issues. To be implemented by subclasses.
|
|
121
|
+
* @abstract
|
|
122
|
+
* @param {ExtManifest<ExtType>} extManifest
|
|
123
|
+
* @param {ExtName<ExtType>} extName
|
|
124
|
+
* @returns {Promise<string[]>}
|
|
125
|
+
*/
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
127
|
+
async getConfigWarnings(extManifest, extName) {
|
|
128
|
+
return [];
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
* @param {Map<ExtName<ExtType>,ExtManifestProblem[]>} [errorMap]
|
|
133
|
+
* @param {Map<ExtName<ExtType>,string[]>} [warningMap]
|
|
134
|
+
*/
|
|
135
|
+
getValidationResultSummaries(errorMap = new Map(), warningMap = new Map()) {
|
|
136
|
+
/**
|
|
137
|
+
* Array of computed strings
|
|
138
|
+
* @type {string[]}
|
|
139
|
+
*/
|
|
140
|
+
const errorSummaries = [];
|
|
141
|
+
for (const [extName, problems] of errorMap.entries()) {
|
|
142
|
+
if (lodash_1.default.isEmpty(problems)) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
// remove this extension from the list since it's not valid
|
|
146
|
+
errorSummaries.push(`${this.extensionType} "${extName}" had ${support_1.util.pluralize('error', problems.length)} and will not be available:`);
|
|
147
|
+
for (const problem of problems) {
|
|
148
|
+
errorSummaries.push(` - ${problem.err} (Actual value: ` + `${JSON.stringify(problem.val)})`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/** @type {string[]} */
|
|
152
|
+
const warningSummaries = [];
|
|
153
|
+
for (const [extName, warnings] of warningMap.entries()) {
|
|
154
|
+
if (lodash_1.default.isEmpty(warnings)) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
const extTypeText = lodash_1.default.capitalize(this.extensionType);
|
|
158
|
+
const problemEnumerationText = support_1.util.pluralize('potential problem', warnings.length, true);
|
|
159
|
+
warningSummaries.push(`${extTypeText} "${extName}" has ${problemEnumerationText}: `);
|
|
160
|
+
for (const warning of warnings) {
|
|
161
|
+
warningSummaries.push(` - ${warning}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return { errorSummaries, warningSummaries };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Checks extensions for problems. To be called by subclasses' `validate` method.
|
|
168
|
+
*
|
|
169
|
+
* Errors and warnings will be displayed to the user.
|
|
170
|
+
*
|
|
171
|
+
* This method mutates `exts`.
|
|
172
|
+
*
|
|
173
|
+
* @protected
|
|
174
|
+
* @param {ExtRecord<ExtType>} exts - Lookup of extension names to {@linkcode ExtManifest} objects
|
|
175
|
+
* @returns {Promise<ExtRecord<ExtType>>} The same lookup, but picking only error-free extensions
|
|
176
|
+
*/
|
|
177
|
+
async _validate(exts) {
|
|
178
|
+
/**
|
|
179
|
+
* Lookup of extension names to {@linkcode ExtManifestProblem ExtManifestProblems}
|
|
180
|
+
* @type {Map<ExtName<ExtType>,ExtManifestProblem[]>}
|
|
181
|
+
*/
|
|
182
|
+
const errorMap = new Map();
|
|
183
|
+
/**
|
|
184
|
+
* Lookup of extension names to warnings.
|
|
185
|
+
* @type {Map<ExtName<ExtType>,string[]>}
|
|
186
|
+
*/
|
|
187
|
+
const warningMap = new Map();
|
|
188
|
+
for (const [extName, extManifest] of lodash_1.default.toPairs(exts)) {
|
|
189
|
+
const [errors, warnings] = await bluebird_1.default.all([
|
|
190
|
+
this.getProblems(extName, extManifest),
|
|
191
|
+
this.getWarnings(extName, extManifest),
|
|
192
|
+
]);
|
|
193
|
+
if (errors.length) {
|
|
194
|
+
delete exts[extName];
|
|
195
|
+
}
|
|
196
|
+
errorMap.set(extName, errors);
|
|
197
|
+
warningMap.set(extName, warnings);
|
|
198
|
+
}
|
|
199
|
+
const { errorSummaries, warningSummaries } = this.getValidationResultSummaries(errorMap, warningMap);
|
|
200
|
+
if (!lodash_1.default.isEmpty(errorSummaries)) {
|
|
201
|
+
logger_1.default.error(`Appium encountered ${support_1.util.pluralize('error', errorMap.size, true)} while validating ${this.extensionType}s found in manifest ${this.manifestPath}`);
|
|
202
|
+
for (const summary of errorSummaries) {
|
|
203
|
+
logger_1.default.error(summary);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// only display warnings if there are no errors!
|
|
208
|
+
if (!lodash_1.default.isEmpty(warningSummaries)) {
|
|
209
|
+
logger_1.default.warn(`Appium encountered ${support_1.util.pluralize('warning', warningMap.size, true)} while validating ${this.extensionType}s found in manifest ${this.manifestPath}`);
|
|
210
|
+
for (const summary of warningSummaries) {
|
|
211
|
+
logger_1.default.warn(summary);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return exts;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Retrieves listing data for extensions via command class.
|
|
219
|
+
*
|
|
220
|
+
* This is an expensive operation, so the result is cached. Currently, there is no
|
|
221
|
+
* use case for invalidating the cache.
|
|
222
|
+
* @protected
|
|
223
|
+
* @returns {Promise<import('../cli/extension-command').ExtensionList<ExtType>>}
|
|
224
|
+
*/
|
|
225
|
+
async getListData() {
|
|
226
|
+
if (__classPrivateFieldGet(this, _ExtensionConfig_listDataCache, "f")) {
|
|
227
|
+
return __classPrivateFieldGet(this, _ExtensionConfig_listDataCache, "f");
|
|
228
|
+
}
|
|
229
|
+
const CommandClass = /** @type {ExtCommand<ExtType>} */ (extension_1.commandClasses[this.extensionType]);
|
|
230
|
+
const cmd = new CommandClass({ config: this, json: true });
|
|
231
|
+
const listData = await cmd.list({ showInstalled: true, showUpdates: true });
|
|
232
|
+
__classPrivateFieldSet(this, _ExtensionConfig_listDataCache, listData, "f");
|
|
233
|
+
return listData;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Returns a list of warnings for a particular extension.
|
|
237
|
+
*
|
|
238
|
+
* By definition, a non-empty list of warnings does _not_ imply the extension cannot be loaded,
|
|
239
|
+
* but it may not work as expected or otherwise throw an exception at runtime.
|
|
240
|
+
*
|
|
241
|
+
* @param {ExtManifest<ExtType>} extManifest
|
|
242
|
+
* @param {ExtName<ExtType>} extName
|
|
243
|
+
* @returns {Promise<string[]>}
|
|
244
|
+
*/
|
|
245
|
+
async getGenericConfigWarnings(extManifest, extName) {
|
|
246
|
+
const { appiumVersion, installSpec, installType, pkgName } = extManifest;
|
|
247
|
+
const warnings = [];
|
|
248
|
+
const invalidFields = [];
|
|
249
|
+
if (!lodash_1.default.isString(installSpec)) {
|
|
250
|
+
invalidFields.push('installSpec');
|
|
251
|
+
}
|
|
252
|
+
if (!exports.INSTALL_TYPES.has(installType)) {
|
|
253
|
+
invalidFields.push('installType');
|
|
254
|
+
}
|
|
255
|
+
const extTypeText = lodash_1.default.capitalize(this.extensionType);
|
|
256
|
+
if (invalidFields.length) {
|
|
257
|
+
const invalidFieldsEnumerationText = support_1.util.pluralize('invalid or missing field', invalidFields.length, true);
|
|
258
|
+
const invalidFieldsText = invalidFields.map((field) => `"${field}"`).join(', ');
|
|
259
|
+
warnings.push(`${extTypeText} "${extName}" (package \`${pkgName}\`) has ${invalidFieldsEnumerationText} (${invalidFieldsText}) in \`extensions.yaml\`; this may cause upgrades done via the \`appium\` CLI tool to fail. Please reinstall with \`appium ${this.extensionType} uninstall ${extName}\` and \`appium ${this.extensionType} install ${extName}\` to attempt a fix.`);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Helps concatenate warning messages related to peer dependencies
|
|
263
|
+
* @param {string} reason
|
|
264
|
+
* @returns string
|
|
265
|
+
*/
|
|
266
|
+
const createPeerWarning = (reason) => `${extTypeText} "${extName}" (package \`${pkgName}\`) may be incompatible with the current version of Appium (v${config_1.APPIUM_VER}) due to ${reason}`;
|
|
267
|
+
if (lodash_1.default.isString(appiumVersion) && !(0, semver_1.satisfies)(config_1.APPIUM_VER, appiumVersion)) {
|
|
268
|
+
const listData = await this.getListData();
|
|
269
|
+
const extListData =
|
|
270
|
+
/** @type {import('../cli/extension-command').ExtensionListData<ExtType>} */ (listData[extName]);
|
|
271
|
+
if (extListData?.installed) {
|
|
272
|
+
const { updateVersion, upToDate } = extListData;
|
|
273
|
+
if (!upToDate) {
|
|
274
|
+
warnings.push(createPeerWarning(`its peer dependency on older Appium v${appiumVersion}. Please upgrade \`${pkgName}\` to v${updateVersion} or newer.`));
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
warnings.push(createPeerWarning(`its peer dependency on older Appium v${appiumVersion}. Please ask the developer of \`${pkgName}\` to update the peer dependency on Appium to v${config_1.APPIUM_VER}.`));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
else if (!lodash_1.default.isString(appiumVersion)) {
|
|
282
|
+
const listData = await this.getListData();
|
|
283
|
+
const extListData =
|
|
284
|
+
/** @type {import('../cli/extension-command').InstalledExtensionListData<ExtType>} */ (listData[extName]);
|
|
285
|
+
if (!extListData?.upToDate && extListData?.updateVersion) {
|
|
286
|
+
warnings.push(createPeerWarning(`an invalid or missing peer dependency on Appium. A newer version of \`${pkgName}\` is available; please attempt to upgrade "${extName}" to v${extListData.updateVersion} or newer.`));
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
warnings.push(createPeerWarning(`an invalid or missing peer dependency on Appium. Please ask the developer of \`${pkgName}\` to add a peer dependency on \`^appium@${config_1.APPIUM_VER}\`.`));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return warnings;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Returns list of unrecoverable errors (if any) for the given extension _if_ it has a `schema` property.
|
|
296
|
+
*
|
|
297
|
+
* @param {ExtManifest<ExtType>} extManifest - Extension data (from manifest)
|
|
298
|
+
* @param {ExtName<ExtType>} extName - Extension name (from manifest)
|
|
299
|
+
* @returns {ExtManifestProblem[]}
|
|
300
|
+
*/
|
|
301
|
+
getSchemaProblems(extManifest, extName) {
|
|
302
|
+
/** @type {ExtManifestProblem[]} */
|
|
303
|
+
const problems = [];
|
|
304
|
+
const { schema: argSchemaPath } = extManifest;
|
|
305
|
+
if (ExtensionConfig.extDataHasSchema(extManifest)) {
|
|
306
|
+
if (lodash_1.default.isString(argSchemaPath)) {
|
|
307
|
+
if ((0, schema_1.isAllowedSchemaFileExtension)(argSchemaPath)) {
|
|
308
|
+
try {
|
|
309
|
+
this.readExtensionSchema(extName, extManifest);
|
|
310
|
+
}
|
|
311
|
+
catch (err) {
|
|
312
|
+
problems.push({
|
|
313
|
+
err: `Unable to register schema at path ${argSchemaPath}; ${err.message}`,
|
|
314
|
+
val: argSchemaPath,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
problems.push({
|
|
320
|
+
err: `Schema file has unsupported extension. Allowed: ${[
|
|
321
|
+
...schema_1.ALLOWED_SCHEMA_EXTENSIONS,
|
|
322
|
+
].join(', ')}`,
|
|
323
|
+
val: argSchemaPath,
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else if (lodash_1.default.isPlainObject(argSchemaPath)) {
|
|
328
|
+
try {
|
|
329
|
+
this.readExtensionSchema(extName, extManifest);
|
|
330
|
+
}
|
|
331
|
+
catch (err) {
|
|
332
|
+
problems.push({
|
|
333
|
+
err: `Unable to register embedded schema; ${err.message}`,
|
|
334
|
+
val: argSchemaPath,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
problems.push({
|
|
340
|
+
err: 'Incorrectly formatted schema field; must be a path to a schema file or a schema object.',
|
|
341
|
+
val: argSchemaPath,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return problems;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Return a list of generic unrecoverable errors for the given extension
|
|
349
|
+
* @param {ExtManifest<ExtType>} extManifest - Extension data (from manifest)
|
|
350
|
+
* @param {ExtName<ExtType>} extName - Extension name (from manifest)
|
|
351
|
+
* @returns {ExtManifestProblem[]}
|
|
352
|
+
*/
|
|
353
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
354
|
+
getGenericConfigProblems(extManifest, extName) {
|
|
355
|
+
const { version, pkgName, mainClass } = extManifest;
|
|
356
|
+
const problems = [];
|
|
357
|
+
if (!lodash_1.default.isString(version)) {
|
|
358
|
+
problems.push({
|
|
359
|
+
err: `Invalid or missing \`version\` field in my \`package.json\` and/or \`extensions.yaml\` (must be a string)`,
|
|
360
|
+
val: version,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
if (!lodash_1.default.isString(pkgName)) {
|
|
364
|
+
problems.push({
|
|
365
|
+
err: `Invalid or missing \`name\` field in my \`package.json\` and/or \`extensions.yaml\` (must be a string)`,
|
|
366
|
+
val: pkgName,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
if (!lodash_1.default.isString(mainClass)) {
|
|
370
|
+
problems.push({
|
|
371
|
+
err: `Invalid or missing \`appium.mainClass\` field in my \`package.json\` and/or \`mainClass\` field in \`extensions.yaml\` (must be a string)`,
|
|
372
|
+
val: mainClass,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return problems;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* @abstract
|
|
379
|
+
* @param {ExtManifest<ExtType>} extManifest
|
|
380
|
+
* @param {ExtName<ExtType>} extName
|
|
381
|
+
* @returns {ExtManifestProblem[]}
|
|
382
|
+
*/
|
|
383
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
384
|
+
getConfigProblems(extManifest, extName) {
|
|
385
|
+
// shoud override this method if special validation is necessary for this extension type
|
|
386
|
+
return [];
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* @param {string} extName
|
|
390
|
+
* @param {ExtManifest<ExtType>} extManifest
|
|
391
|
+
* @param {ExtensionConfigMutationOpts} opts
|
|
392
|
+
* @returns {Promise<void>}
|
|
393
|
+
*/
|
|
394
|
+
async addExtension(extName, extManifest, { write = true } = {}) {
|
|
395
|
+
this.manifest.setExtension(this.extensionType, extName, extManifest);
|
|
396
|
+
if (write) {
|
|
397
|
+
await this.manifest.write();
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* @param {ExtName<ExtType>} extName
|
|
402
|
+
* @param {ExtManifest<ExtType>} extManifest
|
|
403
|
+
* @param {ExtensionConfigMutationOpts} opts
|
|
404
|
+
* @returns {Promise<void>}
|
|
405
|
+
*/
|
|
406
|
+
async updateExtension(extName, extManifest, { write = true } = {}) {
|
|
407
|
+
this.manifest.setExtension(this.extensionType, extName, {
|
|
408
|
+
...this.installedExtensions[extName],
|
|
409
|
+
...extManifest,
|
|
410
|
+
});
|
|
411
|
+
if (write) {
|
|
412
|
+
await this.manifest.write();
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Remove an extension from the list of installed extensions, and optionally avoid a write to the manifest file.
|
|
417
|
+
*
|
|
418
|
+
* @param {ExtName<ExtType>} extName
|
|
419
|
+
* @param {ExtensionConfigMutationOpts} opts
|
|
420
|
+
* @returns {Promise<void>}
|
|
421
|
+
*/
|
|
422
|
+
async removeExtension(extName, { write = true } = {}) {
|
|
423
|
+
this.manifest.deleteExtension(this.extensionType, extName);
|
|
424
|
+
if (write) {
|
|
425
|
+
await this.manifest.write();
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* @param {ExtName<ExtType>[]} [activeNames]
|
|
430
|
+
* @returns {void}
|
|
431
|
+
*/
|
|
432
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
433
|
+
print(activeNames) {
|
|
434
|
+
if (lodash_1.default.isEmpty(this.installedExtensions)) {
|
|
435
|
+
logger_1.default.info(`No ${this.extensionType}s have been installed in ${this.appiumHome}. Use the "appium ${this.extensionType}" ` +
|
|
436
|
+
'command to install the one(s) you want to use.');
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
logger_1.default.info(`Available ${this.extensionType}s:`);
|
|
440
|
+
for (const [extName, extManifest] of /** @type {[string, ExtManifest<ExtType>][]} */ (lodash_1.default.toPairs(this.installedExtensions))) {
|
|
441
|
+
logger_1.default.info(` - ${this.extensionDesc(extName, extManifest)}`);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Returns a string describing the extension. Subclasses must implement.
|
|
446
|
+
* @param {ExtName<ExtType>} extName - Extension name
|
|
447
|
+
* @param {ExtManifest<ExtType>} extManifest - Extension data
|
|
448
|
+
* @returns {string}
|
|
449
|
+
* @abstract
|
|
450
|
+
*/
|
|
451
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
452
|
+
extensionDesc(extName, extManifest) {
|
|
453
|
+
throw new Error('This must be implemented in a subclass');
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Returns--with reasonable accuracy--the path on disk to the extension.
|
|
457
|
+
*
|
|
458
|
+
* If `installPath` is present in the manifest, then it is used; otherwise we just guess.
|
|
459
|
+
* @param {keyof typeof this.installedExtensions} extName
|
|
460
|
+
* @returns {string}
|
|
461
|
+
*/
|
|
462
|
+
getInstallPath(extName) {
|
|
463
|
+
return (this.installedExtensions[extName]?.installPath ??
|
|
464
|
+
path_1.default.join(this.appiumHome, 'node_modules', this.installedExtensions[extName].pkgName));
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Loads extension and returns its main class (constructor)
|
|
468
|
+
* @param {ExtName<ExtType>} extName
|
|
469
|
+
* @returns {ExtClass<ExtType>}
|
|
470
|
+
*/
|
|
471
|
+
require(extName) {
|
|
472
|
+
const { mainClass } = this.installedExtensions[extName];
|
|
473
|
+
const reqPath = this.getInstallPath(extName);
|
|
474
|
+
/** @type {string} */
|
|
475
|
+
let reqResolved;
|
|
476
|
+
try {
|
|
477
|
+
reqResolved = require.resolve(reqPath);
|
|
478
|
+
}
|
|
479
|
+
catch (err) {
|
|
480
|
+
throw new ReferenceError(`Could not find a ${this.extensionType} installed at ${reqPath}`);
|
|
481
|
+
}
|
|
482
|
+
// note: this will only reload the entry point
|
|
483
|
+
if (process.env.APPIUM_RELOAD_EXTENSIONS && require.cache[reqResolved]) {
|
|
484
|
+
logger_1.default.debug(`Removing ${reqResolved} from require cache`);
|
|
485
|
+
delete require.cache[reqResolved];
|
|
486
|
+
}
|
|
487
|
+
logger_1.default.debug(`Requiring ${this.extensionType} at ${reqPath}`);
|
|
488
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
489
|
+
const MainClass = require(reqPath)[mainClass];
|
|
490
|
+
if (!MainClass) {
|
|
491
|
+
throw new ReferenceError(`Could not find a class named "${mainClass}" exported by ${this.extensionType} "${extName}"`);
|
|
492
|
+
}
|
|
493
|
+
return MainClass;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* @param {string} extName
|
|
497
|
+
* @returns {boolean}
|
|
498
|
+
*/
|
|
499
|
+
isInstalled(extName) {
|
|
500
|
+
return extName in this.installedExtensions;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Intended to be called by corresponding instance methods of subclass.
|
|
504
|
+
* @private
|
|
505
|
+
* @template {ExtensionType} ExtType
|
|
506
|
+
* @param {string} appiumHome
|
|
507
|
+
* @param {ExtType} extType
|
|
508
|
+
* @param {ExtName<ExtType>} extName - Extension name (unique to its type)
|
|
509
|
+
* @param {ExtManifestWithSchema<ExtType>} extManifest - Extension config
|
|
510
|
+
* @returns {import('ajv').SchemaObject|undefined}
|
|
511
|
+
*/
|
|
512
|
+
static _readExtensionSchema(appiumHome, extType, extName, extManifest) {
|
|
513
|
+
const { pkgName, schema: argSchemaPath } = extManifest;
|
|
514
|
+
if (!argSchemaPath) {
|
|
515
|
+
throw new TypeError(`No \`schema\` property found in config for ${extType} ${pkgName} -- why is this function being called?`);
|
|
516
|
+
}
|
|
517
|
+
let moduleObject;
|
|
518
|
+
if (lodash_1.default.isString(argSchemaPath)) {
|
|
519
|
+
const schemaPath = (0, resolve_from_1.default)(appiumHome, path_1.default.join(pkgName, argSchemaPath));
|
|
520
|
+
moduleObject = require(schemaPath);
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
moduleObject = argSchemaPath;
|
|
524
|
+
}
|
|
525
|
+
// this sucks. default exports should be destroyed
|
|
526
|
+
const schema = moduleObject.__esModule ? moduleObject.default : moduleObject;
|
|
527
|
+
(0, schema_1.registerSchema)(extType, extName, schema);
|
|
528
|
+
return schema;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Returns `true` if a specific {@link ExtManifest} object has a `schema` prop.
|
|
532
|
+
* The {@link ExtManifest} object becomes a {@link ExtManifestWithSchema} object.
|
|
533
|
+
* @template {ExtensionType} ExtType
|
|
534
|
+
* @param {ExtManifest<ExtType>} extManifest
|
|
535
|
+
* @returns {extManifest is ExtManifestWithSchema<ExtType>}
|
|
536
|
+
*/
|
|
537
|
+
static extDataHasSchema(extManifest) {
|
|
538
|
+
return lodash_1.default.isString(extManifest?.schema) || lodash_1.default.isObject(extManifest?.schema);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* If an extension provides a schema, this will load the schema and attempt to
|
|
542
|
+
* register it with the schema registrar.
|
|
543
|
+
* @param {ExtName<ExtType>} extName - Name of extension
|
|
544
|
+
* @param {ExtManifestWithSchema<ExtType>} extManifest - Extension data
|
|
545
|
+
* @returns {import('ajv').SchemaObject|undefined}
|
|
546
|
+
*/
|
|
547
|
+
readExtensionSchema(extName, extManifest) {
|
|
548
|
+
return ExtensionConfig._readExtensionSchema(this.appiumHome, this.extensionType, extName, extManifest);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
exports.ExtensionConfig = ExtensionConfig;
|
|
552
|
+
_ExtensionConfig_listDataCache = new WeakMap();
|
|
553
|
+
/**
|
|
554
|
+
* An issue with the {@linkcode ExtManifest} for a particular extension.
|
|
555
|
+
*
|
|
556
|
+
* The existance of such an object implies that the extension cannot be loaded.
|
|
557
|
+
* @typedef ExtManifestProblem
|
|
558
|
+
* @property {string} err - Error message
|
|
559
|
+
* @property {any} val - Associated value
|
|
560
|
+
*/
|
|
561
|
+
/**
|
|
562
|
+
* An optional logging function provided to an {@link ExtensionConfig} subclass.
|
|
563
|
+
* @callback ExtensionLogFn
|
|
564
|
+
* @param {...any} args
|
|
565
|
+
* @returns {void}
|
|
566
|
+
*/
|
|
567
|
+
/**
|
|
568
|
+
* @typedef {import('@appium/types').ExtensionType} ExtensionType
|
|
569
|
+
* @typedef {import('./manifest').Manifest} Manifest
|
|
570
|
+
* @typedef {import('appium/types').InstallType} InstallType
|
|
571
|
+
*/
|
|
572
|
+
/**
|
|
573
|
+
* @template {ExtensionType} ExtType
|
|
574
|
+
* @typedef {import('appium/types').ExtManifest<ExtType>} ExtManifest
|
|
575
|
+
*/
|
|
576
|
+
/**
|
|
577
|
+
* @template {ExtensionType} ExtType
|
|
578
|
+
* @typedef {ExtManifest<ExtType> & {schema: NonNullable<ExtManifest<ExtType>['schema']>}} ExtManifestWithSchema
|
|
579
|
+
*/
|
|
580
|
+
/**
|
|
581
|
+
* @template {ExtensionType} ExtType
|
|
582
|
+
* @typedef {import('appium/types').ExtName<ExtType>} ExtName
|
|
583
|
+
*/
|
|
584
|
+
/**
|
|
585
|
+
* @template {ExtensionType} ExtType
|
|
586
|
+
* @typedef {import('appium/types').ExtClass<ExtType>} ExtClass
|
|
587
|
+
*/
|
|
588
|
+
/**
|
|
589
|
+
* @template {ExtensionType} ExtType
|
|
590
|
+
* @typedef {import('appium/types').ExtRecord<ExtType>} ExtRecord
|
|
591
|
+
*/
|
|
592
|
+
/**
|
|
593
|
+
* @template {ExtensionType} ExtType
|
|
594
|
+
* @typedef {import('../cli/extension').ExtCommand<ExtType>} ExtCommand
|
|
595
|
+
*/
|
|
596
|
+
/**
|
|
597
|
+
* Options for various methods in {@link ExtensionConfig}
|
|
598
|
+
* @typedef ExtensionConfigMutationOpts
|
|
599
|
+
* @property {boolean} [write=true] Whether or not to write the manifest to disk after a mutation operation
|
|
600
|
+
*/
|
|
601
|
+
//# sourceMappingURL=extension-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-config.js","sourceRoot":"","sources":["../../../lib/extension/extension-config.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6CAAqC;AACrC,wDAAyB;AACzB,oDAAuB;AACvB,gDAAwB;AACxB,gEAAuC;AACvC,mCAAiC;AACjC,gDAAgD;AAChD,sCAAqC;AACrC,uDAA4B;AAC5B,6CAI0B;AAE1B;;;;;GAKG;AACU,QAAA,gBAAgB,GAAG,KAAK,CAAC;AACtC;;;GAGG;AACU,QAAA,kBAAkB,GAA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AAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,OAAO,EACP,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AAhlBD,0CAglBC;;AAED;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads extensions and creates `ExtensionConfig` instances.
|
|
3
|
+
*
|
|
4
|
+
* - Reads the manifest file, creating if necessary
|
|
5
|
+
* - Using the parsed extension data, creates/gets the `ExtensionConfig` subclass instances
|
|
6
|
+
* - Returns these instances
|
|
7
|
+
*
|
|
8
|
+
* If `appiumHome` is needed, use `resolveAppiumHome` from the `env` module in `@appium/support`.
|
|
9
|
+
* @param {string} appiumHome
|
|
10
|
+
* @returns {Promise<ExtensionConfigs>}
|
|
11
|
+
*/
|
|
12
|
+
export function loadExtensions(appiumHome: string): Promise<ExtensionConfigs>;
|
|
13
|
+
/**
|
|
14
|
+
* Find any plugin name which has been installed, and which has been requested for activation by
|
|
15
|
+
* using the --use-plugins flag, and turn each one into its class, so we can send them as objects
|
|
16
|
+
* to the server init. We also want to send/assign them to the umbrella driver so it can use them
|
|
17
|
+
* to wrap command execution
|
|
18
|
+
*
|
|
19
|
+
* @param {import('./plugin-config').PluginConfig} pluginConfig - a plugin extension config
|
|
20
|
+
* @param {string[]} usePlugins
|
|
21
|
+
* @returns {PluginNameMap} Mapping of PluginClass to name
|
|
22
|
+
*/
|
|
23
|
+
export function getActivePlugins(pluginConfig: import('./plugin-config').PluginConfig, usePlugins?: string[]): PluginNameMap;
|
|
24
|
+
/**
|
|
25
|
+
* Find any driver name which has been installed, and turn each one into its class, so we can send
|
|
26
|
+
* them as objects to the server init in case they need to add methods/routes or update the server.
|
|
27
|
+
* If the --drivers flag was given, this method only loads the given drivers.
|
|
28
|
+
*
|
|
29
|
+
* @param {import('./driver-config').DriverConfig} driverConfig - a driver extension config
|
|
30
|
+
* @param {string[]} [useDrivers] - optional list of drivers to load
|
|
31
|
+
* @returns {DriverNameMap}
|
|
32
|
+
*/
|
|
33
|
+
export function getActiveDrivers(driverConfig: import('./driver-config').DriverConfig, useDrivers?: string[] | undefined): DriverNameMap;
|
|
34
|
+
/**
|
|
35
|
+
* A mapping of {@linkcode PluginClass } classes to their names.
|
|
36
|
+
*/
|
|
37
|
+
export type PluginNameMap = Map<PluginClass, string>;
|
|
38
|
+
/**
|
|
39
|
+
* A mapping of {@linkcode DriverClass } classes to their names.
|
|
40
|
+
*/
|
|
41
|
+
export type DriverNameMap = Map<DriverClass, string>;
|
|
42
|
+
export type PluginClass = import('@appium/types').PluginClass;
|
|
43
|
+
export type DriverClass = import('@appium/types').DriverClass;
|
|
44
|
+
export type ExtensionConfigs = {
|
|
45
|
+
driverConfig: import('./driver-config').DriverConfig;
|
|
46
|
+
pluginConfig: import('./plugin-config').PluginConfig;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/extension/index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;GAUG;AACH,2CAHW,MAAM,GACJ,QAAQ,gBAAgB,CAAC,CAUrC;AAED;;;;;;;;;GASG;AACH,+CAJW,OAAO,iBAAiB,EAAE,YAAY,eACtC,MAAM,EAAE,iBA2BlB;AAED;;;;;;;;GAQG;AACH,+CAJW,OAAO,iBAAiB,EAAE,YAAY,oDAwBhD;;;;4BAIY,IAAI,WAAW,EAAC,MAAM,CAAC;;;;4BAKvB,IAAI,WAAW,EAAC,MAAM,CAAC;0BAIvB,OAAO,eAAe,EAAE,WAAW;0BACnC,OAAO,eAAe,EAAE,WAAW;;kBAKlC,OAAO,iBAAiB,EAAE,YAAY;kBACtC,OAAO,iBAAiB,EAAE,YAAY"}
|