appium 2.0.0-beta.56 → 2.0.0-beta.58
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 +6 -8
- package/build/lib/appium.d.ts +43 -35
- package/build/lib/appium.d.ts.map +1 -1
- package/build/lib/appium.js +38 -30
- package/build/lib/appium.js.map +1 -1
- package/build/lib/cli/args.d.ts.map +1 -1
- package/build/lib/cli/args.js +10 -0
- package/build/lib/cli/args.js.map +1 -1
- package/build/lib/cli/driver-command.d.ts +7 -7
- package/build/lib/cli/driver-command.d.ts.map +1 -1
- package/build/lib/cli/driver-command.js +13 -8
- package/build/lib/cli/driver-command.js.map +1 -1
- package/build/lib/cli/extension-command.d.ts +60 -43
- package/build/lib/cli/extension-command.d.ts.map +1 -1
- package/build/lib/cli/extension-command.js +133 -65
- package/build/lib/cli/extension-command.js.map +1 -1
- package/build/lib/cli/extension.d.ts +5 -5
- package/build/lib/cli/extension.d.ts.map +1 -1
- package/build/lib/cli/extension.js +1 -1
- package/build/lib/cli/extension.js.map +1 -1
- package/build/lib/cli/plugin-command.d.ts +7 -7
- package/build/lib/cli/plugin-command.d.ts.map +1 -1
- package/build/lib/cli/plugin-command.js +13 -8
- package/build/lib/cli/plugin-command.js.map +1 -1
- package/build/lib/config.d.ts +1 -1
- package/build/lib/config.d.ts.map +1 -1
- package/build/lib/config.js +3 -2
- package/build/lib/config.js.map +1 -1
- package/build/lib/constants.d.ts +8 -1
- package/build/lib/constants.d.ts.map +1 -1
- package/build/lib/constants.js +9 -2
- package/build/lib/constants.js.map +1 -1
- package/build/lib/extension/driver-config.d.ts +6 -6
- package/build/lib/extension/driver-config.d.ts.map +1 -1
- package/build/lib/extension/driver-config.js +5 -7
- package/build/lib/extension/driver-config.js.map +1 -1
- package/build/lib/extension/extension-config.d.ts +31 -10
- package/build/lib/extension/extension-config.d.ts.map +1 -1
- package/build/lib/extension/extension-config.js +44 -24
- package/build/lib/extension/extension-config.js.map +1 -1
- package/build/lib/extension/manifest-migrations.d.ts.map +1 -1
- package/build/lib/extension/manifest-migrations.js +29 -13
- package/build/lib/extension/manifest-migrations.js.map +1 -1
- package/build/lib/extension/manifest.d.ts +5 -5
- package/build/lib/extension/manifest.d.ts.map +1 -1
- package/build/lib/extension/manifest.js +19 -12
- package/build/lib/extension/manifest.js.map +1 -1
- package/build/lib/main.d.ts.map +1 -1
- package/build/lib/main.js +3 -3
- package/build/lib/main.js.map +1 -1
- package/build/lib/schema/cli-args.d.ts +1 -1
- package/build/lib/schema/cli-args.d.ts.map +1 -1
- package/build/lib/schema/cli-args.js +1 -1
- package/build/lib/utils.d.ts +118 -12
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +8 -10
- package/build/lib/utils.js.map +1 -1
- package/build/types/manifest/index.d.ts +4 -2
- package/build/types/manifest/index.d.ts.map +1 -1
- package/build/types/manifest/index.js +4 -2
- package/build/types/manifest/index.js.map +1 -1
- 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/lib/appium.js +43 -32
- package/lib/cli/args.js +10 -0
- package/lib/cli/driver-command.js +13 -8
- package/lib/cli/extension-command.js +146 -75
- package/lib/cli/extension.js +5 -5
- package/lib/cli/plugin-command.js +13 -8
- package/lib/config.js +3 -2
- package/lib/constants.js +9 -1
- package/lib/extension/driver-config.js +5 -8
- package/lib/extension/extension-config.js +42 -15
- package/lib/extension/manifest-migrations.js +31 -15
- package/lib/extension/manifest.js +26 -19
- package/lib/main.js +7 -4
- package/lib/schema/cli-args.js +1 -1
- package/lib/utils.js +8 -10
- package/package.json +11 -11
- package/scripts/autoinstall-extensions.js +23 -0
- package/types/manifest/index.ts +4 -3
- package/types/manifest/v4.ts +161 -0
package/build/lib/utils.d.ts
CHANGED
|
@@ -67,23 +67,129 @@ export function isDriverCommandArgs<Cmd extends import("appium/types").CliComman
|
|
|
67
67
|
export function isPluginCommandArgs<Cmd extends import("appium/types").CliCommand, SubCmd extends import("appium/types").CliExtensionSubcommand>(args: import("appium/types").Args<Cmd, SubCmd>): args is import("appium/types").ParsedArgs<"plugin", SubCmd>;
|
|
68
68
|
export type StringRecord = import('@appium/types').StringRecord;
|
|
69
69
|
export type BaseDriverCapConstraints = import('@appium/types').BaseDriverCapConstraints;
|
|
70
|
-
export type ParsedDriverCaps<C extends
|
|
70
|
+
export type ParsedDriverCaps<C extends import("@appium/types").Constraints = {
|
|
71
|
+
readonly platformName: {
|
|
72
|
+
readonly presence: true;
|
|
73
|
+
readonly isString: true;
|
|
74
|
+
};
|
|
75
|
+
readonly app: {
|
|
76
|
+
readonly isString: true;
|
|
77
|
+
};
|
|
78
|
+
readonly deviceName: {
|
|
79
|
+
readonly isString: true;
|
|
80
|
+
};
|
|
81
|
+
readonly platformVersion: {
|
|
82
|
+
readonly isString: true;
|
|
83
|
+
};
|
|
84
|
+
readonly webSocketUrl: {
|
|
85
|
+
readonly isBoolean: true;
|
|
86
|
+
};
|
|
87
|
+
readonly newCommandTimeout: {
|
|
88
|
+
readonly isNumber: true;
|
|
89
|
+
};
|
|
90
|
+
readonly automationName: {
|
|
91
|
+
readonly isString: true;
|
|
92
|
+
};
|
|
93
|
+
readonly autoLaunch: {
|
|
94
|
+
readonly isBoolean: true;
|
|
95
|
+
};
|
|
96
|
+
readonly udid: {
|
|
97
|
+
readonly isString: true;
|
|
98
|
+
};
|
|
99
|
+
readonly orientation: {
|
|
100
|
+
readonly inclusion: readonly ["LANDSCAPE", "PORTRAIT"];
|
|
101
|
+
}; /** @type {(object: any, options: import('util').InspectOptions) => string} */
|
|
102
|
+
readonly autoWebview: {
|
|
103
|
+
readonly isBoolean: true;
|
|
104
|
+
};
|
|
105
|
+
readonly noReset: {
|
|
106
|
+
readonly isBoolean: true;
|
|
107
|
+
};
|
|
108
|
+
readonly fullReset: {
|
|
109
|
+
readonly isBoolean: true;
|
|
110
|
+
};
|
|
111
|
+
readonly language: {
|
|
112
|
+
readonly isString: true;
|
|
113
|
+
};
|
|
114
|
+
readonly locale: {
|
|
115
|
+
readonly isString: true;
|
|
116
|
+
};
|
|
117
|
+
readonly eventTimings: {
|
|
118
|
+
readonly isBoolean: true;
|
|
119
|
+
};
|
|
120
|
+
readonly printPageSourceOnFindFailure: {
|
|
121
|
+
readonly isBoolean: true;
|
|
122
|
+
};
|
|
123
|
+
}, J = any> = {
|
|
71
124
|
desiredCaps: Capabilities<C>;
|
|
72
125
|
protocol: string;
|
|
73
126
|
processedJsonwpCapabilities?: J | undefined;
|
|
74
|
-
processedW3CCapabilities?: W3CCapabilities<C
|
|
127
|
+
processedW3CCapabilities?: import("@appium/types").W3CCapabilities<C> | undefined;
|
|
75
128
|
};
|
|
76
|
-
export type InvalidCaps<C extends
|
|
129
|
+
export type InvalidCaps<C extends import("@appium/types").Constraints = {
|
|
130
|
+
readonly platformName: {
|
|
131
|
+
readonly presence: true;
|
|
132
|
+
readonly isString: true;
|
|
133
|
+
};
|
|
134
|
+
readonly app: {
|
|
135
|
+
readonly isString: true;
|
|
136
|
+
};
|
|
137
|
+
readonly deviceName: {
|
|
138
|
+
readonly isString: true;
|
|
139
|
+
};
|
|
140
|
+
readonly platformVersion: {
|
|
141
|
+
readonly isString: true;
|
|
142
|
+
};
|
|
143
|
+
readonly webSocketUrl: {
|
|
144
|
+
readonly isBoolean: true;
|
|
145
|
+
};
|
|
146
|
+
readonly newCommandTimeout: {
|
|
147
|
+
readonly isNumber: true;
|
|
148
|
+
};
|
|
149
|
+
readonly automationName: {
|
|
150
|
+
readonly isString: true;
|
|
151
|
+
};
|
|
152
|
+
readonly autoLaunch: {
|
|
153
|
+
readonly isBoolean: true;
|
|
154
|
+
};
|
|
155
|
+
readonly udid: {
|
|
156
|
+
readonly isString: true;
|
|
157
|
+
};
|
|
158
|
+
readonly orientation: {
|
|
159
|
+
readonly inclusion: readonly ["LANDSCAPE", "PORTRAIT"];
|
|
160
|
+
}; /** @type {(object: any, options: import('util').InspectOptions) => string} */
|
|
161
|
+
readonly autoWebview: {
|
|
162
|
+
readonly isBoolean: true;
|
|
163
|
+
};
|
|
164
|
+
readonly noReset: {
|
|
165
|
+
readonly isBoolean: true;
|
|
166
|
+
};
|
|
167
|
+
readonly fullReset: {
|
|
168
|
+
readonly isBoolean: true;
|
|
169
|
+
};
|
|
170
|
+
readonly language: {
|
|
171
|
+
readonly isString: true;
|
|
172
|
+
};
|
|
173
|
+
readonly locale: {
|
|
174
|
+
readonly isString: true;
|
|
175
|
+
};
|
|
176
|
+
readonly eventTimings: {
|
|
177
|
+
readonly isBoolean: true;
|
|
178
|
+
};
|
|
179
|
+
readonly printPageSourceOnFindFailure: {
|
|
180
|
+
readonly isBoolean: true;
|
|
181
|
+
};
|
|
182
|
+
}, J = any> = {
|
|
77
183
|
error: Error;
|
|
78
184
|
protocol: string;
|
|
79
|
-
desiredCaps?:
|
|
185
|
+
desiredCaps?: import("@appium/types").ConstraintsToCaps<C> | undefined;
|
|
80
186
|
processedJsonwpCapabilities?: J | undefined;
|
|
81
|
-
processedW3CCapabilities?: W3CCapabilities<C
|
|
187
|
+
processedW3CCapabilities?: import("@appium/types").W3CCapabilities<C> | undefined;
|
|
82
188
|
};
|
|
83
|
-
export type Capabilities<C extends
|
|
84
|
-
export type W3CCapabilities<C extends
|
|
85
|
-
export type NSCapabilities<C extends
|
|
86
|
-
export type ConstraintsToCaps<C extends
|
|
189
|
+
export type Capabilities<C extends import("@appium/types").Constraints> = import('@appium/types').Capabilities<C>;
|
|
190
|
+
export type W3CCapabilities<C extends import("@appium/types").Constraints> = import('@appium/types').W3CCapabilities<C>;
|
|
191
|
+
export type NSCapabilities<C extends import("@appium/types").Constraints> = import('@appium/types').NSCapabilities<C>;
|
|
192
|
+
export type ConstraintsToCaps<C extends import("@appium/types").Constraints> = import('@appium/types').ConstraintsToCaps<C>;
|
|
87
193
|
export type StringKeyOf<T> = import('type-fest').StringKeyOf<T>;
|
|
88
194
|
export type Constraints = import('@appium/types').Constraints;
|
|
89
195
|
export type CliCommand = import('appium/types').CliCommand;
|
|
@@ -112,14 +218,14 @@ export const inspect: (t1: any) => void;
|
|
|
112
218
|
* @param {NSCapabilities<C>} [defaultCapabilities]
|
|
113
219
|
* @returns {ParsedDriverCaps<C,J>|InvalidCaps<C,J>}
|
|
114
220
|
*/
|
|
115
|
-
export function parseCapsForInnerDriver<C extends
|
|
221
|
+
export function parseCapsForInnerDriver<C extends import("@appium/types").Constraints, J = any>(jsonwpCapabilities: J, w3cCapabilities: import("@appium/types").W3CCapabilities<C>, constraints?: C, defaultCapabilities?: Partial<import("@appium/types").CapsToNSCaps<import("@appium/types").ConstraintsToCaps<C>, "appium">> | undefined): ParsedDriverCaps<C, J> | InvalidCaps<C, J>;
|
|
116
222
|
/**
|
|
117
223
|
* Takes a capabilities objects and prefixes capabilities with `appium:`
|
|
118
224
|
* @template {Constraints} [C={}]
|
|
119
225
|
* @param {Capabilities<C>} caps - Desired capabilities object
|
|
120
226
|
* @returns {NSCapabilities<C>}
|
|
121
227
|
*/
|
|
122
|
-
export function insertAppiumPrefixes<C extends
|
|
228
|
+
export function insertAppiumPrefixes<C extends import("@appium/types").Constraints = {}>(caps: import("@appium/types").ConstraintsToCaps<C>): Partial<import("@appium/types").CapsToNSCaps<import("@appium/types").ConstraintsToCaps<C>, "appium">>;
|
|
123
229
|
/**
|
|
124
230
|
*
|
|
125
231
|
* @param {string} pkgName
|
|
@@ -148,7 +254,7 @@ export function pullSettings(caps: any | null): any;
|
|
|
148
254
|
* @param {NSCapabilities<C>} caps
|
|
149
255
|
* @returns {Capabilities<C>}
|
|
150
256
|
*/
|
|
151
|
-
export function removeAppiumPrefixes<C extends
|
|
257
|
+
export function removeAppiumPrefixes<C extends import("@appium/types").Constraints = {}>(caps: Partial<import("@appium/types").CapsToNSCaps<import("@appium/types").ConstraintsToCaps<C>, "appium">>): import("@appium/types").ConstraintsToCaps<C>;
|
|
152
258
|
/**
|
|
153
259
|
* Adjusts NODE_PATH environment variable,
|
|
154
260
|
* so drivers and plugins could load their peer dependencies.
|
package/build/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.js"],"names":[],"mappings":"AAqSA;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEC;AAED;;;;;GAKG;AACH,gVAEC;AAED;;;;;GAKG;AACH,8PAEC;AAED;;;;;GAKG;AACH,8PAEC;2BAaY,OAAO,eAAe,EAAE,YAAY;uCACpC,OAAO,eAAe,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA9TzD,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;iBAqUpE,aAAa,CAAC,CAAC;cACf,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAtUhB,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;WAgVpE,KAAK;cACL,MAAM;;;;;0EAQP,OAAO,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;6EAKvC,OAAO,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC;4EAK1C,OAAO,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC;+EAKzC,OAAO,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC;6BAK5C,OAAO,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;0BAIlC,OAAO,eAAe,EAAE,WAAW;yBAInC,OAAO,cAAc,EAAE,UAAU;qCACjC,OAAO,cAAc,EAAE,sBAAsB;kCAC7C,OAAO,cAAc,EAAE,mBAAmB;4BAC1C,OAAO,cAAc,EAAE,gBAAgB;4BACvC,OAAO,cAAc,EAAE,gBAAgB;4BACvC,OAAO,cAAc,EAAE,gBAAgB;yJAMvC,OAAO,cAAc,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;+JAMxC,OAAO,cAAc,EAAE,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;AA7Y3D;;;;GAIG;AACH,wCAQE;AAEF;;;;;;;;;;;GAWG;AACH,0XAgHC;AAED;;;;;GAKG;AACH,oPAQC;AAoBD;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,GAAC,SAAS,CAK5B;AAwDD;;;;;;;;;;;;;;;GAeG;AACH,oDAgBC;AAlHD;;;;GAIG;AACH,oPAEC;AAqBD;;;;;;GAMG;AACH,kCAFa,IAAI,CA+ChB"}
|
package/build/lib/utils.js
CHANGED
|
@@ -197,7 +197,8 @@ function adjustNodePath() {
|
|
|
197
197
|
// ! statements in client modules. It uses a private API though,
|
|
198
198
|
// ! so it could break (maybe, eventually).
|
|
199
199
|
// See https://gist.github.com/branneman/8048520#7-the-hack
|
|
200
|
-
// @ts-ignore
|
|
200
|
+
// @ts-ignore see above comment
|
|
201
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
201
202
|
require('module').Module._initPaths();
|
|
202
203
|
return true;
|
|
203
204
|
}
|
|
@@ -327,19 +328,16 @@ exports.isPluginCommandArgs = isPluginCommandArgs;
|
|
|
327
328
|
* @property {W3CCapabilities<C>} [processedW3CCapabilities]
|
|
328
329
|
*/
|
|
329
330
|
/**
|
|
330
|
-
* @template {Constraints}
|
|
331
|
-
* @
|
|
332
|
-
* @typedef {import('@appium/types').Capabilities<C, Extra>} Capabilities
|
|
331
|
+
* @template {Constraints} C
|
|
332
|
+
* @typedef {import('@appium/types').Capabilities<C>} Capabilities
|
|
333
333
|
*/
|
|
334
334
|
/**
|
|
335
|
-
* @template {Constraints}
|
|
336
|
-
* @
|
|
337
|
-
* @typedef {import('@appium/types').W3CCapabilities<C, Extra>} W3CCapabilities
|
|
335
|
+
* @template {Constraints} C
|
|
336
|
+
* @typedef {import('@appium/types').W3CCapabilities<C>} W3CCapabilities
|
|
338
337
|
*/
|
|
339
338
|
/**
|
|
340
|
-
* @template {Constraints}
|
|
341
|
-
* @
|
|
342
|
-
* @typedef {import('@appium/types').NSCapabilities<C, Extra>} NSCapabilities
|
|
339
|
+
* @template {Constraints} C
|
|
340
|
+
* @typedef {import('@appium/types').NSCapabilities<C>} NSCapabilities
|
|
343
341
|
*/
|
|
344
342
|
/**
|
|
345
343
|
* @template {Constraints} C
|
package/build/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,sDAA8B;AAC9B,qDAAkF;AAClF,+BAAqC;AACrC,6CAAqC;AACrC,gDAAwB;AACxB,2CAAwE;AAExE,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AACnC,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,2BAAa,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;AAEzC;;;;GAIG;AACH,MAAM,OAAO,GAAG,gBAAC,CAAC,IAAI,CACpB,gBAAC,CAAC,YAAY;AACZ,8EAA8E,CAAC,CAAC,cAAI,CAAC,EACrF,EAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,WAAW,EAAC,CACnD,EACD,CAAC,GAAG,IAAI,EAAE,EAAE;IACV,gBAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AACvB,CAAC,CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,sDAA8B;AAC9B,qDAAkF;AAClF,+BAAqC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AAmB,CAAC,IAAI;IACtC,OAAO,IAAI,CAAC,UAAU,KAAK,uBAAW,CAAC;AACzC,CAAC;AAFD,kDAEC;AAYD;;;GAGG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;;;GAUG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;GAOG;AAEH;;;;GAIG;AAEH;;;;GAIG"}
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as ManifestV2 from './base';
|
|
6
6
|
import * as ManifestV3 from './v3';
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
import * as ManifestV4 from './v4';
|
|
8
|
+
export * from './v4';
|
|
9
|
+
export { ManifestV2, ManifestV3, ManifestV4 };
|
|
9
10
|
export interface ManifestDataVersions {
|
|
10
11
|
2: ManifestV2.ManifestData;
|
|
11
12
|
3: ManifestV3.ManifestData;
|
|
13
|
+
4: ManifestV4.ManifestData;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* One of the known versions of the `extensions.yaml` schema.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/manifest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/manifest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,MAAM,CAAC;AAGnC,cAAc,MAAM,CAAC;AAGrB,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC;AAE5C,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;IAC3B,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;IAC3B,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;CAC5B;AAGD;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC"}
|
|
@@ -30,11 +30,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
30
30
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.ManifestV3 = exports.ManifestV2 = void 0;
|
|
33
|
+
exports.ManifestV4 = exports.ManifestV3 = exports.ManifestV2 = void 0;
|
|
34
34
|
const ManifestV2 = __importStar(require("./base"));
|
|
35
35
|
exports.ManifestV2 = ManifestV2;
|
|
36
36
|
const ManifestV3 = __importStar(require("./v3"));
|
|
37
37
|
exports.ManifestV3 = ManifestV3;
|
|
38
|
+
const ManifestV4 = __importStar(require("./v4"));
|
|
39
|
+
exports.ManifestV4 = ManifestV4;
|
|
38
40
|
// add `import * as ManifestV<new-version> from './v<new-version>';` above
|
|
39
|
-
__exportStar(require("./
|
|
41
|
+
__exportStar(require("./v4"), exports);
|
|
40
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../types/manifest/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAQ7B,gCAAU;AAPlB,iDAAmC;AAOf,gCAAU;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../types/manifest/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAQ7B,gCAAU;AAPlB,iDAAmC;AAOf,gCAAU;AAN9B,iDAAmC;AAMH,gCAAU;AAL1C,0EAA0E;AAE1E,uCAAqB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { DriverType, ExtensionType, PluginType } from '@appium/types';
|
|
2
|
+
import { SchemaObject } from 'ajv';
|
|
3
|
+
import { PackageJson, SetRequired } from 'type-fest';
|
|
4
|
+
/**
|
|
5
|
+
* One of the possible extension installation stratgies
|
|
6
|
+
*/
|
|
7
|
+
export type InstallType = 'npm' | 'git' | 'local' | 'github' | 'dev';
|
|
8
|
+
export interface InternalMetadata {
|
|
9
|
+
/**
|
|
10
|
+
* Package name of extension
|
|
11
|
+
*
|
|
12
|
+
* `name` from its `package.json`
|
|
13
|
+
*/
|
|
14
|
+
pkgName: string;
|
|
15
|
+
/**
|
|
16
|
+
* Version of extension
|
|
17
|
+
*
|
|
18
|
+
* `version` from its `package.json`
|
|
19
|
+
*/
|
|
20
|
+
version: string;
|
|
21
|
+
/**
|
|
22
|
+
* The method in which the user installed the extension (the `source` CLI arg)
|
|
23
|
+
*/
|
|
24
|
+
installType: InstallType;
|
|
25
|
+
/**
|
|
26
|
+
* Whatever the user typed as the extension to install. May be derived from `package.json`
|
|
27
|
+
*/
|
|
28
|
+
installSpec: string;
|
|
29
|
+
/**
|
|
30
|
+
* Maximum version of Appium that this extension is compatible with.
|
|
31
|
+
*
|
|
32
|
+
* If `undefined`, we'll try anyway.
|
|
33
|
+
*/
|
|
34
|
+
appiumVersion?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Path to the extension's root directory
|
|
37
|
+
*/
|
|
38
|
+
installPath: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Shape of the `appium.schema` property in an extension's `package.json` (if it exists)
|
|
42
|
+
*/
|
|
43
|
+
export type ExtSchemaMetadata = string | (SchemaObject & {
|
|
44
|
+
[key: number]: never;
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Manifest data shared by all extensions, as contained in `package.json`
|
|
48
|
+
*/
|
|
49
|
+
export interface CommonExtMetadata {
|
|
50
|
+
/**
|
|
51
|
+
* The main class of the extension.
|
|
52
|
+
*
|
|
53
|
+
* The extension must export this class by name.
|
|
54
|
+
*/
|
|
55
|
+
mainClass: string;
|
|
56
|
+
/**
|
|
57
|
+
* Lookup table of scripts to run via `appium <driver|plugin> run <script>` keyed by name.
|
|
58
|
+
*/
|
|
59
|
+
scripts?: Record<string, string>;
|
|
60
|
+
/**
|
|
61
|
+
* Schema describing configuration options (and CLI args) for the extension.
|
|
62
|
+
*
|
|
63
|
+
* Can also just be a path (relative to the extension root) to an external JSON schema file.
|
|
64
|
+
*/
|
|
65
|
+
schema?: ExtSchemaMetadata;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Driver-specific manifest data as stored in a driver's `package.json`
|
|
69
|
+
*/
|
|
70
|
+
export interface DriverMetadata {
|
|
71
|
+
/**
|
|
72
|
+
* Automation name of the driver
|
|
73
|
+
*/
|
|
74
|
+
automationName: string;
|
|
75
|
+
/**
|
|
76
|
+
* Platforms the driver supports
|
|
77
|
+
*/
|
|
78
|
+
platformNames: string[];
|
|
79
|
+
/**
|
|
80
|
+
* Short name of the driver (displayed in `appium list`, etc.)
|
|
81
|
+
*/
|
|
82
|
+
driverName: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Plugin-specific manifest data as stored in a plugin's `package.json`
|
|
86
|
+
*/
|
|
87
|
+
export interface PluginMetadata {
|
|
88
|
+
/**
|
|
89
|
+
* Short name of the plugin (displayed in `appium list`, etc.)
|
|
90
|
+
*/
|
|
91
|
+
pluginName: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Generic extension metadata as stored in the `appium` prop of an extension's `package.json`.
|
|
95
|
+
*/
|
|
96
|
+
export type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType ? DriverMetadata : ExtType extends PluginType ? PluginMetadata : never) & CommonExtMetadata;
|
|
97
|
+
/**
|
|
98
|
+
* Combination of external + internal extension data with `driverName`/`pluginName` removed (it becomes a key in an {@linkcode ExtRecord} object).
|
|
99
|
+
* Part of `extensions.yaml`.
|
|
100
|
+
*/
|
|
101
|
+
export type ExtManifest<ExtType extends ExtensionType> = Omit<ExtMetadata<ExtType>, 'driverName' | 'pluginName'> & InternalMetadata;
|
|
102
|
+
/**
|
|
103
|
+
* Lookup of extension name to {@linkcode ExtManifest}.
|
|
104
|
+
* @see {ManifestData}
|
|
105
|
+
*/
|
|
106
|
+
export type ExtRecord<ExtType extends ExtensionType> = Record<string, ExtManifest<ExtType>>;
|
|
107
|
+
/**
|
|
108
|
+
* The shape of the `extensions.yaml` file
|
|
109
|
+
*/
|
|
110
|
+
export interface ManifestData {
|
|
111
|
+
drivers: ExtRecord<DriverType>;
|
|
112
|
+
plugins: ExtRecord<PluginType>;
|
|
113
|
+
schemaRev: number;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The name of an installed extension, as it appears in `extensions.yaml`
|
|
117
|
+
* (as a property name under `drivers` or `plugins`)
|
|
118
|
+
*/
|
|
119
|
+
export type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<ExtType>;
|
|
120
|
+
/**
|
|
121
|
+
* A `package.json` containing extension metadata.
|
|
122
|
+
* Must have the following properties:
|
|
123
|
+
* - `name`: the name of the extension
|
|
124
|
+
* - `version`: the version of the extension
|
|
125
|
+
* - `appium`: the metadata for the extension
|
|
126
|
+
* - `peerDependencies.appium`: the maximum compatible version of Appium
|
|
127
|
+
*/
|
|
128
|
+
export type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<PackageJson, 'name' | 'version'> & {
|
|
129
|
+
appium: ExtMetadata<ExtType>;
|
|
130
|
+
peerDependencies: {
|
|
131
|
+
appium: string;
|
|
132
|
+
[key: string]: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* A transient format between installation and insertion of extension metadata into the manifest.
|
|
137
|
+
*/
|
|
138
|
+
export type ExtInstallReceipt<ExtType extends ExtensionType> = ExtMetadata<ExtType> & InternalMetadata;
|
|
139
|
+
//# sourceMappingURL=v4.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v4.d.ts","sourceRoot":"","sources":["../../../types/manifest/v4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,aAAa,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,KAAK,CAAC;AACjC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAErE,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,CAAC,YAAY,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAC,CAAC,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;O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;CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,aAAa,IAAI,WAAW,CAAC,OAAO,CAAC,GACjF,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v4.js","sourceRoot":"","sources":["../../../types/manifest/v4.ts"],"names":[],"mappings":""}
|
package/lib/appium.js
CHANGED
|
@@ -28,15 +28,12 @@ const desiredCapabilityConstraints = /** @type {const} */ ({
|
|
|
28
28
|
isString: true,
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
|
-
/**
|
|
32
|
-
* @typedef {typeof desiredCapabilityConstraints} AppiumDriverConstraints
|
|
33
|
-
*/
|
|
34
31
|
|
|
35
32
|
const sessionsListGuard = new AsyncLock();
|
|
36
33
|
const pendingDriversGuard = new AsyncLock();
|
|
37
34
|
|
|
38
35
|
/**
|
|
39
|
-
* @
|
|
36
|
+
* @extends {DriverCore<AppiumDriverConstraints>}
|
|
40
37
|
*/
|
|
41
38
|
class AppiumDriver extends DriverCore {
|
|
42
39
|
/**
|
|
@@ -92,11 +89,11 @@ class AppiumDriver extends DriverCore {
|
|
|
92
89
|
*/
|
|
93
90
|
desiredCapConstraints;
|
|
94
91
|
|
|
95
|
-
/** @type {DriverOpts} */
|
|
92
|
+
/** @type {import('@appium/types').DriverOpts<AppiumDriverConstraints>} */
|
|
96
93
|
args;
|
|
97
94
|
|
|
98
95
|
/**
|
|
99
|
-
* @param {DriverOpts} opts
|
|
96
|
+
* @param {import('@appium/types').DriverOpts<AppiumDriverConstraints>} opts
|
|
100
97
|
*/
|
|
101
98
|
constructor(opts) {
|
|
102
99
|
// It is necessary to set `--tmp` here since it should be set to
|
|
@@ -163,11 +160,10 @@ class AppiumDriver extends DriverCore {
|
|
|
163
160
|
};
|
|
164
161
|
}
|
|
165
162
|
|
|
166
|
-
// eslint-disable-next-line require-await
|
|
167
163
|
async getSessions() {
|
|
168
164
|
return _.toPairs(this.sessions).map(([id, driver]) => ({
|
|
169
165
|
id,
|
|
170
|
-
capabilities: driver.caps,
|
|
166
|
+
capabilities: /** @type {import('@appium/types').DriverCaps} */ (driver.caps),
|
|
171
167
|
}));
|
|
172
168
|
}
|
|
173
169
|
|
|
@@ -224,12 +220,12 @@ class AppiumDriver extends DriverCore {
|
|
|
224
220
|
|
|
225
221
|
/**
|
|
226
222
|
* Create a new session
|
|
227
|
-
* @param {
|
|
228
|
-
* @param {
|
|
229
|
-
* @param {
|
|
230
|
-
* @
|
|
223
|
+
* @param {W3CAppiumDriverCaps} jsonwpCaps JSONWP formatted desired capabilities
|
|
224
|
+
* @param {W3CAppiumDriverCaps} [reqCaps] Required capabilities (JSONWP standard)
|
|
225
|
+
* @param {W3CAppiumDriverCaps} [w3cCapabilities] W3C capabilities
|
|
226
|
+
* @returns {Promise<SessionHandlerCreateResult>}
|
|
231
227
|
*/
|
|
232
|
-
async createSession(jsonwpCaps, reqCaps, w3cCapabilities
|
|
228
|
+
async createSession(jsonwpCaps, reqCaps, w3cCapabilities) {
|
|
233
229
|
const defaultCapabilities = _.cloneDeep(this.args.defaultCapabilities);
|
|
234
230
|
const defaultSettings = pullSettings(defaultCapabilities);
|
|
235
231
|
jsonwpCaps = _.cloneDeep(jsonwpCaps);
|
|
@@ -247,13 +243,14 @@ class AppiumDriver extends DriverCore {
|
|
|
247
243
|
Object.assign(w3cSettings, pullSettings(firstMatchEntry));
|
|
248
244
|
}
|
|
249
245
|
|
|
246
|
+
/** @type {string|undefined} */
|
|
250
247
|
let protocol;
|
|
251
248
|
let innerSessionId, dCaps;
|
|
252
249
|
try {
|
|
253
250
|
// Parse the caps into a format that the InnerDriver will accept
|
|
254
251
|
const parsedCaps = parseCapsForInnerDriver(
|
|
255
252
|
jsonwpCaps,
|
|
256
|
-
promoteAppiumOptions(w3cCapabilities),
|
|
253
|
+
promoteAppiumOptions(/** @type {W3CAppiumDriverCaps} */ (w3cCapabilities)),
|
|
257
254
|
this.desiredCapConstraints,
|
|
258
255
|
defaultCapabilities ? promoteAppiumOptionsForObject(defaultCapabilities) : undefined
|
|
259
256
|
);
|
|
@@ -289,7 +286,7 @@ class AppiumDriver extends DriverCore {
|
|
|
289
286
|
*/
|
|
290
287
|
let otherPendingDriversData = [];
|
|
291
288
|
|
|
292
|
-
const driverInstance = new InnerDriver(this.args, true);
|
|
289
|
+
const driverInstance = /** @type {ExternalDriver} */ (new InnerDriver(this.args, true));
|
|
293
290
|
|
|
294
291
|
// We want to assign security values directly on the driver. The driver
|
|
295
292
|
// should not read security values from `this.opts` because those values
|
|
@@ -399,7 +396,7 @@ class AppiumDriver extends DriverCore {
|
|
|
399
396
|
|
|
400
397
|
/**
|
|
401
398
|
*
|
|
402
|
-
* @param {
|
|
399
|
+
* @param {ExternalDriver} driver
|
|
403
400
|
* @param {string} innerSessionId
|
|
404
401
|
*/
|
|
405
402
|
attachUnexpectedShutdownHandler(driver, innerSessionId) {
|
|
@@ -442,10 +439,11 @@ class AppiumDriver extends DriverCore {
|
|
|
442
439
|
|
|
443
440
|
/**
|
|
444
441
|
*
|
|
445
|
-
* @param {
|
|
442
|
+
* @param {((...args: any[]) => any)|(new(...args: any[]) => any)} InnerDriver
|
|
446
443
|
* @returns {Promise<DriverData[]>}}
|
|
444
|
+
* @privateRemarks The _intent_ is that `InnerDriver` is the class of a driver, but it only really
|
|
445
|
+
* needs to be a function or constructor.
|
|
447
446
|
*/
|
|
448
|
-
// eslint-disable-next-line require-await
|
|
449
447
|
async curSessionDataForDriver(InnerDriver) {
|
|
450
448
|
const data = _.compact(
|
|
451
449
|
_.values(this.sessions)
|
|
@@ -588,7 +586,7 @@ class AppiumDriver extends DriverCore {
|
|
|
588
586
|
*
|
|
589
587
|
* @param {string} cmd
|
|
590
588
|
* @param {...any} args
|
|
591
|
-
* @returns {Promise<{value: any, error?: Error, protocol: string} | import('type-fest').AsyncReturnType<
|
|
589
|
+
* @returns {Promise<{value: any, error?: Error, protocol: string} | import('type-fest').AsyncReturnType<ExternalDriver['executeCommand']>>}
|
|
592
590
|
*/
|
|
593
591
|
async executeCommand(cmd, ...args) {
|
|
594
592
|
// We have basically three cases for how to handle commands:
|
|
@@ -618,6 +616,7 @@ class AppiumDriver extends DriverCore {
|
|
|
618
616
|
let dstSession = null;
|
|
619
617
|
let protocol = null;
|
|
620
618
|
/** @type {this | ExternalDriver} */
|
|
619
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
621
620
|
let driver = this;
|
|
622
621
|
if (isSessionCmd) {
|
|
623
622
|
sessionId = _.last(args);
|
|
@@ -840,21 +839,38 @@ export class NoDriverProxyCommandError extends Error {
|
|
|
840
839
|
export {AppiumDriver};
|
|
841
840
|
|
|
842
841
|
/**
|
|
843
|
-
* @typedef {import('@appium/types').ExternalDriver} ExternalDriver
|
|
844
|
-
* @typedef {import('@appium/types').Driver} Driver
|
|
845
|
-
* @typedef {import('@appium/types').DriverClass} DriverClass
|
|
846
842
|
* @typedef {import('@appium/types').DriverData} DriverData
|
|
847
843
|
* @typedef {import('@appium/types').ServerArgs} DriverOpts
|
|
848
844
|
* @typedef {import('@appium/types').Constraints} Constraints
|
|
849
845
|
* @typedef {import('@appium/types').AppiumServer} AppiumServer
|
|
850
846
|
* @typedef {import('@appium/types').ExtensionType} ExtensionType
|
|
851
847
|
* @typedef {import('./extension/driver-config').DriverConfig} DriverConfig
|
|
852
|
-
* @typedef {import('@appium/types').Plugin} Plugin
|
|
853
|
-
* @typedef {import('@appium/types').PluginClass} PluginClass
|
|
854
848
|
* @typedef {import('@appium/types').PluginType} PluginType
|
|
855
849
|
* @typedef {import('@appium/types').DriverType} DriverType
|
|
856
850
|
* @typedef {import('@appium/types').StringRecord} StringRecord
|
|
857
|
-
* @typedef {import('@appium/types').
|
|
851
|
+
* @typedef {import('@appium/types').ExternalDriver} ExternalDriver
|
|
852
|
+
* @typedef {import('@appium/types').PluginClass} PluginClass
|
|
853
|
+
* @typedef {import('@appium/types').Plugin} Plugin
|
|
854
|
+
* @typedef {import('@appium/types').DriverClass<import('@appium/types').Driver>} DriverClass
|
|
855
|
+
*/
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* @typedef {import('@appium/types').ISessionHandler<AppiumDriverConstraints,
|
|
859
|
+
* SessionHandlerCreateResult, SessionHandlerDeleteResult>} AppiumSessionHandler
|
|
860
|
+
*/
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* @typedef {SessionHandlerResult<[innerSessionId: string, caps:
|
|
864
|
+
* import('@appium/types').DriverCaps<Constraints>, protocol: string|undefined]>} SessionHandlerCreateResult
|
|
865
|
+
*/
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* @template {Constraints} C
|
|
869
|
+
* @typedef {import('@appium/types').Core<C>} Core
|
|
870
|
+
*/
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* @typedef {SessionHandlerResult<void>} SessionHandlerDeleteResult
|
|
858
874
|
*/
|
|
859
875
|
|
|
860
876
|
/**
|
|
@@ -868,11 +884,6 @@ export {AppiumDriver};
|
|
|
868
884
|
*/
|
|
869
885
|
|
|
870
886
|
/**
|
|
871
|
-
* @
|
|
872
|
-
* @typedef {import('@appium/types').
|
|
873
|
-
*/
|
|
874
|
-
|
|
875
|
-
/**
|
|
876
|
-
* @template {Constraints} C
|
|
877
|
-
* @typedef {import('@appium/types').Capabilities<C>} Capabilities
|
|
887
|
+
* @typedef {typeof desiredCapabilityConstraints} AppiumDriverConstraints
|
|
888
|
+
* @typedef {import('@appium/types').W3CDriverCaps<AppiumDriverConstraints>} W3CAppiumDriverCaps
|
|
878
889
|
*/
|
package/lib/cli/args.js
CHANGED
|
@@ -84,6 +84,16 @@ function makeListArgs(type) {
|
|
|
84
84
|
dest: 'showUpdates',
|
|
85
85
|
},
|
|
86
86
|
],
|
|
87
|
+
[
|
|
88
|
+
['--verbose'],
|
|
89
|
+
{
|
|
90
|
+
required: false,
|
|
91
|
+
default: false,
|
|
92
|
+
action: 'store_true',
|
|
93
|
+
help: 'Show more information about each extension',
|
|
94
|
+
dest: 'verbose',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
87
97
|
]);
|
|
88
98
|
}
|
|
89
99
|
|