appium 2.0.0-beta.6 → 2.0.0-beta.60

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.
Files changed (204) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +156 -65
  3. package/build/lib/appium.d.ts +229 -0
  4. package/build/lib/appium.d.ts.map +1 -0
  5. package/build/lib/appium.js +678 -439
  6. package/build/lib/appium.js.map +1 -0
  7. package/build/lib/cli/args.d.ts +17 -0
  8. package/build/lib/cli/args.d.ts.map +1 -0
  9. package/build/lib/cli/args.js +263 -319
  10. package/build/lib/cli/args.js.map +1 -0
  11. package/build/lib/cli/driver-command.d.ts +102 -0
  12. package/build/lib/cli/driver-command.d.ts.map +1 -0
  13. package/build/lib/cli/driver-command.js +131 -81
  14. package/build/lib/cli/driver-command.js.map +1 -0
  15. package/build/lib/cli/extension-command.d.ts +402 -0
  16. package/build/lib/cli/extension-command.d.ts.map +1 -0
  17. package/build/lib/cli/extension-command.js +799 -383
  18. package/build/lib/cli/extension-command.js.map +1 -0
  19. package/build/lib/cli/extension.d.ts +23 -0
  20. package/build/lib/cli/extension.d.ts.map +1 -0
  21. package/build/lib/cli/extension.js +71 -54
  22. package/build/lib/cli/extension.js.map +1 -0
  23. package/build/lib/cli/parser.d.ts +84 -0
  24. package/build/lib/cli/parser.d.ts.map +1 -0
  25. package/build/lib/cli/parser.js +240 -128
  26. package/build/lib/cli/parser.js.map +1 -0
  27. package/build/lib/cli/plugin-command.d.ts +99 -0
  28. package/build/lib/cli/plugin-command.d.ts.map +1 -0
  29. package/build/lib/cli/plugin-command.js +125 -81
  30. package/build/lib/cli/plugin-command.js.map +1 -0
  31. package/build/lib/cli/utils.d.ts +29 -0
  32. package/build/lib/cli/utils.d.ts.map +1 -0
  33. package/build/lib/cli/utils.js +72 -51
  34. package/build/lib/cli/utils.js.map +1 -0
  35. package/build/lib/config-file.d.ts +100 -0
  36. package/build/lib/config-file.d.ts.map +1 -0
  37. package/build/lib/config-file.js +207 -0
  38. package/build/lib/config-file.js.map +1 -0
  39. package/build/lib/config.d.ts +49 -0
  40. package/build/lib/config.d.ts.map +1 -0
  41. package/build/lib/config.js +267 -202
  42. package/build/lib/config.js.map +1 -0
  43. package/build/lib/constants.d.ts +56 -0
  44. package/build/lib/constants.d.ts.map +1 -0
  45. package/build/lib/constants.js +73 -0
  46. package/build/lib/constants.js.map +1 -0
  47. package/build/lib/extension/driver-config.d.ts +82 -0
  48. package/build/lib/extension/driver-config.d.ts.map +1 -0
  49. package/build/lib/extension/driver-config.js +210 -0
  50. package/build/lib/extension/driver-config.js.map +1 -0
  51. package/build/lib/extension/extension-config.d.ts +270 -0
  52. package/build/lib/extension/extension-config.d.ts.map +1 -0
  53. package/build/lib/extension/extension-config.js +601 -0
  54. package/build/lib/extension/extension-config.js.map +1 -0
  55. package/build/lib/extension/index.d.ts +48 -0
  56. package/build/lib/extension/index.d.ts.map +1 -0
  57. package/build/lib/extension/index.js +105 -0
  58. package/build/lib/extension/index.js.map +1 -0
  59. package/build/lib/extension/manifest-migrations.d.ts +27 -0
  60. package/build/lib/extension/manifest-migrations.d.ts.map +1 -0
  61. package/build/lib/extension/manifest-migrations.js +134 -0
  62. package/build/lib/extension/manifest-migrations.js.map +1 -0
  63. package/build/lib/extension/manifest.d.ts +145 -0
  64. package/build/lib/extension/manifest.d.ts.map +1 -0
  65. package/build/lib/extension/manifest.js +528 -0
  66. package/build/lib/extension/manifest.js.map +1 -0
  67. package/build/lib/extension/package-changed.d.ts +11 -0
  68. package/build/lib/extension/package-changed.d.ts.map +1 -0
  69. package/build/lib/extension/package-changed.js +62 -0
  70. package/build/lib/extension/package-changed.js.map +1 -0
  71. package/build/lib/extension/plugin-config.d.ts +56 -0
  72. package/build/lib/extension/plugin-config.d.ts.map +1 -0
  73. package/build/lib/extension/plugin-config.js +102 -0
  74. package/build/lib/extension/plugin-config.js.map +1 -0
  75. package/build/lib/grid-register.d.ts +10 -0
  76. package/build/lib/grid-register.d.ts.map +1 -0
  77. package/build/lib/grid-register.js +122 -144
  78. package/build/lib/grid-register.js.map +1 -0
  79. package/build/lib/logger.d.ts +3 -0
  80. package/build/lib/logger.d.ts.map +1 -0
  81. package/build/lib/logger.js +5 -17
  82. package/build/lib/logger.js.map +1 -0
  83. package/build/lib/logsink.d.ts +4 -0
  84. package/build/lib/logsink.d.ts.map +1 -0
  85. package/build/lib/logsink.js +190 -187
  86. package/build/lib/logsink.js.map +1 -0
  87. package/build/lib/main.d.ts +62 -0
  88. package/build/lib/main.d.ts.map +1 -0
  89. package/build/lib/main.js +339 -229
  90. package/build/lib/main.js.map +1 -0
  91. package/build/lib/schema/arg-spec.d.ts +143 -0
  92. package/build/lib/schema/arg-spec.d.ts.map +1 -0
  93. package/build/lib/schema/arg-spec.js +164 -0
  94. package/build/lib/schema/arg-spec.js.map +1 -0
  95. package/build/lib/schema/cli-args.d.ts +19 -0
  96. package/build/lib/schema/cli-args.d.ts.map +1 -0
  97. package/build/lib/schema/cli-args.js +217 -0
  98. package/build/lib/schema/cli-args.js.map +1 -0
  99. package/build/lib/schema/cli-transformers.d.ts +5 -0
  100. package/build/lib/schema/cli-transformers.d.ts.map +1 -0
  101. package/build/lib/schema/cli-transformers.js +124 -0
  102. package/build/lib/schema/cli-transformers.js.map +1 -0
  103. package/build/lib/schema/index.d.ts +3 -0
  104. package/build/lib/schema/index.d.ts.map +1 -0
  105. package/build/lib/schema/index.js +19 -0
  106. package/build/lib/schema/index.js.map +1 -0
  107. package/build/lib/schema/keywords.d.ts +24 -0
  108. package/build/lib/schema/keywords.d.ts.map +1 -0
  109. package/build/lib/schema/keywords.js +128 -0
  110. package/build/lib/schema/keywords.js.map +1 -0
  111. package/build/lib/schema/schema.d.ts +260 -0
  112. package/build/lib/schema/schema.d.ts.map +1 -0
  113. package/build/lib/schema/schema.js +640 -0
  114. package/build/lib/schema/schema.js.map +1 -0
  115. package/build/lib/utils.d.ts +266 -0
  116. package/build/lib/utils.d.ts.map +1 -0
  117. package/build/lib/utils.js +349 -273
  118. package/build/lib/utils.js.map +1 -0
  119. package/build/types/cli.d.ts +134 -0
  120. package/build/types/cli.d.ts.map +1 -0
  121. package/build/types/cli.js +3 -0
  122. package/build/types/cli.js.map +1 -0
  123. package/build/types/index.d.ts +15 -0
  124. package/build/types/index.d.ts.map +1 -0
  125. package/build/types/index.js +19 -0
  126. package/build/types/index.js.map +1 -0
  127. package/build/types/manifest/base.d.ts +135 -0
  128. package/build/types/manifest/base.d.ts.map +1 -0
  129. package/build/types/manifest/base.js +3 -0
  130. package/build/types/manifest/base.js.map +1 -0
  131. package/build/types/manifest/index.d.ts +21 -0
  132. package/build/types/manifest/index.d.ts.map +1 -0
  133. package/build/types/manifest/index.js +42 -0
  134. package/build/types/manifest/index.js.map +1 -0
  135. package/build/types/manifest/v3.d.ts +139 -0
  136. package/build/types/manifest/v3.d.ts.map +1 -0
  137. package/build/types/manifest/v3.js +3 -0
  138. package/build/types/manifest/v3.js.map +1 -0
  139. package/build/types/manifest/v4.d.ts +139 -0
  140. package/build/types/manifest/v4.d.ts.map +1 -0
  141. package/build/types/manifest/v4.js +3 -0
  142. package/build/types/manifest/v4.js.map +1 -0
  143. package/driver.d.ts +1 -0
  144. package/driver.js +14 -0
  145. package/index.js +11 -0
  146. package/lib/appium.js +558 -186
  147. package/lib/cli/args.js +277 -422
  148. package/lib/cli/driver-command.js +132 -24
  149. package/lib/cli/extension-command.js +751 -272
  150. package/lib/cli/extension.js +49 -18
  151. package/lib/cli/parser.js +263 -83
  152. package/lib/cli/plugin-command.js +122 -22
  153. package/lib/cli/utils.js +24 -10
  154. package/lib/config-file.js +220 -0
  155. package/lib/config.js +246 -111
  156. package/lib/constants.js +79 -0
  157. package/lib/extension/driver-config.js +247 -0
  158. package/lib/extension/extension-config.js +709 -0
  159. package/lib/extension/index.js +116 -0
  160. package/lib/extension/manifest-migrations.js +136 -0
  161. package/lib/extension/manifest.js +580 -0
  162. package/lib/extension/package-changed.js +64 -0
  163. package/lib/extension/plugin-config.js +112 -0
  164. package/lib/grid-register.js +49 -35
  165. package/lib/logger.js +1 -2
  166. package/lib/logsink.js +64 -38
  167. package/lib/main.js +318 -103
  168. package/lib/schema/arg-spec.js +229 -0
  169. package/lib/schema/cli-args.js +238 -0
  170. package/lib/schema/cli-transformers.js +119 -0
  171. package/lib/schema/index.js +2 -0
  172. package/lib/schema/keywords.js +136 -0
  173. package/lib/schema/schema.js +725 -0
  174. package/lib/utils.js +289 -167
  175. package/package.json +84 -84
  176. package/plugin.d.ts +1 -0
  177. package/plugin.js +13 -0
  178. package/scripts/autoinstall-extensions.js +243 -0
  179. package/support.d.ts +1 -0
  180. package/support.js +13 -0
  181. package/tsconfig.json +25 -0
  182. package/types/cli.ts +193 -0
  183. package/types/index.ts +20 -0
  184. package/types/manifest/README.md +30 -0
  185. package/types/manifest/base.ts +158 -0
  186. package/types/manifest/index.ts +28 -0
  187. package/types/manifest/v3.ts +161 -0
  188. package/types/manifest/v4.ts +161 -0
  189. package/CHANGELOG.md +0 -3515
  190. package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
  191. package/build/lib/cli/npm.js +0 -208
  192. package/build/lib/cli/parser-helpers.js +0 -82
  193. package/build/lib/driver-config.js +0 -77
  194. package/build/lib/drivers.js +0 -96
  195. package/build/lib/extension-config.js +0 -253
  196. package/build/lib/plugin-config.js +0 -59
  197. package/build/lib/plugins.js +0 -14
  198. package/lib/cli/npm.js +0 -184
  199. package/lib/cli/parser-helpers.js +0 -79
  200. package/lib/driver-config.js +0 -46
  201. package/lib/drivers.js +0 -81
  202. package/lib/extension-config.js +0 -209
  203. package/lib/plugin-config.js +0 -34
  204. package/lib/plugins.js +0 -10
@@ -0,0 +1,402 @@
1
+ export default ExtensionCliCommand;
2
+ export { ExtensionCliCommand as ExtensionCommand };
3
+ /**
4
+ * Options for the {@linkcode ExtensionCliCommand } constructor
5
+ */
6
+ export type ExtensionCommandOptions<ExtType extends import("@appium/types").ExtensionType> = {
7
+ /**
8
+ * - the `DriverConfig` or `PluginConfig` instance used for this command
9
+ */
10
+ config: ExtensionConfig<ExtType>;
11
+ /**
12
+ * - whether the output of this command should be JSON or text
13
+ */
14
+ json: boolean;
15
+ };
16
+ /**
17
+ * Extra stuff about extensions; used indirectly by {@linkcode ExtensionCliCommand.list }.
18
+ */
19
+ export type ExtensionListMetadata = {
20
+ /**
21
+ * - If `true`, the extension is installed
22
+ */
23
+ installed: boolean;
24
+ /**
25
+ * - If the extension is installed and the latest
26
+ */
27
+ upToDate: boolean;
28
+ /**
29
+ * - If the extension is installed, the version it can be updated to
30
+ */
31
+ updateVersion: string | null;
32
+ /**
33
+ * - Same as above, but a major version bump
34
+ */
35
+ unsafeUpdateVersion: string | null;
36
+ /**
37
+ * - Update check error message (if present)
38
+ */
39
+ updateError?: string | undefined;
40
+ /**
41
+ * - If Appium is run from an extension's working copy
42
+ */
43
+ devMode?: boolean | undefined;
44
+ };
45
+ export type ExtensionType = import('@appium/types').ExtensionType;
46
+ export type DriverType = import('@appium/types').DriverType;
47
+ export type PluginType = import('@appium/types').PluginType;
48
+ export type ExtRecord<ExtType extends import("@appium/types").ExtensionType> = import('appium/types').ExtRecord<ExtType>;
49
+ export type ExtensionConfig<ExtType extends import("@appium/types").ExtensionType> = import('../extension/extension-config').ExtensionConfig<ExtType>;
50
+ export type ExtMetadata<ExtType extends import("@appium/types").ExtensionType> = import('appium/types').ExtMetadata<ExtType>;
51
+ export type ExtManifest<ExtType extends import("@appium/types").ExtensionType> = import('appium/types').ExtManifest<ExtType>;
52
+ export type ExtPackageJson<ExtType extends import("@appium/types").ExtensionType> = import('appium/types').ExtPackageJson<ExtType>;
53
+ export type ExtInstallReceipt<ExtType extends import("@appium/types").ExtensionType> = import('appium/types').ExtInstallReceipt<ExtType>;
54
+ /**
55
+ * Possible return value for {@linkcode ExtensionCliCommand.list }
56
+ */
57
+ export type ExtensionListData<ExtType extends import("@appium/types").ExtensionType> = Partial<ExtManifest<ExtType>> & Partial<ExtensionListMetadata>;
58
+ export type InstalledExtensionListData<ExtType extends import("@appium/types").ExtensionType> = ExtManifest<ExtType> & ExtensionListMetadata;
59
+ /**
60
+ * Return value of {@linkcode ExtensionCliCommand.list }.
61
+ */
62
+ export type ExtensionList<ExtType extends import("@appium/types").ExtensionType> = Record<string, ExtensionListData<ExtType>>;
63
+ /**
64
+ * Options for {@linkcode ExtensionCliCommand._run }.
65
+ */
66
+ export type RunOptions = {
67
+ /**
68
+ * - name of the extension to run a script from
69
+ */
70
+ installSpec: string;
71
+ /**
72
+ * - name of the script to run
73
+ */
74
+ scriptName: string;
75
+ /**
76
+ * - arguments to pass to the script
77
+ */
78
+ extraArgs?: string[] | undefined;
79
+ /**
80
+ * - if true, will buffer the output of the script and return it
81
+ */
82
+ bufferOutput?: boolean | undefined;
83
+ };
84
+ /**
85
+ * Return value of {@linkcode ExtensionCliCommand._run }
86
+ */
87
+ export type RunOutput = {
88
+ /**
89
+ * - error message if script ran unsuccessfully, otherwise undefined
90
+ */
91
+ error?: string | undefined;
92
+ /**
93
+ * - script output if `bufferOutput` was `true` in {@linkcode RunOptions }
94
+ */
95
+ output?: string[] | undefined;
96
+ };
97
+ /**
98
+ * Options for {@linkcode ExtensionCliCommand._update }.
99
+ */
100
+ export type ExtensionUpdateOpts = {
101
+ /**
102
+ * - the name of the extension to update
103
+ */
104
+ installSpec: string;
105
+ /**
106
+ * - if true, will perform unsafe updates past major revision boundaries
107
+ */
108
+ unsafe: boolean;
109
+ };
110
+ /**
111
+ * Return value of {@linkcode ExtensionCliCommand._update }.
112
+ */
113
+ export type ExtensionUpdateResult = {
114
+ /**
115
+ * - map of ext names to error objects
116
+ */
117
+ errors: Record<string, Error>;
118
+ /**
119
+ * - map of ext names to {@linkcode UpdateReport }s
120
+ */
121
+ updates: Record<string, UpdateReport>;
122
+ };
123
+ /**
124
+ * Part of result of {@linkcode ExtensionCliCommand._update }.
125
+ */
126
+ export type UpdateReport = {
127
+ /**
128
+ * - version the extension was updated from
129
+ */
130
+ from: string;
131
+ /**
132
+ * - version the extension was updated to
133
+ */
134
+ to: string;
135
+ };
136
+ /**
137
+ * Options for {@linkcode ExtensionCliCommand._uninstall }.
138
+ */
139
+ export type UninstallOpts = {
140
+ /**
141
+ * - the name or spec of an extension to uninstall
142
+ */
143
+ installSpec: string;
144
+ };
145
+ /**
146
+ * Used by {@linkcode ExtensionCliCommand.getPostInstallText }
147
+ */
148
+ export type ExtensionArgs = {
149
+ /**
150
+ * - the name of an extension
151
+ */
152
+ extName: string;
153
+ /**
154
+ * - the data for an installed extension
155
+ */
156
+ extData: object;
157
+ };
158
+ /**
159
+ * Options for {@linkcode ExtensionCliCommand.installViaNpm }
160
+ */
161
+ export type InstallViaNpmArgs = {
162
+ /**
163
+ * - the name or spec of an extension to install
164
+ */
165
+ installSpec: string;
166
+ /**
167
+ * - the NPM package name of the extension
168
+ */
169
+ pkgName: string;
170
+ /**
171
+ * - type of install
172
+ */
173
+ installType: import('appium/types').InstallType;
174
+ /**
175
+ * - the specific version of the NPM package
176
+ */
177
+ pkgVer?: string | undefined;
178
+ };
179
+ /**
180
+ * Object returned by {@linkcode ExtensionCliCommand.checkForExtensionUpdate }
181
+ */
182
+ export type PossibleUpdates = {
183
+ /**
184
+ * - current version
185
+ */
186
+ current: string;
187
+ /**
188
+ * - version we can safely update to if it exists, or null
189
+ */
190
+ safeUpdate: string | null;
191
+ /**
192
+ * - version we can unsafely update to if it exists, or null
193
+ */
194
+ unsafeUpdate: string | null;
195
+ };
196
+ /**
197
+ * Options for {@linkcode ExtensionCliCommand._install }
198
+ */
199
+ export type InstallOpts = {
200
+ /**
201
+ * - the name or spec of an extension to install
202
+ */
203
+ installSpec: string;
204
+ /**
205
+ * - how to install this extension. One of the INSTALL_TYPES
206
+ */
207
+ installType: InstallType;
208
+ /**
209
+ * - for git/github installs, the extension node package name
210
+ */
211
+ packageName?: string | undefined;
212
+ };
213
+ export type KnownExtensions<ExtType extends import("@appium/types").ExtensionType> = ExtType extends DriverType ? typeof import('../constants').KNOWN_DRIVERS : ExtType extends PluginType ? typeof import('../constants').KNOWN_PLUGINS : never;
214
+ export type ListOptions = {
215
+ /**
216
+ * - whether should show only installed extensions
217
+ */
218
+ showInstalled: boolean;
219
+ /**
220
+ * - whether should show available updates
221
+ */
222
+ showUpdates: boolean;
223
+ /**
224
+ * - whether to show additional data from the extension
225
+ */
226
+ verbose?: boolean | undefined;
227
+ };
228
+ /**
229
+ * Opts for {@linkcode ExtensionCliCommand.getInstallationReceipt }
230
+ */
231
+ export type GetInstallationReceiptOpts<ExtType extends import("@appium/types").ExtensionType> = {
232
+ installPath: string;
233
+ installSpec: string;
234
+ pkg: ExtPackageJson<ExtType>;
235
+ installType: InstallType;
236
+ };
237
+ export type InstallType = import('appium/types').InstallType;
238
+ /**
239
+ * @template {ExtensionType} ExtType
240
+ */
241
+ declare class ExtensionCliCommand<ExtType extends import("@appium/types").ExtensionType> {
242
+ /**
243
+ * Build an ExtensionCommand
244
+ * @param {ExtensionCommandOptions<ExtType>} opts
245
+ */
246
+ constructor({ config, json }: ExtensionCommandOptions<ExtType>);
247
+ /**
248
+ * This is the `DriverConfig` or `PluginConfig`, depending on `ExtType`.
249
+ * @type {ExtensionConfig<ExtType>}
250
+ */
251
+ config: ExtensionConfig<ExtType>;
252
+ /**
253
+ * {@linkcode Record} of official plugins or drivers.
254
+ * @type {KnownExtensions<ExtType>}
255
+ */
256
+ knownExtensions: KnownExtensions<ExtType>;
257
+ /**
258
+ * If `true`, command output has been requested as JSON.
259
+ * @type {boolean}
260
+ */
261
+ isJsonOutput: boolean;
262
+ log: console.CliConsole;
263
+ /**
264
+ * `driver` or `plugin`, depending on the `ExtensionConfig`.
265
+ */
266
+ get type(): ExtType;
267
+ /**
268
+ * Logs a message and returns an {@linkcode Error} to throw.
269
+ *
270
+ * For TS to understand that a function throws an exception, it must actually throw an exception--
271
+ * in other words, _calling_ a function which is guaranteed to throw an exception is not enough--
272
+ * nor is something like `@returns {never}` which does not imply a thrown exception.
273
+ * @param {string} message
274
+ * @protected
275
+ * @throws {Error}
276
+ */
277
+ protected _createFatalError(message: string): Error;
278
+ /**
279
+ * Take a CLI parse and run an extension command based on its type
280
+ *
281
+ * @param {object} args - a key/value object with CLI flags and values
282
+ * @return {Promise<object>} the result of the specific command which is executed
283
+ */
284
+ execute(args: object): Promise<object>;
285
+ /**
286
+ * List extensions
287
+ * @template {ExtensionType} ExtType
288
+ * @param {ListOptions} opts
289
+ * @return {Promise<ExtensionList<ExtType>>} map of extension names to extension data
290
+ */
291
+ list<ExtType_1 extends import("@appium/types").ExtensionType>({ showInstalled, showUpdates, verbose }: ListOptions): Promise<ExtensionList<ExtType_1>>;
292
+ /**
293
+ * Install an extension
294
+ *
295
+ * @param {InstallOpts} opts
296
+ * @return {Promise<ExtRecord<ExtType>>} map of all installed extension names to extension data
297
+ */
298
+ _install({ installSpec, installType, packageName }: InstallOpts): Promise<ExtRecord<ExtType>>;
299
+ /**
300
+ * Install an extension via NPM
301
+ *
302
+ * @param {InstallViaNpmArgs} args
303
+ * @returns {Promise<ExtInstallReceipt<ExtType>>}
304
+ */
305
+ installViaNpm({ installSpec, pkgName, pkgVer, installType }: InstallViaNpmArgs): Promise<ExtInstallReceipt<ExtType>>;
306
+ /**
307
+ * Get the text which should be displayed to the user after an extension has been installed. This
308
+ * is designed to be overridden by drivers/plugins with their own particular text.
309
+ *
310
+ * @param {ExtensionArgs} args
311
+ * @returns {string}
312
+ */
313
+ getPostInstallText(args: ExtensionArgs): string;
314
+ /**
315
+ * Once a package is installed on-disk, this gathers some necessary metadata for validation.
316
+ *
317
+ * @param {GetInstallationReceiptOpts<ExtType>} opts
318
+ * @returns {ExtInstallReceipt<ExtType>}
319
+ */
320
+ getInstallationReceipt({ pkg, installPath, installType, installSpec }: GetInstallationReceiptOpts<ExtType>): ExtInstallReceipt<ExtType>;
321
+ /**
322
+ * Validates the _required_ root fields of an extension's `package.json` file.
323
+ *
324
+ * These required fields are:
325
+ * - `name`
326
+ * - `version`
327
+ * - `appium`
328
+ * @param {import('type-fest').PackageJson} pkg - `package.json` of extension
329
+ * @param {string} installSpec - Extension name/spec
330
+ * @throws {ReferenceError} If `package.json` has a missing or invalid field
331
+ * @returns {pkg is ExtPackageJson<ExtType>}
332
+ */
333
+ validatePackageJson(pkg: import('type-fest').PackageJson, installSpec: string): pkg is ExtPackageJson<ExtType>;
334
+ /**
335
+ * For any `package.json` fields which a particular type of extension requires, validate the
336
+ * presence and form of those fields on the `package.json` data, throwing an error if anything is
337
+ * amiss.
338
+ *
339
+ * @param {ExtMetadata<ExtType>} extMetadata - the data in the "appium" field of `package.json` for an extension
340
+ * @param {string} installSpec - Extension name/spec
341
+ */
342
+ validateExtensionFields(extMetadata: ExtMetadata<ExtType>, installSpec: string): void;
343
+ /**
344
+ * Uninstall an extension.
345
+ *
346
+ * First tries to do this via `npm uninstall`, but if that fails, just `rm -rf`'s the extension dir.
347
+ *
348
+ * Will only remove the extension from the manifest if it has been successfully removed.
349
+ *
350
+ * @param {UninstallOpts} opts
351
+ * @return {Promise<ExtRecord<ExtType>>} map of all installed extension names to extension data (without the extension just uninstalled)
352
+ */
353
+ _uninstall({ installSpec }: UninstallOpts): Promise<ExtRecord<ExtType>>;
354
+ /**
355
+ * Attempt to update one or more drivers using NPM
356
+ *
357
+ * @param {ExtensionUpdateOpts} updateSpec
358
+ * @return {Promise<ExtensionUpdateResult>}
359
+ */
360
+ _update({ installSpec, unsafe }: ExtensionUpdateOpts): Promise<ExtensionUpdateResult>;
361
+ /**
362
+ * Given an extension name, figure out what its highest possible version upgrade is, and also the
363
+ * highest possible safe upgrade.
364
+ *
365
+ * @param {string} ext - name of extension
366
+ * @return {Promise<PossibleUpdates>}
367
+ */
368
+ checkForExtensionUpdate(ext: string): Promise<PossibleUpdates>;
369
+ /**
370
+ * Actually update an extension installed by NPM, using the NPM cli. And update the installation
371
+ * manifest.
372
+ *
373
+ * @param {string} installSpec - name of extension to update
374
+ * @param {string} version - version string identifier to update extension to
375
+ * @returns {Promise<void>}
376
+ */
377
+ updateExtension(installSpec: string, version: string): Promise<void>;
378
+ /**
379
+ * Just wraps {@linkcode child_process.spawn} with some default options
380
+ *
381
+ * @param {string} cwd - CWD
382
+ * @param {string} script - Path to script
383
+ * @param {string[]} args - Extra args for script
384
+ * @param {import('child_process').SpawnOptions} opts - Options
385
+ * @returns {import('node:child_process').ChildProcess}
386
+ */
387
+ _runUnbuffered(cwd: string, script: string, args?: string[], opts?: import('child_process').SpawnOptions): import('node:child_process').ChildProcess;
388
+ /**
389
+ * Runs a script cached inside the `scripts` field under `appium`
390
+ * inside of the extension's `package.json` file. Will throw
391
+ * an error if the driver/plugin does not contain a `scripts` field
392
+ * underneath the `appium` field in its `package.json`, if the
393
+ * `scripts` field is not a plain object, or if the `scriptName` is
394
+ * not found within `scripts` object.
395
+ *
396
+ * @param {RunOptions} opts
397
+ * @return {Promise<RunOutput>}
398
+ */
399
+ _run({ installSpec, scriptName, extraArgs, bufferOutput }: RunOptions): Promise<RunOutput>;
400
+ }
401
+ import { console } from "@appium/support";
402
+ //# sourceMappingURL=extension-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-command.d.ts","sourceRoot":"","sources":["../../../lib/cli/extension-command.js"],"names":[],"mappings":";;;;;;;;;YA8xBc,gBAAgB,OAAO,CAAC;;;;UACxB,OAAO;;;;;;;;;eAOP,OAAO;;;;cACP,OAAO;;;;mBACP,MAAM,GAAC,IAAI;;;;yBACX,MAAM,GAAC,IAAI;;;;;;;;;;4BAMZ,OAAO,eAAe,EAAE,aAAa;yBACrC,OAAO,eAAe,EAAE,UAAU;yBAClC,OAAO,eAAe,EAAE,UAAU;+EAKlC,OAAO,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC;qFAKzC,OAAO,+BAA+B,EAAE,eAAe,CAAC,OAAO,CAAC;iFAKhE,OAAO,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC;iFAK3C,OAAO,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC;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