@appium/base-driver 10.0.0-beta.0 → 10.0.0-beta.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.
Files changed (92) hide show
  1. package/README.md +0 -8
  2. package/build/lib/basedriver/capabilities.d.ts.map +1 -1
  3. package/build/lib/basedriver/capabilities.js +2 -4
  4. package/build/lib/basedriver/capabilities.js.map +1 -1
  5. package/build/lib/basedriver/commands/timeout.js +7 -25
  6. package/build/lib/basedriver/commands/timeout.js.map +1 -1
  7. package/build/lib/basedriver/core.d.ts +0 -8
  8. package/build/lib/basedriver/core.d.ts.map +1 -1
  9. package/build/lib/basedriver/core.js +8 -18
  10. package/build/lib/basedriver/core.js.map +1 -1
  11. package/build/lib/basedriver/driver.js +2 -2
  12. package/build/lib/basedriver/driver.js.map +1 -1
  13. package/build/lib/basedriver/helpers.d.ts +9 -1
  14. package/build/lib/basedriver/helpers.d.ts.map +1 -1
  15. package/build/lib/basedriver/helpers.js +56 -142
  16. package/build/lib/basedriver/helpers.js.map +1 -1
  17. package/build/lib/basedriver/validation.d.ts +7 -0
  18. package/build/lib/basedriver/validation.d.ts.map +1 -0
  19. package/build/lib/basedriver/validation.js +130 -0
  20. package/build/lib/basedriver/validation.js.map +1 -0
  21. package/build/lib/express/middleware.d.ts +0 -6
  22. package/build/lib/express/middleware.d.ts.map +1 -1
  23. package/build/lib/express/middleware.js +28 -60
  24. package/build/lib/express/middleware.js.map +1 -1
  25. package/build/lib/express/server.d.ts.map +1 -1
  26. package/build/lib/express/server.js +0 -1
  27. package/build/lib/express/server.js.map +1 -1
  28. package/build/lib/helpers/capabilities.d.ts +13 -6
  29. package/build/lib/helpers/capabilities.d.ts.map +1 -1
  30. package/build/lib/helpers/capabilities.js +7 -0
  31. package/build/lib/helpers/capabilities.js.map +1 -1
  32. package/build/lib/index.d.ts +1 -0
  33. package/build/lib/index.d.ts.map +1 -1
  34. package/build/lib/index.js +3 -1
  35. package/build/lib/index.js.map +1 -1
  36. package/build/lib/jsonwp-proxy/proxy.d.ts +0 -8
  37. package/build/lib/jsonwp-proxy/proxy.d.ts.map +1 -1
  38. package/build/lib/jsonwp-proxy/proxy.js +7 -38
  39. package/build/lib/jsonwp-proxy/proxy.js.map +1 -1
  40. package/build/lib/protocol/errors.d.ts +171 -277
  41. package/build/lib/protocol/errors.d.ts.map +1 -1
  42. package/build/lib/protocol/errors.js +201 -421
  43. package/build/lib/protocol/errors.js.map +1 -1
  44. package/build/lib/protocol/helpers.d.ts +6 -6
  45. package/build/lib/protocol/helpers.d.ts.map +1 -1
  46. package/build/lib/protocol/helpers.js +11 -7
  47. package/build/lib/protocol/helpers.js.map +1 -1
  48. package/build/lib/protocol/index.d.ts +2 -1
  49. package/build/lib/protocol/index.d.ts.map +1 -1
  50. package/build/lib/protocol/index.js +2 -1
  51. package/build/lib/protocol/index.js.map +1 -1
  52. package/build/lib/protocol/protocol.d.ts +5 -0
  53. package/build/lib/protocol/protocol.d.ts.map +1 -1
  54. package/build/lib/protocol/protocol.js +23 -23
  55. package/build/lib/protocol/protocol.js.map +1 -1
  56. package/build/lib/protocol/routes.d.ts +14 -715
  57. package/build/lib/protocol/routes.d.ts.map +1 -1
  58. package/build/lib/protocol/routes.js +28 -487
  59. package/build/lib/protocol/routes.js.map +1 -1
  60. package/build/lib/protocol/validators.d.ts +4 -7
  61. package/build/lib/protocol/validators.d.ts.map +1 -1
  62. package/build/lib/protocol/validators.js +4 -21
  63. package/build/lib/protocol/validators.js.map +1 -1
  64. package/lib/basedriver/capabilities.ts +2 -4
  65. package/lib/basedriver/commands/timeout.ts +11 -34
  66. package/lib/basedriver/core.ts +10 -19
  67. package/lib/basedriver/driver.ts +3 -3
  68. package/lib/basedriver/helpers.js +61 -167
  69. package/lib/basedriver/validation.ts +145 -0
  70. package/lib/express/middleware.js +32 -70
  71. package/lib/express/server.js +0 -2
  72. package/lib/helpers/capabilities.js +9 -4
  73. package/lib/index.js +2 -0
  74. package/lib/jsonwp-proxy/proxy.js +8 -45
  75. package/lib/protocol/{errors.js → errors.ts} +322 -436
  76. package/lib/protocol/helpers.js +12 -8
  77. package/lib/protocol/index.js +8 -1
  78. package/lib/protocol/protocol.js +25 -23
  79. package/lib/protocol/routes.js +30 -497
  80. package/lib/protocol/validators.ts +19 -0
  81. package/package.json +10 -11
  82. package/build/lib/basedriver/desired-caps.d.ts +0 -5
  83. package/build/lib/basedriver/desired-caps.d.ts.map +0 -1
  84. package/build/lib/basedriver/desired-caps.js +0 -92
  85. package/build/lib/basedriver/desired-caps.js.map +0 -1
  86. package/lib/basedriver/README.md +0 -36
  87. package/lib/basedriver/desired-caps.js +0 -103
  88. package/lib/express/README.md +0 -59
  89. package/lib/jsonwp-proxy/README.md +0 -52
  90. package/lib/jsonwp-status/README.md +0 -20
  91. package/lib/protocol/README.md +0 -100
  92. package/lib/protocol/validators.js +0 -38
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../lib/protocol/routes.js"],"names":[],"mappings":"AAk7BA;;;;;;GAMG;AACH,6CALW,MAAM,WACN,OAAO,eAAe,EAAE,UAAU,aAClC,MAAM,GACJ,MAAM,GAAC,SAAS,CA8C5B;AA98BD;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA84BG;AAGH,iCAEyB;AAkEzB,8CAAyG"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../lib/protocol/routes.js"],"names":[],"mappings":"AA+dA;;;;;;GAMG;AACH,6CALW,MAAM,WACN,OAAO,eAAe,EAAE,UAAU,aAClC,MAAM,GACJ,MAAM,GAAC,SAAS,CA8C5B;AAxgBD;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwcG;AAGH,iCAEyB;AAkEzB,8CAA0F"}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // @ts-check
3
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
4
  };
@@ -7,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
6
  exports.NO_SESSION_ID_COMMANDS = exports.ALL_COMMANDS = exports.METHOD_MAP = void 0;
8
7
  exports.routeToCommandName = routeToCommandName;
9
8
  const lodash_1 = __importDefault(require("lodash"));
10
- const support_1 = require("@appium/support");
11
9
  const constants_1 = require("../constants");
12
10
  const path_to_regexp_1 = require("path-to-regexp");
13
11
  const lru_cache_1 = require("lru-cache");
@@ -15,14 +13,6 @@ const lru_cache_1 = require("lru-cache");
15
13
  const COMMAND_NAMES_CACHE = new lru_cache_1.LRUCache({
16
14
  max: 1024,
17
15
  });
18
- const SET_ALERT_TEXT_PAYLOAD_PARAMS = {
19
- validate: (jsonObj) => !support_1.util.hasValue(jsonObj.value) &&
20
- !support_1.util.hasValue(jsonObj.text) &&
21
- 'either "text" or "value" must be set',
22
- optional: ['value', 'text'],
23
- // Prefer 'value' since it's more backward-compatible.
24
- makeArgs: (jsonObj) => [jsonObj.value || jsonObj.text],
25
- };
26
16
  /**
27
17
  * define the routes, mapping of HTTP methods to particular driver commands, and
28
18
  * any parameters that are expected in a request parameters can be `required` or
@@ -31,7 +21,7 @@ const SET_ALERT_TEXT_PAYLOAD_PARAMS = {
31
21
  */
32
22
  exports.METHOD_MAP = ({
33
23
  //
34
- // W3C WebDriver (and deprecated MJSONWP that will be removed in Appium 3)
24
+ // W3C WebDriver
35
25
  // https://www.w3.org/TR/webdriver1/
36
26
  // https://www.w3.org/TR/webdriver2/
37
27
  //
@@ -42,39 +32,26 @@ exports.METHOD_MAP = ({
42
32
  POST: {
43
33
  command: 'createSession',
44
34
  payloadParams: {
45
- // TODO: Appium 3 will accept only 'capabilities'.
46
- validate: (jsonObj) => !jsonObj.capabilities &&
47
- !jsonObj.desiredCapabilities &&
48
- 'we require one of "desiredCapabilities" or "capabilities" object',
49
- optional: ['desiredCapabilities', 'requiredCapabilities', 'capabilities'],
35
+ optional: ['capabilities', 'capabilities', 'capabilities'],
50
36
  },
51
37
  },
52
38
  },
53
39
  '/session/:sessionId': {
40
+ // TODO: Decide on the future of this route later
54
41
  GET: { command: 'getSession', deprecated: true },
55
42
  DELETE: { command: 'deleteSession' },
56
43
  },
57
44
  '/session/:sessionId/timeouts': {
58
- GET: { command: 'getTimeouts' }, // W3C route
45
+ GET: { command: 'getTimeouts' },
59
46
  POST: {
60
47
  command: 'timeouts',
61
48
  payloadParams: {
62
- validate: (jsonObj, protocolName) => {
63
- if (protocolName === constants_1.PROTOCOLS.W3C) {
64
- if (!support_1.util.hasValue(jsonObj.script) &&
65
- !support_1.util.hasValue(jsonObj.pageLoad) &&
66
- !support_1.util.hasValue(jsonObj.implicit)) {
67
- return 'W3C protocol expects any of script, pageLoad or implicit to be set';
68
- }
69
- }
70
- else {
71
- // TODO: Remove in Appium 3
72
- if (!support_1.util.hasValue(jsonObj.type) || !support_1.util.hasValue(jsonObj.ms)) {
73
- return 'MJSONWP protocol requires type and ms';
74
- }
49
+ validate: ({ script, pageLoad, implicit }) => {
50
+ if ([script, pageLoad, implicit].every(lodash_1.default.isNil)) {
51
+ return 'W3C protocol expects any of script, pageLoad or implicit to be set';
75
52
  }
76
53
  },
77
- optional: ['type', 'ms', 'script', 'pageLoad', 'implicit'],
54
+ optional: ['script', 'pageLoad', 'implicit'],
78
55
  },
79
56
  },
80
57
  },
@@ -108,21 +85,7 @@ exports.METHOD_MAP = ({
108
85
  POST: {
109
86
  command: 'setWindow',
110
87
  payloadParams: {
111
- // TODO: Appium 3 will only accept 'handle'. 'name' will be ginored.
112
- optional: ['name', 'handle'],
113
- // Return both values to match W3C and JSONWP protocols
114
- makeArgs: (jsonObj) => {
115
- if (support_1.util.hasValue(jsonObj.handle) && !support_1.util.hasValue(jsonObj.name)) {
116
- return [jsonObj.handle, jsonObj.handle];
117
- }
118
- if (support_1.util.hasValue(jsonObj.name) && !support_1.util.hasValue(jsonObj.handle)) {
119
- return [jsonObj.name, jsonObj.name];
120
- }
121
- return [jsonObj.name, jsonObj.handle];
122
- },
123
- validate: (jsonObj) => !support_1.util.hasValue(jsonObj.name) &&
124
- !support_1.util.hasValue(jsonObj.handle) &&
125
- 'we require one of "name" or "handle" to be set',
88
+ required: ['handle'],
126
89
  },
127
90
  },
128
91
  DELETE: { command: 'closeWindow' },
@@ -167,8 +130,7 @@ exports.METHOD_MAP = ({
167
130
  },
168
131
  },
169
132
  '/session/:sessionId/element/active': {
170
- GET: { command: 'active' }, // W3C: https://w3c.github.io/webdriver/webdriver-spec.html#dfn-get-active-element
171
- POST: { command: 'active', deprecated: true },
133
+ GET: { command: 'active' },
172
134
  },
173
135
  '/session/:sessionId/element/:elementId': {
174
136
  GET: {},
@@ -195,17 +157,7 @@ exports.METHOD_MAP = ({
195
157
  POST: {
196
158
  command: 'setValue',
197
159
  payloadParams: {
198
- validate: (jsonObj) => !support_1.util.hasValue(jsonObj.value) &&
199
- !support_1.util.hasValue(jsonObj.text) &&
200
- 'we require one of "text" or "value" params',
201
- // TODO: Appium 3 will accept only 'value'.
202
- optional: ['value', 'text'],
203
- // override the default argument constructor because of the special
204
- // logic here. Basically we want to accept either a value (old JSONWP)
205
- // or a text (new W3C) parameter, but only send one of them to the
206
- // command (not both). Prefer 'value' since it's more
207
- // backward-compatible.
208
- makeArgs: (jsonObj) => [jsonObj.value || jsonObj.text],
160
+ required: ['text'],
209
161
  },
210
162
  },
211
163
  },
@@ -264,7 +216,9 @@ exports.METHOD_MAP = ({
264
216
  GET: { command: 'getAlertText' },
265
217
  POST: {
266
218
  command: 'setAlertText',
267
- payloadParams: SET_ALERT_TEXT_PAYLOAD_PARAMS,
219
+ payloadParams: {
220
+ required: ['text'],
221
+ },
268
222
  },
269
223
  },
270
224
  '/session/:sessionId/alert/accept': {
@@ -299,19 +253,23 @@ exports.METHOD_MAP = ({
299
253
  // Appium specific
300
254
  //
301
255
  '/session/:sessionId/ime/available_engines': {
302
- GET: { command: 'availableIMEEngines' },
256
+ GET: { command: 'availableIMEEngines', deprecated: true },
303
257
  },
304
258
  '/session/:sessionId/ime/active_engine': {
305
- GET: { command: 'getActiveIMEEngine' },
259
+ GET: { command: 'getActiveIMEEngine', deprecated: true },
306
260
  },
307
261
  '/session/:sessionId/ime/activated': {
308
- GET: { command: 'isIMEActivated' },
262
+ GET: { command: 'isIMEActivated', deprecated: true },
309
263
  },
310
264
  '/session/:sessionId/ime/deactivate': {
311
- POST: { command: 'deactivateIMEEngine' },
265
+ POST: { command: 'deactivateIMEEngine', deprecated: true },
312
266
  },
313
267
  '/session/:sessionId/ime/activate': {
314
- POST: { command: 'activateIMEEngine', payloadParams: { required: ['engine'] } },
268
+ POST: {
269
+ command: 'activateIMEEngine',
270
+ payloadParams: { required: ['engine'] },
271
+ deprecated: true,
272
+ },
315
273
  },
316
274
  '/session/:sessionId/rotation': {
317
275
  GET: { command: 'getRotation' },
@@ -336,16 +294,18 @@ exports.METHOD_MAP = ({
336
294
  GET: { command: 'getContexts' },
337
295
  },
338
296
  '/session/:sessionId/network_connection': {
339
- GET: { command: 'getNetworkConnection' },
297
+ GET: { command: 'getNetworkConnection', deprecated: true },
340
298
  POST: {
341
299
  command: 'setNetworkConnection',
342
300
  payloadParams: { unwrap: 'parameters', required: ['type'] },
301
+ deprecated: true,
343
302
  },
344
303
  },
345
304
  '/session/:sessionId/receive_async_response': {
346
305
  POST: {
347
306
  command: 'receiveAsyncResponse',
348
307
  payloadParams: { required: ['status', 'value'] },
308
+ deprecated: true,
349
309
  },
350
310
  },
351
311
  '/appium/sessions': {
@@ -355,7 +315,7 @@ exports.METHOD_MAP = ({
355
315
  GET: { command: 'getAppiumSessionCapabilities' }
356
316
  },
357
317
  '/session/:sessionId/appium/device/system_time': {
358
- GET: { command: 'getDeviceTime', payloadParams: { optional: ['format'] } },
318
+ GET: { command: 'getDeviceTime' },
359
319
  POST: { command: 'getDeviceTime', payloadParams: { optional: ['format'] } },
360
320
  },
361
321
  // #region Applications Management
@@ -404,18 +364,11 @@ exports.METHOD_MAP = ({
404
364
  },
405
365
  },
406
366
  '/session/:sessionId/appium/device/app_state': {
407
- GET: {
408
- command: 'queryAppState',
409
- payloadParams: {
410
- required: [['appId'], ['bundleId']],
411
- },
412
- },
413
367
  POST: {
414
368
  command: 'queryAppState',
415
369
  payloadParams: {
416
370
  required: [['appId'], ['bundleId']],
417
371
  },
418
- deprecated: true,
419
372
  },
420
373
  },
421
374
  // #endregion
@@ -516,418 +469,6 @@ exports.METHOD_MAP = ({
516
469
  },
517
470
  },
518
471
  // #endregion
519
- //
520
- // Endpoints deprecated entirely
521
- //
522
- // #region MJSONWP
523
- '/sessions': {
524
- GET: { command: 'getSessions', deprecated: true },
525
- },
526
- '/session/:sessionId/timeouts/async_script': {
527
- POST: { command: 'asyncScriptTimeout', payloadParams: { required: ['ms'] }, deprecated: true },
528
- },
529
- '/session/:sessionId/timeouts/implicit_wait': {
530
- POST: { command: 'implicitWait', payloadParams: { required: ['ms'] }, deprecated: true },
531
- },
532
- '/session/:sessionId/window_handle': {
533
- GET: { command: 'getWindowHandle', deprecated: true },
534
- },
535
- // Only 'window/handles' exists in W3C WebDriver spec.
536
- '/session/:sessionId/window/handle': {
537
- GET: { command: 'getWindowHandle', deprecated: true },
538
- },
539
- '/session/:sessionId/window_handles': {
540
- GET: { command: 'getWindowHandles', deprecated: true },
541
- },
542
- '/session/:sessionId/execute': {
543
- POST: {
544
- command: 'execute',
545
- payloadParams: { required: ['script', 'args'] },
546
- deprecated: true
547
- },
548
- },
549
- '/session/:sessionId/execute_async': {
550
- POST: {
551
- command: 'executeAsync',
552
- payloadParams: { required: ['script', 'args'] },
553
- deprecated: true
554
- },
555
- },
556
- '/session/:sessionId/window/:windowhandle/size': {
557
- GET: { command: 'getWindowSize', deprecated: true },
558
- },
559
- '/session/:sessionId/window/:windowhandle/position': {
560
- POST: { deprecated: true },
561
- GET: { deprecated: true },
562
- },
563
- '/session/:sessionId/window/:windowhandle/maximize': {
564
- POST: { command: 'maximizeWindow', deprecated: true },
565
- },
566
- '/session/:sessionId/element/:elementId/submit': {
567
- POST: { command: 'submit', deprecated: true },
568
- },
569
- '/session/:sessionId/keys': {
570
- POST: { command: 'keys', payloadParams: { required: ['value'] }, deprecated: true },
571
- },
572
- '/session/:sessionId/element/:elementId/equals/:otherId': {
573
- GET: { command: 'equalsElement', deprecated: true },
574
- },
575
- '/session/:sessionId/element/:elementId/location': {
576
- GET: { command: 'getLocation', deprecated: true },
577
- },
578
- '/session/:sessionId/element/:elementId/location_in_view': {
579
- GET: { command: 'getLocationInView', deprecated: true },
580
- },
581
- '/session/:sessionId/element/:elementId/size': {
582
- GET: { command: 'getSize', deprecated: true },
583
- },
584
- '/session/:sessionId/moveto': {
585
- POST: {
586
- command: 'moveTo',
587
- payloadParams: { optional: ['element', 'xoffset', 'yoffset'] },
588
- deprecated: true,
589
- },
590
- },
591
- '/session/:sessionId/click': {
592
- POST: { command: 'clickCurrent', payloadParams: { optional: ['button'] }, deprecated: true },
593
- },
594
- '/session/:sessionId/buttondown': {
595
- POST: { command: 'buttonDown', payloadParams: { optional: ['button'] }, deprecated: true },
596
- },
597
- '/session/:sessionId/buttonup': {
598
- POST: { command: 'buttonUp', payloadParams: { optional: ['button'] }, deprecated: true },
599
- },
600
- '/session/:sessionId/doubleclick': {
601
- POST: { command: 'doubleClick', deprecated: true },
602
- },
603
- '/session/:sessionId/touch/click': {
604
- POST: { command: 'click', payloadParams: { required: ['element'] }, deprecated: true },
605
- },
606
- '/session/:sessionId/touch/down': {
607
- POST: { command: 'touchDown', payloadParams: { required: ['x', 'y'] }, deprecated: true },
608
- },
609
- '/session/:sessionId/touch/up': {
610
- POST: { command: 'touchUp', payloadParams: { required: ['x', 'y'] }, deprecated: true },
611
- },
612
- '/session/:sessionId/touch/move': {
613
- POST: { command: 'touchMove', payloadParams: { required: ['x', 'y'] }, deprecated: true },
614
- },
615
- '/session/:sessionId/touch/scroll': {
616
- POST: { deprecated: true },
617
- },
618
- '/session/:sessionId/touch/doubleclick': {
619
- POST: { deprecated: true },
620
- },
621
- '/session/:sessionId/touch/longclick': {
622
- POST: {
623
- command: 'touchLongClick',
624
- payloadParams: { required: ['elements'] },
625
- deprecated: true,
626
- },
627
- },
628
- '/session/:sessionId/touch/flick': {
629
- POST: {
630
- command: 'flick',
631
- payloadParams: {
632
- optional: ['element', 'xspeed', 'yspeed', 'xoffset', 'yoffset', 'speed'],
633
- },
634
- deprecated: true,
635
- },
636
- },
637
- '/session/:sessionId/local_storage': {
638
- GET: { deprecated: true },
639
- POST: { deprecated: true },
640
- DELETE: { deprecated: true },
641
- },
642
- '/session/:sessionId/local_storage/key/:key': {
643
- GET: { deprecated: true },
644
- DELETE: { deprecated: true },
645
- },
646
- '/session/:sessionId/local_storage/size': {
647
- GET: { deprecated: true },
648
- },
649
- '/session/:sessionId/session_storage': {
650
- GET: { deprecated: true },
651
- POST: { deprecated: true },
652
- DELETE: { deprecated: true },
653
- },
654
- '/session/:sessionId/session_storage/key/:key': {
655
- GET: { deprecated: true },
656
- DELETE: { deprecated: true },
657
- },
658
- '/session/:sessionId/session_storage/size': {
659
- GET: { deprecated: true },
660
- },
661
- '/session/:sessionId/application_cache/status': {
662
- GET: { deprecated: true },
663
- },
664
- '/session/:sessionId/alert_text': {
665
- GET: { command: 'getAlertText', deprecated: true },
666
- POST: {
667
- command: 'setAlertText',
668
- payloadParams: SET_ALERT_TEXT_PAYLOAD_PARAMS,
669
- deprecated: true
670
- },
671
- },
672
- '/session/:sessionId/accept_alert': {
673
- POST: { command: 'postAcceptAlert', deprecated: true },
674
- },
675
- '/session/:sessionId/dismiss_alert': {
676
- POST: { command: 'postDismissAlert', deprecated: true },
677
- },
678
- // Pre-W3C endpoint for element screenshot
679
- '/session/:sessionId/screenshot/:elementId': {
680
- GET: { command: 'getElementScreenshot', deprecated: true },
681
- },
682
- // #endregion
683
- // #region Appium specific
684
- '/session/:sessionId/element/:elementId/pageIndex': {
685
- GET: { command: 'getPageIndex', deprecated: true },
686
- },
687
- '/session/:sessionId/touch/perform': {
688
- POST: {
689
- command: 'performTouch',
690
- payloadParams: { wrap: 'actions', required: ['actions'] },
691
- deprecated: true,
692
- },
693
- },
694
- '/session/:sessionId/touch/multi/perform': {
695
- POST: {
696
- command: 'performMultiAction',
697
- payloadParams: { required: ['actions'], optional: ['elementId'] },
698
- deprecated: true,
699
- },
700
- },
701
- '/session/:sessionId/appium/device/shake': {
702
- POST: { command: 'mobileShake', deprecated: true },
703
- },
704
- '/session/:sessionId/appium/device/lock': {
705
- POST: { command: 'lock', payloadParams: { optional: ['seconds'] }, deprecated: true },
706
- },
707
- '/session/:sessionId/appium/device/unlock': {
708
- POST: { command: 'unlock', deprecated: true },
709
- },
710
- '/session/:sessionId/appium/device/is_locked': {
711
- POST: { command: 'isLocked', deprecated: true },
712
- },
713
- '/session/:sessionId/appium/start_recording_screen': {
714
- POST: {
715
- command: 'startRecordingScreen',
716
- payloadParams: { optional: ['options'] },
717
- deprecated: true,
718
- },
719
- },
720
- '/session/:sessionId/appium/stop_recording_screen': {
721
- POST: {
722
- command: 'stopRecordingScreen',
723
- payloadParams: { optional: ['options'] },
724
- deprecated: true,
725
- },
726
- },
727
- '/session/:sessionId/appium/performanceData/types': {
728
- POST: { command: 'getPerformanceDataTypes', deprecated: true },
729
- },
730
- '/session/:sessionId/appium/getPerformanceData': {
731
- POST: {
732
- command: 'getPerformanceData',
733
- payloadParams: {
734
- required: ['packageName', 'dataType'],
735
- optional: ['dataReadTimeout'],
736
- },
737
- deprecated: true,
738
- },
739
- },
740
- '/session/:sessionId/appium/device/press_keycode': {
741
- POST: {
742
- command: 'pressKeyCode',
743
- payloadParams: { required: ['keycode'], optional: ['metastate', 'flags'] },
744
- deprecated: true,
745
- },
746
- },
747
- '/session/:sessionId/appium/device/long_press_keycode': {
748
- POST: {
749
- command: 'longPressKeyCode',
750
- payloadParams: { required: ['keycode'], optional: ['metastate', 'flags'] },
751
- deprecated: true,
752
- },
753
- },
754
- '/session/:sessionId/appium/device/finger_print': {
755
- POST: {
756
- command: 'fingerprint',
757
- payloadParams: { required: ['fingerprintId'] },
758
- deprecated: true,
759
- },
760
- },
761
- '/session/:sessionId/appium/device/send_sms': {
762
- POST: {
763
- command: 'sendSMS',
764
- payloadParams: { required: ['phoneNumber', 'message'] },
765
- deprecated: true,
766
- },
767
- },
768
- '/session/:sessionId/appium/device/gsm_call': {
769
- POST: {
770
- command: 'gsmCall',
771
- payloadParams: { required: ['phoneNumber', 'action'] },
772
- deprecated: true,
773
- },
774
- },
775
- '/session/:sessionId/appium/device/gsm_signal': {
776
- POST: {
777
- command: 'gsmSignal',
778
- payloadParams: { required: ['signalStrength'] },
779
- deprecated: true,
780
- },
781
- },
782
- '/session/:sessionId/appium/device/gsm_voice': {
783
- POST: { command: 'gsmVoice', payloadParams: { required: ['state'] }, deprecated: true },
784
- },
785
- '/session/:sessionId/appium/device/power_capacity': {
786
- POST: { command: 'powerCapacity', payloadParams: { required: ['percent'] }, deprecated: true },
787
- },
788
- '/session/:sessionId/appium/device/power_ac': {
789
- POST: { command: 'powerAC', payloadParams: { required: ['state'] }, deprecated: true },
790
- },
791
- '/session/:sessionId/appium/device/network_speed': {
792
- POST: { command: 'networkSpeed', payloadParams: { required: ['netspeed'] }, deprecated: true },
793
- },
794
- '/session/:sessionId/appium/device/keyevent': {
795
- POST: {
796
- command: 'keyevent',
797
- payloadParams: { required: ['keycode'], optional: ['metastate'] },
798
- deprecated: true,
799
- },
800
- },
801
- '/session/:sessionId/appium/device/current_activity': {
802
- GET: { command: 'getCurrentActivity', deprecated: true },
803
- },
804
- '/session/:sessionId/appium/device/current_package': {
805
- GET: { command: 'getCurrentPackage', deprecated: true },
806
- },
807
- '/session/:sessionId/appium/device/toggle_airplane_mode': {
808
- POST: { command: 'toggleFlightMode', deprecated: true },
809
- },
810
- '/session/:sessionId/appium/device/toggle_data': {
811
- POST: { command: 'toggleData', deprecated: true },
812
- },
813
- '/session/:sessionId/appium/device/toggle_wifi': {
814
- POST: { command: 'toggleWiFi', deprecated: true },
815
- },
816
- '/session/:sessionId/appium/device/toggle_location_services': {
817
- POST: { command: 'toggleLocationServices', deprecated: true },
818
- },
819
- '/session/:sessionId/appium/device/open_notifications': {
820
- POST: { command: 'openNotifications', deprecated: true },
821
- },
822
- '/session/:sessionId/appium/device/start_activity': {
823
- POST: {
824
- command: 'startActivity',
825
- payloadParams: {
826
- required: ['appPackage', 'appActivity'],
827
- optional: [
828
- 'appWaitPackage',
829
- 'appWaitActivity',
830
- 'intentAction',
831
- 'intentCategory',
832
- 'intentFlags',
833
- 'optionalIntentArguments',
834
- 'dontStopAppOnReset',
835
- ],
836
- },
837
- deprecated: true,
838
- },
839
- },
840
- '/session/:sessionId/appium/device/system_bars': {
841
- GET: { command: 'getSystemBars', deprecated: true },
842
- },
843
- '/session/:sessionId/appium/device/display_density': {
844
- GET: { command: 'getDisplayDensity', deprecated: true },
845
- },
846
- '/session/:sessionId/appium/simulator/touch_id': {
847
- POST: { command: 'touchId', payloadParams: { required: ['match'] }, deprecated: true },
848
- },
849
- '/session/:sessionId/appium/simulator/toggle_touch_id_enrollment': {
850
- POST: {
851
- command: 'toggleEnrollTouchId',
852
- payloadParams: { optional: ['enabled'] },
853
- deprecated: true,
854
- },
855
- },
856
- '/session/:sessionId/appium/app/launch': {
857
- POST: { command: 'launchApp', deprecated: true },
858
- },
859
- '/session/:sessionId/appium/app/close': {
860
- POST: { command: 'closeApp', deprecated: true },
861
- },
862
- '/session/:sessionId/appium/app/reset': {
863
- POST: { command: 'reset', deprecated: true },
864
- },
865
- '/session/:sessionId/appium/app/background': {
866
- POST: { command: 'background', payloadParams: { required: ['seconds'] }, deprecated: true },
867
- },
868
- '/session/:sessionId/appium/app/end_test_coverage': {
869
- POST: {
870
- command: 'endCoverage',
871
- payloadParams: { required: ['intent', 'path'] },
872
- deprecated: true,
873
- },
874
- },
875
- '/session/:sessionId/appium/app/strings': {
876
- POST: {
877
- command: 'getStrings',
878
- payloadParams: { optional: ['language', 'stringFile'] },
879
- deprecated: true,
880
- },
881
- },
882
- '/session/:sessionId/appium/element/:elementId/value': {
883
- POST: {
884
- command: 'setValueImmediate',
885
- payloadParams: { required: ['text'] },
886
- deprecated: true,
887
- },
888
- },
889
- '/session/:sessionId/appium/element/:elementId/replace_value': {
890
- POST: {
891
- command: 'replaceValue',
892
- payloadParams: { required: ['text'] },
893
- deprecated: true,
894
- },
895
- },
896
- '/session/:sessionId/appium/receive_async_response': {
897
- POST: {
898
- command: 'receiveAsyncResponse',
899
- payloadParams: { required: ['response'] },
900
- deprecated: true,
901
- },
902
- },
903
- '/session/:sessionId/appium/device/set_clipboard': {
904
- POST: {
905
- command: 'setClipboard',
906
- payloadParams: {
907
- required: ['content'],
908
- optional: ['contentType', 'label'],
909
- },
910
- deprecated: true,
911
- },
912
- },
913
- '/session/:sessionId/appium/device/get_clipboard': {
914
- POST: {
915
- command: 'getClipboard',
916
- payloadParams: {
917
- optional: ['contentType'],
918
- },
919
- deprecated: true,
920
- },
921
- },
922
- // #endregion
923
- // #region JSONWP
924
- '/session/:sessionId/log': {
925
- POST: { command: 'getLog', payloadParams: { required: ['type'] }, deprecated: true },
926
- },
927
- '/session/:sessionId/log/types': {
928
- GET: { command: 'getLogTypes', deprecated: true },
929
- },
930
- // #endregion
931
472
  });
932
473
  // driver command names
933
474
  exports.ALL_COMMANDS = lodash_1.default.flatMap(lodash_1.default.values(exports.METHOD_MAP).map(lodash_1.default.values))
@@ -992,5 +533,5 @@ function toCommandNameCacheKey(endpoint, method) {
992
533
  return `${endpoint}:${method ?? ''}`;
993
534
  }
994
535
  // driver commands that do not require a session to already exist
995
- exports.NO_SESSION_ID_COMMANDS = ['createSession', 'getStatus', 'getSessions', 'getAppiumSessions'];
536
+ exports.NO_SESSION_ID_COMMANDS = ['createSession', 'getStatus', 'getAppiumSessions'];
996
537
  //# sourceMappingURL=routes.js.map