@appium/base-driver 9.17.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 (81) hide show
  1. package/build/lib/basedriver/capabilities.d.ts.map +1 -1
  2. package/build/lib/basedriver/capabilities.js +2 -4
  3. package/build/lib/basedriver/capabilities.js.map +1 -1
  4. package/build/lib/basedriver/commands/timeout.js +7 -25
  5. package/build/lib/basedriver/commands/timeout.js.map +1 -1
  6. package/build/lib/basedriver/core.d.ts +0 -8
  7. package/build/lib/basedriver/core.d.ts.map +1 -1
  8. package/build/lib/basedriver/core.js +8 -18
  9. package/build/lib/basedriver/core.js.map +1 -1
  10. package/build/lib/basedriver/driver.js +2 -2
  11. package/build/lib/basedriver/driver.js.map +1 -1
  12. package/build/lib/basedriver/helpers.d.ts +9 -1
  13. package/build/lib/basedriver/helpers.d.ts.map +1 -1
  14. package/build/lib/basedriver/helpers.js +56 -142
  15. package/build/lib/basedriver/helpers.js.map +1 -1
  16. package/build/lib/basedriver/validation.d.ts +7 -0
  17. package/build/lib/basedriver/validation.d.ts.map +1 -0
  18. package/build/lib/basedriver/validation.js +130 -0
  19. package/build/lib/basedriver/validation.js.map +1 -0
  20. package/build/lib/express/middleware.d.ts +0 -6
  21. package/build/lib/express/middleware.d.ts.map +1 -1
  22. package/build/lib/express/middleware.js +12 -64
  23. package/build/lib/express/middleware.js.map +1 -1
  24. package/build/lib/express/server.d.ts.map +1 -1
  25. package/build/lib/express/server.js +1 -2
  26. package/build/lib/express/server.js.map +1 -1
  27. package/build/lib/helpers/capabilities.d.ts +13 -6
  28. package/build/lib/helpers/capabilities.d.ts.map +1 -1
  29. package/build/lib/helpers/capabilities.js +7 -0
  30. package/build/lib/helpers/capabilities.js.map +1 -1
  31. package/build/lib/index.d.ts +1 -0
  32. package/build/lib/index.d.ts.map +1 -1
  33. package/build/lib/index.js +3 -1
  34. package/build/lib/index.js.map +1 -1
  35. package/build/lib/jsonwp-proxy/proxy.d.ts +0 -8
  36. package/build/lib/jsonwp-proxy/proxy.d.ts.map +1 -1
  37. package/build/lib/jsonwp-proxy/proxy.js +1 -29
  38. package/build/lib/jsonwp-proxy/proxy.js.map +1 -1
  39. package/build/lib/protocol/errors.d.ts +171 -277
  40. package/build/lib/protocol/errors.d.ts.map +1 -1
  41. package/build/lib/protocol/errors.js +201 -421
  42. package/build/lib/protocol/errors.js.map +1 -1
  43. package/build/lib/protocol/helpers.d.ts +6 -6
  44. package/build/lib/protocol/helpers.d.ts.map +1 -1
  45. package/build/lib/protocol/helpers.js +11 -7
  46. package/build/lib/protocol/helpers.js.map +1 -1
  47. package/build/lib/protocol/protocol.d.ts +5 -0
  48. package/build/lib/protocol/protocol.d.ts.map +1 -1
  49. package/build/lib/protocol/protocol.js +23 -23
  50. package/build/lib/protocol/protocol.js.map +1 -1
  51. package/build/lib/protocol/routes.d.ts +6 -715
  52. package/build/lib/protocol/routes.d.ts.map +1 -1
  53. package/build/lib/protocol/routes.js +16 -481
  54. package/build/lib/protocol/routes.js.map +1 -1
  55. package/build/lib/protocol/validators.d.ts +4 -7
  56. package/build/lib/protocol/validators.d.ts.map +1 -1
  57. package/build/lib/protocol/validators.js +4 -24
  58. package/build/lib/protocol/validators.js.map +1 -1
  59. package/lib/basedriver/capabilities.ts +2 -4
  60. package/lib/basedriver/commands/timeout.ts +11 -34
  61. package/lib/basedriver/core.ts +10 -19
  62. package/lib/basedriver/driver.ts +3 -3
  63. package/lib/basedriver/helpers.js +61 -167
  64. package/lib/basedriver/validation.ts +145 -0
  65. package/lib/express/middleware.js +16 -75
  66. package/lib/express/server.js +1 -3
  67. package/lib/helpers/capabilities.js +9 -4
  68. package/lib/index.js +2 -0
  69. package/lib/jsonwp-proxy/proxy.js +2 -33
  70. package/lib/protocol/{errors.js → errors.ts} +322 -436
  71. package/lib/protocol/helpers.js +12 -8
  72. package/lib/protocol/protocol.js +25 -23
  73. package/lib/protocol/routes.js +18 -491
  74. package/lib/protocol/validators.ts +19 -0
  75. package/package.json +10 -10
  76. package/build/lib/basedriver/desired-caps.d.ts +0 -5
  77. package/build/lib/basedriver/desired-caps.d.ts.map +0 -1
  78. package/build/lib/basedriver/desired-caps.js +0 -92
  79. package/build/lib/basedriver/desired-caps.js.map +0 -1
  80. package/lib/basedriver/desired-caps.js +0 -103
  81. package/lib/protocol/validators.js +0 -41
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../lib/protocol/routes.js"],"names":[],"mappings":"AAw7BA;;;;;;GAMG;AACH,6CALW,MAAM,WACN,OAAO,eAAe,EAAE,UAAU,aAClC,MAAM,GACJ,MAAM,GAAC,SAAS,CA8C5B;AAp9BD;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAo5BG;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': {
@@ -361,7 +315,7 @@ exports.METHOD_MAP = ({
361
315
  GET: { command: 'getAppiumSessionCapabilities' }
362
316
  },
363
317
  '/session/:sessionId/appium/device/system_time': {
364
- GET: { command: 'getDeviceTime', payloadParams: { optional: ['format'] } },
318
+ GET: { command: 'getDeviceTime' },
365
319
  POST: { command: 'getDeviceTime', payloadParams: { optional: ['format'] } },
366
320
  },
367
321
  // #region Applications Management
@@ -410,18 +364,11 @@ exports.METHOD_MAP = ({
410
364
  },
411
365
  },
412
366
  '/session/:sessionId/appium/device/app_state': {
413
- GET: {
414
- command: 'queryAppState',
415
- payloadParams: {
416
- required: [['appId'], ['bundleId']],
417
- },
418
- },
419
367
  POST: {
420
368
  command: 'queryAppState',
421
369
  payloadParams: {
422
370
  required: [['appId'], ['bundleId']],
423
371
  },
424
- deprecated: true,
425
372
  },
426
373
  },
427
374
  // #endregion
@@ -522,418 +469,6 @@ exports.METHOD_MAP = ({
522
469
  },
523
470
  },
524
471
  // #endregion
525
- //
526
- // Endpoints deprecated entirely
527
- //
528
- // #region MJSONWP
529
- '/sessions': {
530
- GET: { command: 'getSessions', deprecated: true },
531
- },
532
- '/session/:sessionId/timeouts/async_script': {
533
- POST: { command: 'asyncScriptTimeout', payloadParams: { required: ['ms'] }, deprecated: true },
534
- },
535
- '/session/:sessionId/timeouts/implicit_wait': {
536
- POST: { command: 'implicitWait', payloadParams: { required: ['ms'] }, deprecated: true },
537
- },
538
- '/session/:sessionId/window_handle': {
539
- GET: { command: 'getWindowHandle', deprecated: true },
540
- },
541
- // Only 'window/handles' exists in W3C WebDriver spec.
542
- '/session/:sessionId/window/handle': {
543
- GET: { command: 'getWindowHandle', deprecated: true },
544
- },
545
- '/session/:sessionId/window_handles': {
546
- GET: { command: 'getWindowHandles', deprecated: true },
547
- },
548
- '/session/:sessionId/execute': {
549
- POST: {
550
- command: 'execute',
551
- payloadParams: { required: ['script', 'args'] },
552
- deprecated: true
553
- },
554
- },
555
- '/session/:sessionId/execute_async': {
556
- POST: {
557
- command: 'executeAsync',
558
- payloadParams: { required: ['script', 'args'] },
559
- deprecated: true
560
- },
561
- },
562
- '/session/:sessionId/window/:windowhandle/size': {
563
- GET: { command: 'getWindowSize', deprecated: true },
564
- },
565
- '/session/:sessionId/window/:windowhandle/position': {
566
- POST: { deprecated: true },
567
- GET: { deprecated: true },
568
- },
569
- '/session/:sessionId/window/:windowhandle/maximize': {
570
- POST: { command: 'maximizeWindow', deprecated: true },
571
- },
572
- '/session/:sessionId/element/:elementId/submit': {
573
- POST: { command: 'submit', deprecated: true },
574
- },
575
- '/session/:sessionId/keys': {
576
- POST: { command: 'keys', payloadParams: { required: ['value'] }, deprecated: true },
577
- },
578
- '/session/:sessionId/element/:elementId/equals/:otherId': {
579
- GET: { command: 'equalsElement', deprecated: true },
580
- },
581
- '/session/:sessionId/element/:elementId/location': {
582
- GET: { command: 'getLocation', deprecated: true },
583
- },
584
- '/session/:sessionId/element/:elementId/location_in_view': {
585
- GET: { command: 'getLocationInView', deprecated: true },
586
- },
587
- '/session/:sessionId/element/:elementId/size': {
588
- GET: { command: 'getSize', deprecated: true },
589
- },
590
- '/session/:sessionId/moveto': {
591
- POST: {
592
- command: 'moveTo',
593
- payloadParams: { optional: ['element', 'xoffset', 'yoffset'] },
594
- deprecated: true,
595
- },
596
- },
597
- '/session/:sessionId/click': {
598
- POST: { command: 'clickCurrent', payloadParams: { optional: ['button'] }, deprecated: true },
599
- },
600
- '/session/:sessionId/buttondown': {
601
- POST: { command: 'buttonDown', payloadParams: { optional: ['button'] }, deprecated: true },
602
- },
603
- '/session/:sessionId/buttonup': {
604
- POST: { command: 'buttonUp', payloadParams: { optional: ['button'] }, deprecated: true },
605
- },
606
- '/session/:sessionId/doubleclick': {
607
- POST: { command: 'doubleClick', deprecated: true },
608
- },
609
- '/session/:sessionId/touch/click': {
610
- POST: { command: 'click', payloadParams: { required: ['element'] }, deprecated: true },
611
- },
612
- '/session/:sessionId/touch/down': {
613
- POST: { command: 'touchDown', payloadParams: { required: ['x', 'y'] }, deprecated: true },
614
- },
615
- '/session/:sessionId/touch/up': {
616
- POST: { command: 'touchUp', payloadParams: { required: ['x', 'y'] }, deprecated: true },
617
- },
618
- '/session/:sessionId/touch/move': {
619
- POST: { command: 'touchMove', payloadParams: { required: ['x', 'y'] }, deprecated: true },
620
- },
621
- '/session/:sessionId/touch/scroll': {
622
- POST: { deprecated: true },
623
- },
624
- '/session/:sessionId/touch/doubleclick': {
625
- POST: { deprecated: true },
626
- },
627
- '/session/:sessionId/touch/longclick': {
628
- POST: {
629
- command: 'touchLongClick',
630
- payloadParams: { required: ['elements'] },
631
- deprecated: true,
632
- },
633
- },
634
- '/session/:sessionId/touch/flick': {
635
- POST: {
636
- command: 'flick',
637
- payloadParams: {
638
- optional: ['element', 'xspeed', 'yspeed', 'xoffset', 'yoffset', 'speed'],
639
- },
640
- deprecated: true,
641
- },
642
- },
643
- '/session/:sessionId/local_storage': {
644
- GET: { deprecated: true },
645
- POST: { deprecated: true },
646
- DELETE: { deprecated: true },
647
- },
648
- '/session/:sessionId/local_storage/key/:key': {
649
- GET: { deprecated: true },
650
- DELETE: { deprecated: true },
651
- },
652
- '/session/:sessionId/local_storage/size': {
653
- GET: { deprecated: true },
654
- },
655
- '/session/:sessionId/session_storage': {
656
- GET: { deprecated: true },
657
- POST: { deprecated: true },
658
- DELETE: { deprecated: true },
659
- },
660
- '/session/:sessionId/session_storage/key/:key': {
661
- GET: { deprecated: true },
662
- DELETE: { deprecated: true },
663
- },
664
- '/session/:sessionId/session_storage/size': {
665
- GET: { deprecated: true },
666
- },
667
- '/session/:sessionId/application_cache/status': {
668
- GET: { deprecated: true },
669
- },
670
- '/session/:sessionId/alert_text': {
671
- GET: { command: 'getAlertText', deprecated: true },
672
- POST: {
673
- command: 'setAlertText',
674
- payloadParams: SET_ALERT_TEXT_PAYLOAD_PARAMS,
675
- deprecated: true
676
- },
677
- },
678
- '/session/:sessionId/accept_alert': {
679
- POST: { command: 'postAcceptAlert', deprecated: true },
680
- },
681
- '/session/:sessionId/dismiss_alert': {
682
- POST: { command: 'postDismissAlert', deprecated: true },
683
- },
684
- // Pre-W3C endpoint for element screenshot
685
- '/session/:sessionId/screenshot/:elementId': {
686
- GET: { command: 'getElementScreenshot', deprecated: true },
687
- },
688
- // #endregion
689
- // #region Appium specific
690
- '/session/:sessionId/element/:elementId/pageIndex': {
691
- GET: { command: 'getPageIndex', deprecated: true },
692
- },
693
- '/session/:sessionId/touch/perform': {
694
- POST: {
695
- command: 'performTouch',
696
- payloadParams: { wrap: 'actions', required: ['actions'] },
697
- deprecated: true,
698
- },
699
- },
700
- '/session/:sessionId/touch/multi/perform': {
701
- POST: {
702
- command: 'performMultiAction',
703
- payloadParams: { required: ['actions'], optional: ['elementId'] },
704
- deprecated: true,
705
- },
706
- },
707
- '/session/:sessionId/appium/device/shake': {
708
- POST: { command: 'mobileShake', deprecated: true },
709
- },
710
- '/session/:sessionId/appium/device/lock': {
711
- POST: { command: 'lock', payloadParams: { optional: ['seconds'] }, deprecated: true },
712
- },
713
- '/session/:sessionId/appium/device/unlock': {
714
- POST: { command: 'unlock', deprecated: true },
715
- },
716
- '/session/:sessionId/appium/device/is_locked': {
717
- POST: { command: 'isLocked', deprecated: true },
718
- },
719
- '/session/:sessionId/appium/start_recording_screen': {
720
- POST: {
721
- command: 'startRecordingScreen',
722
- payloadParams: { optional: ['options'] },
723
- deprecated: true,
724
- },
725
- },
726
- '/session/:sessionId/appium/stop_recording_screen': {
727
- POST: {
728
- command: 'stopRecordingScreen',
729
- payloadParams: { optional: ['options'] },
730
- deprecated: true,
731
- },
732
- },
733
- '/session/:sessionId/appium/performanceData/types': {
734
- POST: { command: 'getPerformanceDataTypes', deprecated: true },
735
- },
736
- '/session/:sessionId/appium/getPerformanceData': {
737
- POST: {
738
- command: 'getPerformanceData',
739
- payloadParams: {
740
- required: ['packageName', 'dataType'],
741
- optional: ['dataReadTimeout'],
742
- },
743
- deprecated: true,
744
- },
745
- },
746
- '/session/:sessionId/appium/device/press_keycode': {
747
- POST: {
748
- command: 'pressKeyCode',
749
- payloadParams: { required: ['keycode'], optional: ['metastate', 'flags'] },
750
- deprecated: true,
751
- },
752
- },
753
- '/session/:sessionId/appium/device/long_press_keycode': {
754
- POST: {
755
- command: 'longPressKeyCode',
756
- payloadParams: { required: ['keycode'], optional: ['metastate', 'flags'] },
757
- deprecated: true,
758
- },
759
- },
760
- '/session/:sessionId/appium/device/finger_print': {
761
- POST: {
762
- command: 'fingerprint',
763
- payloadParams: { required: ['fingerprintId'] },
764
- deprecated: true,
765
- },
766
- },
767
- '/session/:sessionId/appium/device/send_sms': {
768
- POST: {
769
- command: 'sendSMS',
770
- payloadParams: { required: ['phoneNumber', 'message'] },
771
- deprecated: true,
772
- },
773
- },
774
- '/session/:sessionId/appium/device/gsm_call': {
775
- POST: {
776
- command: 'gsmCall',
777
- payloadParams: { required: ['phoneNumber', 'action'] },
778
- deprecated: true,
779
- },
780
- },
781
- '/session/:sessionId/appium/device/gsm_signal': {
782
- POST: {
783
- command: 'gsmSignal',
784
- payloadParams: { required: ['signalStrength'] },
785
- deprecated: true,
786
- },
787
- },
788
- '/session/:sessionId/appium/device/gsm_voice': {
789
- POST: { command: 'gsmVoice', payloadParams: { required: ['state'] }, deprecated: true },
790
- },
791
- '/session/:sessionId/appium/device/power_capacity': {
792
- POST: { command: 'powerCapacity', payloadParams: { required: ['percent'] }, deprecated: true },
793
- },
794
- '/session/:sessionId/appium/device/power_ac': {
795
- POST: { command: 'powerAC', payloadParams: { required: ['state'] }, deprecated: true },
796
- },
797
- '/session/:sessionId/appium/device/network_speed': {
798
- POST: { command: 'networkSpeed', payloadParams: { required: ['netspeed'] }, deprecated: true },
799
- },
800
- '/session/:sessionId/appium/device/keyevent': {
801
- POST: {
802
- command: 'keyevent',
803
- payloadParams: { required: ['keycode'], optional: ['metastate'] },
804
- deprecated: true,
805
- },
806
- },
807
- '/session/:sessionId/appium/device/current_activity': {
808
- GET: { command: 'getCurrentActivity', deprecated: true },
809
- },
810
- '/session/:sessionId/appium/device/current_package': {
811
- GET: { command: 'getCurrentPackage', deprecated: true },
812
- },
813
- '/session/:sessionId/appium/device/toggle_airplane_mode': {
814
- POST: { command: 'toggleFlightMode', deprecated: true },
815
- },
816
- '/session/:sessionId/appium/device/toggle_data': {
817
- POST: { command: 'toggleData', deprecated: true },
818
- },
819
- '/session/:sessionId/appium/device/toggle_wifi': {
820
- POST: { command: 'toggleWiFi', deprecated: true },
821
- },
822
- '/session/:sessionId/appium/device/toggle_location_services': {
823
- POST: { command: 'toggleLocationServices', deprecated: true },
824
- },
825
- '/session/:sessionId/appium/device/open_notifications': {
826
- POST: { command: 'openNotifications', deprecated: true },
827
- },
828
- '/session/:sessionId/appium/device/start_activity': {
829
- POST: {
830
- command: 'startActivity',
831
- payloadParams: {
832
- required: ['appPackage', 'appActivity'],
833
- optional: [
834
- 'appWaitPackage',
835
- 'appWaitActivity',
836
- 'intentAction',
837
- 'intentCategory',
838
- 'intentFlags',
839
- 'optionalIntentArguments',
840
- 'dontStopAppOnReset',
841
- ],
842
- },
843
- deprecated: true,
844
- },
845
- },
846
- '/session/:sessionId/appium/device/system_bars': {
847
- GET: { command: 'getSystemBars', deprecated: true },
848
- },
849
- '/session/:sessionId/appium/device/display_density': {
850
- GET: { command: 'getDisplayDensity', deprecated: true },
851
- },
852
- '/session/:sessionId/appium/simulator/touch_id': {
853
- POST: { command: 'touchId', payloadParams: { required: ['match'] }, deprecated: true },
854
- },
855
- '/session/:sessionId/appium/simulator/toggle_touch_id_enrollment': {
856
- POST: {
857
- command: 'toggleEnrollTouchId',
858
- payloadParams: { optional: ['enabled'] },
859
- deprecated: true,
860
- },
861
- },
862
- '/session/:sessionId/appium/app/launch': {
863
- POST: { command: 'launchApp', deprecated: true },
864
- },
865
- '/session/:sessionId/appium/app/close': {
866
- POST: { command: 'closeApp', deprecated: true },
867
- },
868
- '/session/:sessionId/appium/app/reset': {
869
- POST: { command: 'reset', deprecated: true },
870
- },
871
- '/session/:sessionId/appium/app/background': {
872
- POST: { command: 'background', payloadParams: { required: ['seconds'] }, deprecated: true },
873
- },
874
- '/session/:sessionId/appium/app/end_test_coverage': {
875
- POST: {
876
- command: 'endCoverage',
877
- payloadParams: { required: ['intent', 'path'] },
878
- deprecated: true,
879
- },
880
- },
881
- '/session/:sessionId/appium/app/strings': {
882
- POST: {
883
- command: 'getStrings',
884
- payloadParams: { optional: ['language', 'stringFile'] },
885
- deprecated: true,
886
- },
887
- },
888
- '/session/:sessionId/appium/element/:elementId/value': {
889
- POST: {
890
- command: 'setValueImmediate',
891
- payloadParams: { required: ['text'] },
892
- deprecated: true,
893
- },
894
- },
895
- '/session/:sessionId/appium/element/:elementId/replace_value': {
896
- POST: {
897
- command: 'replaceValue',
898
- payloadParams: { required: ['text'] },
899
- deprecated: true,
900
- },
901
- },
902
- '/session/:sessionId/appium/receive_async_response': {
903
- POST: {
904
- command: 'receiveAsyncResponse',
905
- payloadParams: { required: ['response'] },
906
- deprecated: true,
907
- },
908
- },
909
- '/session/:sessionId/appium/device/set_clipboard': {
910
- POST: {
911
- command: 'setClipboard',
912
- payloadParams: {
913
- required: ['content'],
914
- optional: ['contentType', 'label'],
915
- },
916
- deprecated: true,
917
- },
918
- },
919
- '/session/:sessionId/appium/device/get_clipboard': {
920
- POST: {
921
- command: 'getClipboard',
922
- payloadParams: {
923
- optional: ['contentType'],
924
- },
925
- deprecated: true,
926
- },
927
- },
928
- // #endregion
929
- // #region JSONWP
930
- '/session/:sessionId/log': {
931
- POST: { command: 'getLog', payloadParams: { required: ['type'] }, deprecated: true },
932
- },
933
- '/session/:sessionId/log/types': {
934
- GET: { command: 'getLogTypes', deprecated: true },
935
- },
936
- // #endregion
937
472
  });
938
473
  // driver command names
939
474
  exports.ALL_COMMANDS = lodash_1.default.flatMap(lodash_1.default.values(exports.METHOD_MAP).map(lodash_1.default.values))
@@ -998,5 +533,5 @@ function toCommandNameCacheKey(endpoint, method) {
998
533
  return `${endpoint}:${method ?? ''}`;
999
534
  }
1000
535
  // driver commands that do not require a session to already exist
1001
- exports.NO_SESSION_ID_COMMANDS = ['createSession', 'getStatus', 'getSessions', 'getAppiumSessions'];
536
+ exports.NO_SESSION_ID_COMMANDS = ['createSession', 'getStatus', 'getAppiumSessions'];
1002
537
  //# sourceMappingURL=routes.js.map