@appium/types 1.0.0 → 1.1.0

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 (64) hide show
  1. package/build/lib/capabilities.d.ts +1 -2
  2. package/build/lib/capabilities.d.ts.map +1 -1
  3. package/build/lib/{command.d.ts → command-maps.d.ts} +1 -1
  4. package/build/lib/command-maps.d.ts.map +1 -0
  5. package/build/lib/command-maps.js +4 -0
  6. package/build/lib/command-maps.js.map +1 -0
  7. package/build/lib/commands/appium.d.ts +100 -0
  8. package/build/lib/commands/appium.d.ts.map +1 -0
  9. package/build/lib/{command.js → commands/appium.js} +1 -2
  10. package/build/lib/commands/appium.js.map +1 -0
  11. package/build/lib/commands/basedriver.d.ts +370 -0
  12. package/build/lib/commands/basedriver.d.ts.map +1 -0
  13. package/build/lib/commands/basedriver.js +3 -0
  14. package/build/lib/commands/basedriver.js.map +1 -0
  15. package/build/lib/commands/index.d.ts +7 -0
  16. package/build/lib/commands/index.d.ts.map +1 -0
  17. package/build/lib/commands/index.js +23 -0
  18. package/build/lib/commands/index.js.map +1 -0
  19. package/build/lib/commands/jsonwp.d.ts +37 -0
  20. package/build/lib/commands/jsonwp.d.ts.map +1 -0
  21. package/build/lib/commands/jsonwp.js +3 -0
  22. package/build/lib/commands/jsonwp.js.map +1 -0
  23. package/build/lib/commands/mjsonwp.d.ts +65 -0
  24. package/build/lib/commands/mjsonwp.d.ts.map +1 -0
  25. package/build/lib/commands/mjsonwp.js +3 -0
  26. package/build/lib/commands/mjsonwp.js.map +1 -0
  27. package/build/lib/commands/other-protocols.d.ts +300 -0
  28. package/build/lib/commands/other-protocols.d.ts.map +1 -0
  29. package/build/lib/commands/other-protocols.js +3 -0
  30. package/build/lib/commands/other-protocols.js.map +1 -0
  31. package/build/lib/commands/webdriver.d.ts +443 -0
  32. package/build/lib/commands/webdriver.d.ts.map +1 -0
  33. package/build/lib/commands/webdriver.js +3 -0
  34. package/build/lib/commands/webdriver.js.map +1 -0
  35. package/build/lib/constraints.d.ts +19 -0
  36. package/build/lib/constraints.d.ts.map +1 -1
  37. package/build/lib/constraints.js.map +1 -1
  38. package/build/lib/driver.d.ts +9 -1056
  39. package/build/lib/driver.d.ts.map +1 -1
  40. package/build/lib/index.d.ts +2 -1
  41. package/build/lib/index.d.ts.map +1 -1
  42. package/build/lib/index.js +2 -1
  43. package/build/lib/index.js.map +1 -1
  44. package/build/lib/plugin.d.ts +1 -1
  45. package/build/lib/plugin.d.ts.map +1 -1
  46. package/build/lib/standard-caps.d.ts +8 -0
  47. package/build/lib/standard-caps.d.ts.map +1 -1
  48. package/lib/capabilities.ts +1 -2
  49. package/lib/commands/appium.ts +115 -0
  50. package/lib/commands/basedriver.ts +476 -0
  51. package/lib/commands/index.ts +6 -0
  52. package/lib/commands/jsonwp.ts +41 -0
  53. package/lib/commands/mjsonwp.ts +71 -0
  54. package/lib/commands/other-protocols.ts +387 -0
  55. package/lib/commands/webdriver.ts +511 -0
  56. package/lib/constraints.ts +18 -1
  57. package/lib/driver.ts +25 -1279
  58. package/lib/index.ts +2 -1
  59. package/lib/plugin.ts +1 -1
  60. package/lib/standard-caps.ts +8 -0
  61. package/package.json +5 -5
  62. package/build/lib/command.d.ts.map +0 -1
  63. package/build/lib/command.js.map +0 -1
  64. /package/lib/{command.ts → command-maps.ts} +0 -0
@@ -0,0 +1,387 @@
1
+ /**
2
+ * Interface for all WebDriver extension commands from other protocols proxied to the external driver.
3
+ */
4
+ export interface IOtherProtocolCommands {
5
+
6
+ /**
7
+ * Chromium DevTools
8
+ */
9
+
10
+ /**
11
+ * Execute a devtools command
12
+ *
13
+ * @param cmd - the command
14
+ * @param params - any command-specific command parameters
15
+ *
16
+ * @returns The result of the command execution
17
+ */
18
+ executeCdp?(cmd: string, params: unknown): Promise<unknown>;
19
+
20
+ /**
21
+ * Permissions
22
+ */
23
+
24
+ /**
25
+ * Set the permission state of a PermissionDescriptor
26
+ * @see {@link https://www.w3.org/TR/permissions/#webdriver-command-set-permission}
27
+ *
28
+ * @param descriptor - the PermissionDescriptor
29
+ * @param state - the new state
30
+ */
31
+ setPermissions?(descriptor: PermissionDescriptor, state: PermissionState): Promise<void>;
32
+
33
+ /**
34
+ * Reporting
35
+ */
36
+
37
+ /**
38
+ * Generate a test report for registered observers
39
+ * @see {@link https://www.w3.org/TR/reporting-1/#generate-test-report-command}
40
+ *
41
+ * @param message - the message to be displayed in the report
42
+ * @param group - the destination group to deliver the report to
43
+ */
44
+ generateTestReport?(message: string, group?: string): Promise<void>;
45
+
46
+ /**
47
+ * Device Posture
48
+ */
49
+
50
+ /**
51
+ * Override the device posture
52
+ * @see {@link https://www.w3.org/TR/device-posture/#set-device-posture}
53
+ *
54
+ * @param posture - the posture to which the device should be set
55
+ */
56
+
57
+ setDevicePosture?(posture: DevicePostureType): Promise<void>;
58
+ /**
59
+ * Return device posture control back to hardware
60
+ * @see {@link https://www.w3.org/TR/device-posture/#clear-device-posture}
61
+ */
62
+ clearDevicePosture?(): Promise<void>;
63
+
64
+ /**
65
+ * Generic Sensor
66
+ */
67
+
68
+ /**
69
+ * Create a virtual sensor
70
+ * @see {@link https://www.w3.org/TR/generic-sensor/#create-virtual-sensor-command}
71
+ *
72
+ * @param type - the virtual sensor type to create
73
+ * @param connected - whether the sensor should be configured as connected
74
+ * @param maxSamplingFrequency - the maximum sampling frequency of this sensor
75
+ * @param minSamplingFrequency - the minimum sampling frequency of this sensor
76
+ */
77
+ createVirtualSensor?(
78
+ type: string,
79
+ connected?: boolean,
80
+ maxSamplingFrequency?: number,
81
+ minSamplingFrequency?: number,
82
+ ): Promise<void>;
83
+
84
+ /**
85
+ * Retrieve information about a virtual sensor
86
+ * @see {@link https://www.w3.org/TR/generic-sensor/#get-virtual-sensor-information-command}
87
+ *
88
+ * @param sensorType - the virtual sensor type
89
+ *
90
+ * @returns an object with sensor information such as its requested sampling frequency
91
+ */
92
+ getVirtualSensorInfo?(sensorType: string): Promise<VirtualSensorInfo>;
93
+
94
+ /**
95
+ * Update a virtual sensor with a new reading
96
+ * @see {@link https://www.w3.org/TR/generic-sensor/#update-virtual-sensor-reading-command}
97
+ *
98
+ * @param sensorType - the virtual sensor type
99
+ * @param reading - sensor type-specific sensor reading data
100
+ */
101
+ updateVirtualSensorReading?(sensorType: string, reading: VirtualSensorReading): Promise<void>;
102
+
103
+ /**
104
+ * Delete a virtual sensor
105
+ * @see {@link https://www.w3.org/TR/generic-sensor/#delete-virtual-sensor-command}
106
+ *
107
+ * @param sensorType - the virtual sensor type
108
+ */
109
+ deleteVirtualSensor?(sensorType: string): Promise<void>;
110
+
111
+ /**
112
+ * Custom Handlers
113
+ */
114
+
115
+ /**
116
+ * Set the protocol handler automation mode
117
+ * @see {@link https://html.spec.whatwg.org/multipage/system-state.html#user-agent-automation}
118
+ *
119
+ * @param mode - the protocol handler automation mode
120
+ */
121
+ setRPHRegistrationMode?(mode: RPHRegistrationMode): Promise<void>;
122
+
123
+ /**
124
+ * Secure Payment Confirmation
125
+ */
126
+
127
+ /**
128
+ * Set the current transaction automation mode
129
+ * @see {@link https://www.w3.org/TR/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode}
130
+ *
131
+ * @param mode - the transaction automation mode
132
+ */
133
+ setSPCTransactionMode?(mode: SPCTransactionMode): Promise<void>;
134
+
135
+ /**
136
+ * Compute Pressure
137
+ */
138
+
139
+ /**
140
+ * Create a virtual pressure source
141
+ * @see {@link https://www.w3.org/TR/compute-pressure/#create-virtual-pressure-source}
142
+ *
143
+ * @param type - the virtual pressure source type to create
144
+ * @param supported - whether the pressure source should be configured as supported
145
+ */
146
+ createVirtualPressureSource?(type: string, supported?: boolean): Promise<void>;
147
+
148
+ /**
149
+ * Update the state of a virtual pressure source
150
+ * @see {@link https://www.w3.org/TR/compute-pressure/#update-virtual-pressure-source}
151
+ *
152
+ * @param sensorType - the virtual pressure source type
153
+ * @param sample - the pressure state
154
+ */
155
+ updateVirtualPressureSource?(pressureSourceType: string, sample: PressureSourceState): Promise<void>;
156
+
157
+ /**
158
+ * Delete a virtual pressure source
159
+ * @see {@link https://www.w3.org/TR/compute-pressure/#delete-virtual-pressure-source}
160
+ *
161
+ * @param pressureSourceType - the virtual pressure source type
162
+ */
163
+ deleteVirtualPressureSource?(pressureSourceType: string): Promise<void>;
164
+
165
+ /**
166
+ * Federated Credential Management
167
+ */
168
+
169
+ /**
170
+ * Cancel the currently open FedCM dialog
171
+ * @see {@link https://www.w3.org/TR/fedcm-1/#webdriver-canceldialog}
172
+ */
173
+ fedCMCancelDialog?(): Promise<void>;
174
+
175
+ /**
176
+ * Select an account to use for the currently open FedCM dialog
177
+ * @see {@link https://www.w3.org/TR/fedcm-1/#webdriver-selectaccount}
178
+ *
179
+ * @param accountIndex - index of the account in the list of available accounts
180
+ */
181
+ fedCMSelectAccount?(accountIndex: number): Promise<void>;
182
+
183
+ /**
184
+ * Click a button in the currently open FedCM dialog
185
+ * @see {@link https://www.w3.org/TR/fedcm-1/#webdriver-clickdialogbutton}
186
+ *
187
+ * @param dialogButton - button identifier
188
+ */
189
+ fedCMClickDialogButton?(dialogButton: string): Promise<void>;
190
+
191
+ /**
192
+ * Return all accounts that the user can select in the currently open FedCM dialog
193
+ * @see {@link https://www.w3.org/TR/fedcm-1/#webdriver-accountlist}
194
+ *
195
+ * @returns list of account objects
196
+ */
197
+ fedCMGetAccounts?(): Promise<FedCMAccount[]>;
198
+
199
+ /**
200
+ * Return the title and subtitle (if one exists) of the currently open FedCM dialog
201
+ * @see {@link https://www.w3.org/TR/fedcm-1/#webdriver-gettitle}
202
+ *
203
+ * @returns dialog title and subtitle (if one exists)
204
+ */
205
+ fedCMGetTitle?(): Promise<FedCMDialogTitle>;
206
+
207
+ /**
208
+ * Return the type of the currently open FedCM dialog
209
+ * @see {@link https://www.w3.org/TR/fedcm-1/#webdriver-getdialogtype}
210
+ *
211
+ * @returns dialog type
212
+ */
213
+ fedCMGetDialogType?(): Promise<string>;
214
+
215
+ /**
216
+ * Set the state of the promise rejection delay
217
+ * @see {@link https://www.w3.org/TR/fedcm-1/#webdriver-setdelayenabled}
218
+ */
219
+ fedCMSetDelayEnabled?(enabled: boolean): Promise<void>;
220
+
221
+ /**
222
+ * Reset the cooldown delay used after dismissing a FedCM dialog
223
+ * @see {@link https://www.w3.org/TR/fedcm-1/#webdriver-resetcooldown}
224
+ */
225
+ fedCMResetCooldown?(): Promise<void>;
226
+
227
+ /**
228
+ * Web Authentication
229
+ */
230
+
231
+ /**
232
+ * Add a virtual authenticator to a browser
233
+ * @see {@link https://www.w3.org/TR/webauthn-2/#sctn-automation-add-virtual-authenticator}
234
+ *
235
+ * @param protocol - the protocol
236
+ * @param transport - a valid AuthenticatorTransport value
237
+ * @param hasResidentKey - whether there is a resident key
238
+ * @param hasUserVerification - whether the authenticator has user verification
239
+ * @param isUserConsenting - whether it is a user consenting authenticator
240
+ * @param isUserVerified - whether the user is verified
241
+ *
242
+ * @returns The authenticator ID
243
+ */
244
+ addVirtualAuthenticator?(
245
+ protocol: 'ctap/u2f' | 'ctap2' | 'ctap2_1',
246
+ transport: string,
247
+ hasResidentKey?: boolean,
248
+ hasUserVerification?: boolean,
249
+ isUserConsenting?: boolean,
250
+ isUserVerified?: boolean,
251
+ ): Promise<string>;
252
+
253
+ /**
254
+ * Remove a virtual authenticator
255
+ * @see {@link https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-virtual-authenticator}
256
+ *
257
+ * @param authenticatorId - the ID returned in the call to add the authenticator
258
+ */
259
+ removeVirtualAuthenticator?(authenticatorId: string): Promise<void>;
260
+
261
+ /**
262
+ * Inject a public key credential source into a virtual authenticator
263
+ * @see {@link https://www.w3.org/TR/webauthn-2/#sctn-automation-add-credential}
264
+ *
265
+ * @param credentialId - the base64 encoded credential ID
266
+ * @param isResidentCredential - if true, a client-side credential, otherwise a server-side
267
+ * credential
268
+ * @param rpId - the relying party ID the credential is scoped to
269
+ * @param privateKey - the base64 encoded private key package
270
+ * @param userHandle - the base64 encoded user handle
271
+ * @param signCount - the initial value for a signature counter
272
+ */
273
+ addAuthCredential?(
274
+ credentialId: string,
275
+ isResidentCredential: boolean,
276
+ rpId: string,
277
+ privateKey: string,
278
+ userHandle: string,
279
+ signCount: number,
280
+ authenticatorId: string,
281
+ ): Promise<void>;
282
+
283
+ /**
284
+ * Get the list of public key credential sources
285
+ * @see {@link https://www.w3.org/TR/webauthn-2/#sctn-automation-get-credentials}
286
+ *
287
+ * @returns The list of Credentials
288
+ */
289
+ getAuthCredential?(): Promise<Credential[]>;
290
+
291
+ /**
292
+ * Remove all auth credentials
293
+ * @see {@link https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-all-credentials}
294
+ */
295
+ removeAllAuthCredentials?(): Promise<void>;
296
+
297
+ /**
298
+ * Remove a specific auth credential
299
+ *
300
+ * @param credentialId - the credential ID
301
+ * @param authenticatorId - the authenticator ID
302
+ */
303
+ removeAuthCredential?(credentialId: string, authenticatorId: string): Promise<void>;
304
+
305
+ /**
306
+ * Set the isUserVerified property of an authenticator
307
+ * @see {@link https://www.w3.org/TR/webauthn-2/#sctn-automation-set-user-verified}
308
+ *
309
+ * @param isUserVerified - the value of the isUserVerified property
310
+ * @param authenticatorId - the authenticator id
311
+ */
312
+ setUserAuthVerified?(isUserVerified: boolean, authenticatorId: string): Promise<void>;
313
+ }
314
+
315
+ // Permissions
316
+
317
+ export type PermissionState = 'granted' | 'denied' | 'prompt';
318
+
319
+ export interface PermissionDescriptor {
320
+ name: string;
321
+ [key: string]: any;
322
+ }
323
+
324
+ // Device Posture
325
+
326
+ export type DevicePostureType = 'continuous' | 'folded';
327
+
328
+ // Generic Sensor
329
+
330
+ export interface VirtualSensorInfo {
331
+ requestedSamplingFrequency: number;
332
+ }
333
+
334
+ export interface VirtualSensorXYZReading {
335
+ x: number;
336
+ y: number;
337
+ z: number;
338
+ }
339
+
340
+ export interface VirtualSensorSingleValueReading {
341
+ [key: string]: number;
342
+ }
343
+
344
+ export type VirtualSensorReading = VirtualSensorXYZReading | VirtualSensorSingleValueReading;
345
+
346
+ // Custom Handlers
347
+
348
+ export type RPHRegistrationMode = 'autoAccept' | 'autoReject' | 'none';
349
+
350
+ // Secure Payment Confirmation
351
+
352
+ export type SPCTransactionMode = 'autoAccept' | 'autoChooseToAuthAnotherWay' | 'autoReject' | 'autoOptOut';
353
+
354
+ // Compute Pressure
355
+
356
+ export type PressureSourceState = 'nominal' | 'fair' | 'serious' | 'critical';
357
+
358
+ // Federated Credential Management
359
+
360
+ export interface FedCMAccount {
361
+ accountId: string;
362
+ email: string;
363
+ name: string;
364
+ givenName?: string;
365
+ pictureUrl?: string;
366
+ idpConfigUrl: string;
367
+ loginState: string;
368
+ termsOfServiceUrl?: string;
369
+ privacyPolicyUrl?: string;
370
+ }
371
+
372
+ export interface FedCMDialogTitle {
373
+ title: string;
374
+ subtitle?: string;
375
+ }
376
+
377
+ // Web Authentication
378
+
379
+ export interface Credential {
380
+ credentialId: string;
381
+ isResidentCredential: boolean;
382
+ rpId: string;
383
+ privateKey: string;
384
+ userHandle?: string;
385
+ signCount: number;
386
+ largeBlob?: string;
387
+ }