@appium/types 0.25.3 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/driver.ts CHANGED
@@ -35,8 +35,8 @@ export interface ITimeoutCommands {
35
35
  * @param implicit - the number in ms for the implicit wait timeout, used for the W3C command
36
36
  */
37
37
  timeouts(
38
- type: string,
39
- ms: number | string,
38
+ type?: string,
39
+ ms?: number | string,
40
40
  script?: number,
41
41
  pageLoad?: number,
42
42
  implicit?: number | string,
@@ -49,16 +49,6 @@ export interface ITimeoutCommands {
49
49
  */
50
50
  setNewCommandTimeout(ms: number): void;
51
51
 
52
- /**
53
- * Set the implicit wait timeout
54
- *
55
- * @param ms - the timeout in ms
56
- *
57
- * @deprecated Use `timeouts` instead
58
- *
59
- */
60
- implicitWait(ms: number | string): Promise<void>;
61
-
62
52
  /**
63
53
  * A helper method (not a command) used to set the implicit wait value
64
54
  *
@@ -90,14 +80,6 @@ export interface ITimeoutCommands {
90
80
  */
91
81
  implicitWaitW3C(ms: number): Promise<void>;
92
82
 
93
- /**
94
- * Set the implicit wait value that was sent in via the JSONWP
95
- *
96
- * @param ms - the timeout in ms
97
- * @deprecated
98
- */
99
- implicitWaitMJSONWP(ms: number): Promise<void>;
100
-
101
83
  /**
102
84
  * Set the page load timeout value that was sent in via the W3C protocol
103
85
  *
@@ -105,14 +87,6 @@ export interface ITimeoutCommands {
105
87
  */
106
88
  pageLoadTimeoutW3C(ms: number): Promise<void>;
107
89
 
108
- /**
109
- * Set the page load timeout value that was sent in via the JSONWP
110
- *
111
- * @param ms - the timeout in ms
112
- * @deprecated
113
- */
114
- pageLoadTimeoutMJSONWP(ms: number): Promise<void>;
115
-
116
90
  /**
117
91
  * Set the script timeout value that was sent in via the W3C protocol
118
92
  *
@@ -120,14 +94,6 @@ export interface ITimeoutCommands {
120
94
  */
121
95
  scriptTimeoutW3C(ms: number): Promise<void>;
122
96
 
123
- /**
124
- * Set the script timeout value that was sent in via the JSONWP
125
- *
126
- * @param ms - the timeout in ms
127
- * @deprecated
128
- */
129
- scriptTimeoutMJSONWP(ms: number): Promise<void>;
130
-
131
97
  /**
132
98
  * Set Appium's new command timeout
133
99
  *
@@ -183,13 +149,19 @@ export interface IExecuteCommands {
183
149
  ): Promise<TReturn>;
184
150
  }
185
151
 
186
- export interface MultiSessionData<C extends Constraints = Constraints> {
152
+ /**
153
+ * Data returned by `AppiumDriver.getAppiumSessions`
154
+ *
155
+ * @typeParam C - The driver's constraints
156
+ */
157
+ export interface TimestampedMultiSessionData<C extends Constraints = Constraints> {
187
158
  id: string;
159
+ created: number; // Unix timestamp in milliseconds
188
160
  capabilities: DriverCaps<C>;
189
161
  }
190
162
 
191
163
  /**
192
- * Data returned by {@linkcode ISessionCommands.getSession}.
164
+ * Data returned by {@linkcode ISessionHandler.getSession}.
193
165
  *
194
166
  * @typeParam C - The driver's constraints
195
167
  * @typeParam T - Any extra data the driver stuffs in here
@@ -469,13 +441,6 @@ export interface ISessionHandler<
469
441
  */
470
442
  deleteSession(sessionId?: string, driverData?: DriverData[]): Promise<DeleteResult | void>;
471
443
 
472
- /**
473
- * Get data for all sessions running on an Appium server
474
- *
475
- * @returns A list of session data objects
476
- */
477
- getSessions(): Promise<MultiSessionData[]>;
478
-
479
444
  /**
480
445
  * Get the data for the current session
481
446
  *
@@ -610,6 +575,7 @@ export interface DriverStatus {
610
575
  export interface Core<C extends Constraints, Settings extends StringRecord = StringRecord> {
611
576
  shouldValidateCaps: boolean;
612
577
  sessionId: string | null;
578
+ sessionCreationTimestampMs: number;
613
579
  opts: DriverOpts<C>;
614
580
  initialOpts: InitialOpts;
615
581
  protocol?: Protocol;
@@ -629,10 +595,6 @@ export interface Core<C extends Constraints, Settings extends StringRecord = Str
629
595
  isCommandsQueueEnabled: boolean;
630
596
  eventHistory: EventHistory;
631
597
  bidiEventSubs: Record<string, string[]>;
632
- /**
633
- * @deprecated Drivers no longer need to opt into BiDi support explicitly
634
- */
635
- doesSupportBidi?: boolean;
636
598
  updateBidiCommands(cmds: BidiModuleMap): void;
637
599
  onUnexpectedShutdown(handler: () => any): void;
638
600
  /**
@@ -730,6 +692,19 @@ export interface Driver<
730
692
  */
731
693
  executeCommand(cmd: string, ...args: any[]): Promise<any>;
732
694
 
695
+
696
+ /**
697
+ * A helper method to modify the command name before it's logged.
698
+ *
699
+ * Useful for resolving generic commands like 'execute' to a more specific
700
+ * name based on arguments (e.g., identifying custom extensions).
701
+ *
702
+ * @param cmd - The original command name
703
+ * @param args - Arguments passed to the command
704
+ * @returns A potentially updated command name
705
+ */
706
+ clarifyCommandName?(cmd: string, args: string[]): string;
707
+
733
708
  /** Execute a driver (WebDriver Bidi protocol) command by its name as defined in the bidi commands file
734
709
  * @param bidiCmd - the name of the command in the bidi spec
735
710
  * @param args - arguments to pass to the command
@@ -750,14 +725,6 @@ export interface Driver<
750
725
  */
751
726
  startNewCommandTimeout(): Promise<void>;
752
727
 
753
- /**
754
- * Reset the current session (run the delete session and create session subroutines)
755
- *
756
- * @deprecated Use explicit session management commands instead
757
- * @privateRemarks This is implemented by `BaseDriver` and is used within `@appium/driver-test-support`
758
- */
759
- reset(): Promise<void>;
760
-
761
728
  /**
762
729
  * The processed capabilities used to start the session represented by the current driver instance
763
730
  */
@@ -1267,163 +1234,6 @@ export interface ExternalDriver<
1267
1234
  */
1268
1235
  getDeviceTime?(format?: string): Promise<string>;
1269
1236
 
1270
- /**
1271
- * List the performance data types supported by this driver, which can be used in a call to get
1272
- * the performance data by type.
1273
- *
1274
- * @returns The list of types
1275
- *
1276
- * @deprecated
1277
- */
1278
- getPerformanceDataTypes?(): Promise<string[]>;
1279
-
1280
- /**
1281
- * Get the list of performance data associated with a given type
1282
- *
1283
- * @param packageName - the package name / id of the app to retrieve data for
1284
- * @param dataType - the performance data type; one of those retrieved in a call to
1285
- * getPerformanceDataTypes
1286
- * @param dataReadTimeout - how long to wait for data before timing out
1287
- *
1288
- * @returns A list of performance data strings
1289
- *
1290
- * @deprecated
1291
- */
1292
- getPerformanceData?(
1293
- packageName: string,
1294
- dataType: string,
1295
- dataReadTimeout?: number,
1296
- ): Promise<any>;
1297
-
1298
- /**
1299
- * Press a device hardware key by its code for the default duration
1300
- *
1301
- * @param keycode - the keycode
1302
- * @param metastate - the code denoting the simultaneous pressing of any meta keys (shift etc)
1303
- * @param flags - the code denoting the combination of extra flags
1304
- *
1305
- * @deprecated
1306
- */
1307
- pressKeyCode?(keycode: number, metastate?: number, flags?: number): Promise<void>;
1308
-
1309
- /**
1310
- * Press a device hardware key by its code for a longer duration
1311
- *
1312
- * @param keycode - the keycode
1313
- * @param metastate - the code denoting the simultaneous pressing of any meta keys (shift etc)
1314
- * @param flags - the code denoting the combination of extra flags
1315
- *
1316
- * @deprecated
1317
- *
1318
- */
1319
- longPressKeyCode?(keycode: number, metastate?: number, flags?: number): Promise<void>;
1320
-
1321
- /**
1322
- * Apply a synthetic fingerprint to the fingerprint detector of the device
1323
- *
1324
- * @param fingerprintId - the numeric ID of the fingerprint to use
1325
- *
1326
- * @deprecated
1327
- */
1328
- fingerprint?(fingerprintId: number): Promise<void>;
1329
-
1330
- /**
1331
- * Simulate sending an SMS message from a certain phone number to the device
1332
- *
1333
- * @param phoneNumber - the number to pretend the message is from
1334
- * @param message - the SMS text
1335
- *
1336
- * @deprecated
1337
- */
1338
- sendSMS?(phoneNumber: string, message: string): Promise<void>;
1339
-
1340
- /**
1341
- * Simulate triggering a phone call from a phone number and having the device take an action in
1342
- * response
1343
- *
1344
- * @param phoneNumber - the number to pretend the call is from
1345
- * @param action - the action to take in response (accept, reject, etc...)
1346
- *
1347
- * @deprecated
1348
- */
1349
- gsmCall?(phoneNumber: string, action: string): Promise<void>;
1350
-
1351
- /**
1352
- * Simulate setting the GSM signal strength for a cell phone
1353
- *
1354
- * @param singalStrength - the strength in a driver-appropriate string
1355
- *
1356
- * @deprecated
1357
- */
1358
- gsmSignal?(signalStrength: string | number): Promise<void>;
1359
-
1360
- /**
1361
- * Do something with GSM voice (unclear; this should not be implemented anywhere)
1362
- *
1363
- * @param state - the state
1364
- *
1365
- * @deprecated
1366
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1367
- */
1368
- gsmVoice?(state: string): Promise<void>;
1369
-
1370
- /**
1371
- * Set the simulated power capacity of the device
1372
- *
1373
- * @param percent - how full the battery should become
1374
- *
1375
- * @deprecated
1376
- */
1377
- powerCapacity?(percent: number): Promise<void>;
1378
-
1379
- /**
1380
- * Set the AC-connected power state of the device
1381
- *
1382
- * @param state - whether the device is connected to power or not
1383
- *
1384
- * @deprecated
1385
- */
1386
- powerAC?(state: string): Promise<void>;
1387
-
1388
- /**
1389
- * Set the network speed of the device
1390
- *
1391
- * @param netspeed - the speed as a string, like '3G'
1392
- *
1393
- * @deprecated
1394
- */
1395
- networkSpeed?(netspeed: string): Promise<void>;
1396
-
1397
- /**
1398
- * Simulate a keyevent on the device
1399
- *
1400
- * @param keycode - the manufacturer defined keycode
1401
- * @param metastate - the combination of meta startUnexpectedShutdown
1402
- *
1403
- * @deprecated
1404
- */
1405
- keyevent?(keycode: string | number, metastate?: string | number): Promise<void>;
1406
-
1407
- /**
1408
- * Get the current activity name
1409
- *
1410
- * @returns The activity name
1411
- *
1412
- * @deprecated
1413
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1414
- */
1415
- getCurrentActivity?(): Promise<string>;
1416
-
1417
- /**
1418
- * Get the current active app package name/id
1419
- *
1420
- * @returns The package name
1421
- *
1422
- * @deprecated
1423
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1424
- */
1425
- getCurrentPackage?(): Promise<string>;
1426
-
1427
1237
  /**
1428
1238
  * Install an app on a device
1429
1239
  *
@@ -1526,174 +1336,6 @@ export interface ExternalDriver<
1526
1336
  */
1527
1337
  pullFolder?(path: string): Promise<string>;
1528
1338
 
1529
- /**
1530
- * Toggle airplane/flight mode for the device
1531
- *
1532
- * @deprecated
1533
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1534
- */
1535
- toggleFlightMode?(): Promise<void>;
1536
-
1537
- /**
1538
- * Toggle cell network data
1539
- *
1540
- * @deprecated
1541
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1542
- */
1543
- toggleData?(): Promise<void>;
1544
-
1545
- /**
1546
- * Toggle WiFi radio status
1547
- *
1548
- * @deprecated
1549
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1550
- */
1551
- toggleWiFi?(): Promise<void>;
1552
-
1553
- /**
1554
- * Toggle location services for the device
1555
- *
1556
- * @deprecated
1557
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1558
- */
1559
- toggleLocationServices?(): Promise<void>;
1560
-
1561
- /**
1562
- * Open the notifications shade/screen
1563
- *
1564
- * @deprecated
1565
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1566
- */
1567
- openNotifications?(): Promise<void>;
1568
-
1569
- /**
1570
- * Start an Android activity within an app
1571
- *
1572
- * @param appPackage - the app package id
1573
- * @param appActivity - the activity name
1574
- * @param appWaitPackage - the package id to wait for if different from the app package
1575
- * @param appWaitActivity - the activity name to wait for being active if different from
1576
- * appActivity
1577
- * @param intentAction - the action for the intent to use to start the activity
1578
- * @param intentCategory - the category for the intent
1579
- * @param flags - the flags for the intent
1580
- * @param optionalIntentArguments - additional arguments to be passed to launching the intent
1581
- * @param dontStopAppOnReset - set to true to not stop the current app before launching the
1582
- * activity
1583
- *
1584
- * @deprecated
1585
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1586
- */
1587
- startActivity?(
1588
- appPackage: string,
1589
- appActivity: string,
1590
- appWaitPackage?: string,
1591
- appWaitActivity?: string,
1592
- intentAction?: string,
1593
- intentCategory?: string,
1594
- intentFlags?: string,
1595
- optionalIntentArguments?: string,
1596
- dontStopAppOnReset?: boolean,
1597
- ): Promise<void>;
1598
-
1599
- /**
1600
- * Get information from the system bars of a device
1601
- *
1602
- * @returns An array of information objects of driver-specific shape
1603
- *
1604
- * @deprecated
1605
- */
1606
- getSystemBars?(): Promise<unknown>;
1607
-
1608
- /**
1609
- * Get the display's pixel density
1610
- *
1611
- * @returns The density
1612
- *
1613
- * @deprecated
1614
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1615
- */
1616
- getDisplayDensity?(): Promise<number>;
1617
-
1618
- /**
1619
- * End platform-specific code coverage tracing
1620
- *
1621
- * @param intent - the Android intent for the coverage activity
1622
- * @param path - the path to place the results
1623
- *
1624
- * @deprecated
1625
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1626
- */
1627
- endCoverage?(intent: string, path: string): Promise<void>;
1628
-
1629
- /**
1630
- * Set the value of a text field but ensure the current value is replace and not appended
1631
- *
1632
- * @param value - the text to set
1633
- * @param elementId - the element to set it in
1634
- *
1635
- * @deprecated
1636
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1637
- */
1638
- replaceValue?(value: string, elementId: string): Promise<void>;
1639
-
1640
- // JSONWP
1641
- /**
1642
- * Check whether two elements are identical
1643
- *
1644
- * @param elementId - the first element's ID
1645
- * @param otherElementId - the second element's ID
1646
- *
1647
- * @returns True if the elements are equal, false otherwise
1648
- *
1649
- * @deprecated
1650
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1651
- */
1652
- equalsElement?(elementId: string, otherElementId: string): Promise<boolean>;
1653
- /**
1654
- * Get the list of IME engines
1655
- *
1656
- * @returns The list of IME engines
1657
- *
1658
- * @deprecated
1659
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1660
- */
1661
- availableIMEEngines?(): Promise<string[]>;
1662
-
1663
- /**
1664
- * Get the active IME engine
1665
- *
1666
- * @returns The name of the active engine
1667
- *
1668
- * @deprecated
1669
- */
1670
- getActiveIMEEngine?(): Promise<string>;
1671
-
1672
- /**
1673
- * Determine whether an IME is active
1674
- *
1675
- * @returns True if the IME is activated
1676
- *
1677
- * @deprecated
1678
- */
1679
- isIMEActivated?(): Promise<boolean>;
1680
-
1681
- /**
1682
- * Deactivate an IME engine
1683
- *
1684
- * @deprecated
1685
- */
1686
- deactivateIMEEngine?(): Promise<void>;
1687
-
1688
- /**
1689
- * Activate an IME engine
1690
- *
1691
- * @param engine - the name of the engine
1692
- *
1693
- * @deprecated
1694
- */
1695
- activateIMEEngine?(engine: string): Promise<void>;
1696
-
1697
1339
  /**
1698
1340
  * Get the device orientation
1699
1341
  *
@@ -1708,105 +1350,6 @@ export interface ExternalDriver<
1708
1350
  */
1709
1351
  setOrientation?(orientation: string): Promise<void>;
1710
1352
 
1711
- /**
1712
- * Trigger a mouse button down
1713
- *
1714
- * @param button - the button ID
1715
- *
1716
- * @deprecated Use the Actions API instead
1717
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1718
- */
1719
- buttonDown?(button?: number): Promise<void>;
1720
-
1721
- /**
1722
- * Trigger a mouse button up
1723
- *
1724
- * @param button - the button ID
1725
- *
1726
- * @deprecated Use the Actions API instead
1727
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1728
- */
1729
- buttonUp?(button?: number): Promise<void>;
1730
-
1731
- /**
1732
- * Click the current mouse location
1733
- *
1734
- * @param button - the button ID
1735
- *
1736
- * @deprecated Use the Actions API instead
1737
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1738
- */
1739
- clickCurrent?(button?: number): Promise<void>;
1740
-
1741
- /**
1742
- * Double-click the current mouse location
1743
- *
1744
- * @deprecated Use the Actions API instead
1745
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1746
- */
1747
- doubleClick?(): Promise<void>;
1748
-
1749
- /**
1750
- * Perform a touch down event at the location specified
1751
- *
1752
- * @param x - the x coordinate
1753
- * @param y - the y coordinate
1754
- *
1755
- * @deprecated Use the Actions API instead
1756
- */
1757
- touchDown?(element: string, x: number, y: number): Promise<void>;
1758
-
1759
- /**
1760
- * Perform a touch up event at the location specified
1761
- *
1762
- * @param x - the x coordinate
1763
- * @param y - the y coordinate
1764
- *
1765
- * @deprecated Use the Actions API instead
1766
- */
1767
- touchUp?(element: string, x: number, y: number): Promise<void>;
1768
-
1769
- /**
1770
- * Perform a touch move event at the location specified
1771
- *
1772
- * @param x - the x coordinate
1773
- * @param y - the y coordinate
1774
- *
1775
- * @deprecated Use the Actions API instead
1776
- */
1777
- touchMove?(element: string, x: number, y: number): Promise<void>;
1778
-
1779
- /**
1780
- * Perform a long touch down event at the location specified
1781
- *
1782
- * @param elementId - the id of the element to long touch
1783
- *
1784
- * @deprecated Use the Actions API instead
1785
- */
1786
- touchLongClick?(element: string, x: number, y: number, duration: number): Promise<void>;
1787
-
1788
- /**
1789
- * Perform a flick event at the location specified
1790
- *
1791
- * @param element - the element to make coordinates relative to
1792
- * @param xSpeed - the horizontal flick speed (in driver-specific units)
1793
- * @param ySpeed - the vertical flick speed (in driver-specific units)
1794
- * @param xOffset - the x coordinate
1795
- * @param yOffset - the y coordinate
1796
- * @param speed - the speed (unclear how this relates to xSpeed and ySpeed)
1797
- *
1798
- * @deprecated Use the Actions API instead
1799
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1800
- */
1801
- flick?(
1802
- element?: string,
1803
- xSpeed?: number,
1804
- ySpeed?: number,
1805
- xOffset?: number,
1806
- yOffset?: number,
1807
- speed?: number,
1808
- ): Promise<void>;
1809
-
1810
1353
  /**
1811
1354
  * Get the virtual or real geographical location of a device
1812
1355
  *
@@ -1848,18 +1391,6 @@ export interface ExternalDriver<
1848
1391
  */
1849
1392
  getContexts?(): Promise<Ctx[]>;
1850
1393
 
1851
- /**
1852
- * Get the index of an element on the page
1853
- *
1854
- * @param elementId - the element id
1855
- *
1856
- * @returns The page index
1857
- *
1858
- * @deprecated
1859
- * @privateRemarks Not implemented in `appium-xcuitest-driver`
1860
- */
1861
- getPageIndex?(elementId: string): Promise<string>;
1862
-
1863
1394
  /**
1864
1395
  * Get the network connection state of a device
1865
1396
  * @see {@link https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes}
package/lib/server.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import type {Express} from 'express';
2
2
  import type {Server as WSServer} from 'ws';
3
3
  import type {Server as HTTPServer} from 'node:http';
4
- import type {Socket} from 'node:net';
5
4
  import {ServerArgs} from './config';
6
5
 
7
6
  /**
@@ -49,13 +48,6 @@ export interface AppiumServerExtension {
49
48
  isSecure(): boolean;
50
49
  }
51
50
 
52
- /**
53
- * @deprecated This interface will be removed
54
- */
55
- export interface AppiumServerSocket extends Socket {
56
- _openReqCount: number;
57
- }
58
-
59
51
  export {WSServer};
60
52
 
61
53
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appium/types",
3
- "version": "0.25.3",
3
+ "version": "1.0.0-rc.1",
4
4
  "description": "Various type declarations used across Appium",
5
5
  "keywords": [
6
6
  "automation",
@@ -38,17 +38,18 @@
38
38
  "test:types": "tsd"
39
39
  },
40
40
  "dependencies": {
41
- "@appium/logger": "^1.7.0",
42
- "@appium/schema": "^0.8.1",
43
- "@appium/tsconfig": "^0.3.5",
44
- "type-fest": "4.40.0"
41
+ "@appium/logger": "^2.0.0-rc.1",
42
+ "@appium/schema": "^1.0.0-rc.1",
43
+ "@appium/tsconfig": "^1.0.0-rc.1",
44
+ "type-fest": "4.41.0"
45
45
  },
46
46
  "engines": {
47
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0",
48
- "npm": ">=8"
47
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
48
+ "npm": ">=10"
49
49
  },
50
50
  "publishConfig": {
51
- "access": "public"
51
+ "access": "public",
52
+ "tag": "rc"
52
53
  },
53
- "gitHead": "8476bd3f65fc549f9a589d20d19236d0ce4ea335"
54
+ "gitHead": "157425ce6aa01c009533f5bf6a56b14570222b00"
54
55
  }