@appium/types 0.9.1 → 0.10.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/LICENSE +1 -1
- package/build/lib/action.d.ts +21 -17
- package/build/lib/action.d.ts.map +1 -1
- package/build/lib/action.js +1 -1
- package/build/lib/action.js.map +1 -1
- package/build/lib/appium-config.d.ts +27 -27
- package/build/lib/appium-config.d.ts.map +1 -1
- package/build/lib/capabilities.d.ts +16 -16
- package/build/lib/capabilities.d.ts.map +1 -1
- package/build/lib/command.d.ts +98 -0
- package/build/lib/command.d.ts.map +1 -0
- package/build/lib/{logger.js → command.js} +1 -1
- package/build/lib/command.js.map +1 -0
- package/build/lib/config.d.ts +10 -10
- package/build/lib/config.d.ts.map +1 -1
- package/build/lib/constraints.d.ts +20 -20
- package/build/lib/constraints.js +1 -1
- package/build/lib/constraints.js.map +1 -1
- package/build/lib/driver.d.ts +39 -32
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/index.d.ts +12 -64
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +1 -0
- package/build/lib/index.js.map +1 -1
- package/build/lib/plugin.d.ts +5 -4
- package/build/lib/plugin.d.ts.map +1 -1
- package/build/lib/standard-caps.d.ts +3 -3
- package/build/lib/standard-caps.d.ts.map +1 -1
- package/lib/action.ts +10 -13
- package/lib/command.ts +119 -0
- package/lib/constraints.js +1 -1
- package/lib/driver.ts +33 -35
- package/lib/index.ts +3 -73
- package/lib/plugin.ts +2 -1
- package/package.json +4 -4
- package/build/lib/extension.d.ts +0 -71
- package/build/lib/extension.d.ts.map +0 -1
- package/build/lib/extension.js +0 -3
- package/build/lib/extension.js.map +0 -1
- package/build/lib/logger.d.ts +0 -39
- package/build/lib/logger.d.ts.map +0 -1
- package/build/lib/logger.js.map +0 -1
- package/build/lib/server.d.ts +0 -21
- package/build/lib/server.d.ts.map +0 -1
- package/build/lib/server.js +0 -3
- package/build/lib/server.js.map +0 -1
- package/build/lib/util.d.ts +0 -16
- package/build/lib/util.d.ts.map +0 -1
- package/build/lib/util.js +0 -3
- package/build/lib/util.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/build/lib/action.d.ts
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
3
2
|
* Portions Copyright (c) 2017 Igor Muchychka
|
|
4
3
|
* @see https://github.com/w3c-webdriver/w3c-webdriver
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* A W3C or JSONWP element.
|
|
5
8
|
*/
|
|
6
|
-
export interface Element {
|
|
7
|
-
|
|
9
|
+
export interface Element<Id extends string = string> {
|
|
10
|
+
ELEMENT?: Id;
|
|
11
|
+
'element-6066-11e4-a52e-4f735466cecf': Id;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* @group Actions
|
|
11
15
|
*/
|
|
12
|
-
export
|
|
16
|
+
export type PauseAction = {
|
|
13
17
|
type: 'pause';
|
|
14
18
|
duration: number;
|
|
15
19
|
};
|
|
16
20
|
/**
|
|
17
21
|
* @group Actions
|
|
18
22
|
*/
|
|
19
|
-
export
|
|
23
|
+
export type KeyDownAction = {
|
|
20
24
|
type: 'keyDown';
|
|
21
25
|
value: Key | string;
|
|
22
26
|
};
|
|
23
27
|
/**
|
|
24
28
|
* @group Actions
|
|
25
29
|
*/
|
|
26
|
-
export
|
|
30
|
+
export type KeyUpAction = {
|
|
27
31
|
type: 'keyUp';
|
|
28
32
|
value: Key | string;
|
|
29
33
|
};
|
|
30
34
|
/**
|
|
31
35
|
* @group Actions
|
|
32
36
|
*/
|
|
33
|
-
export
|
|
37
|
+
export type PointerMoveAction = {
|
|
34
38
|
type: 'pointerMove';
|
|
35
39
|
x: number;
|
|
36
40
|
y: number;
|
|
@@ -40,33 +44,33 @@ export declare type PointerMoveAction = {
|
|
|
40
44
|
/**
|
|
41
45
|
* @group Actions
|
|
42
46
|
*/
|
|
43
|
-
export
|
|
47
|
+
export type PointerUpAction = {
|
|
44
48
|
type: 'pointerUp';
|
|
45
49
|
button: number;
|
|
46
50
|
};
|
|
47
51
|
/**
|
|
48
52
|
* @group Actions
|
|
49
53
|
*/
|
|
50
|
-
export
|
|
54
|
+
export type PointerDownAction = {
|
|
51
55
|
type: 'pointerDown';
|
|
52
56
|
button: number;
|
|
53
57
|
};
|
|
54
58
|
/**
|
|
55
59
|
* @group Actions
|
|
56
60
|
*/
|
|
57
|
-
export
|
|
61
|
+
export type NullAction = PauseAction;
|
|
58
62
|
/**
|
|
59
63
|
* @group Actions
|
|
60
64
|
*/
|
|
61
|
-
export
|
|
65
|
+
export type KeyAction = PauseAction | KeyDownAction | KeyUpAction;
|
|
62
66
|
/**
|
|
63
67
|
* @group Actions
|
|
64
68
|
*/
|
|
65
|
-
export
|
|
69
|
+
export type PointerAction = PauseAction | PointerMoveAction | PointerUpAction | PointerDownAction;
|
|
66
70
|
/**
|
|
67
71
|
* @group Actions
|
|
68
72
|
*/
|
|
69
|
-
export
|
|
73
|
+
export type NullActionSequence = {
|
|
70
74
|
type: 'none';
|
|
71
75
|
id: string;
|
|
72
76
|
actions: NullAction[];
|
|
@@ -74,7 +78,7 @@ export declare type NullActionSequence = {
|
|
|
74
78
|
/**
|
|
75
79
|
* @group Actions
|
|
76
80
|
*/
|
|
77
|
-
export
|
|
81
|
+
export type KeyActionSequence = {
|
|
78
82
|
type: 'key';
|
|
79
83
|
id: string;
|
|
80
84
|
actions: KeyAction[];
|
|
@@ -82,13 +86,13 @@ export declare type KeyActionSequence = {
|
|
|
82
86
|
/**
|
|
83
87
|
* @group Actions
|
|
84
88
|
*/
|
|
85
|
-
export
|
|
89
|
+
export type PointerParameters = {
|
|
86
90
|
pointerType: 'mouse' | 'pen' | 'touch';
|
|
87
91
|
};
|
|
88
92
|
/**
|
|
89
93
|
* @group Actions
|
|
90
94
|
*/
|
|
91
|
-
export
|
|
95
|
+
export type PointerActionSequence = {
|
|
92
96
|
type: 'pointer';
|
|
93
97
|
id: string;
|
|
94
98
|
actions: PointerAction[];
|
|
@@ -97,7 +101,7 @@ export declare type PointerActionSequence = {
|
|
|
97
101
|
/**
|
|
98
102
|
* @group Actions
|
|
99
103
|
*/
|
|
100
|
-
export
|
|
104
|
+
export type ActionSequence = NullActionSequence | KeyActionSequence | PointerActionSequence;
|
|
101
105
|
/**
|
|
102
106
|
* @group Actions
|
|
103
107
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../lib/action.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,OAAO;
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../lib/action.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,OAAO,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM;IACjD,OAAO,CAAC,EAAE,EAAE,CAAC;IACb,qCAAqC,EAAE,EAAE,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,GAAG,GAAG,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,GAAG,GAAG,MAAM,CAA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IACpB,KAAK,WAAW;IAChB,MAAM,WAAW;IACjB,QAAQ,WAAW;IACnB,UAAU,WAAW;IACrB,KAAK,WAAW;IAChB,MAAM,WAAW;IACjB,WAAW,WAAW;IACtB,SAAS,WAAW;IACpB,YAAY,WAAW;IACvB,WAAW,WAAW;IACtB,QAAQ,WAAW;IACnB,QAAQ,WAAW;CACpB"}
|
package/build/lib/action.js
CHANGED
package/build/lib/action.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../lib/action.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../lib/action.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAoHH;;GAEG;AACH,IAAY,GAuEX;AAvED,WAAY,GAAG;IACb,sBAAe,CAAA;IACf,wBAAiB,CAAA;IACjB,sBAAe,CAAA;IACf,2BAAoB,CAAA;IACpB,qBAAc,CAAA;IACd,uBAAgB,CAAA;IAChB,wBAAiB,CAAA;IACjB,uBAAgB,CAAA;IAChB,uBAAgB,CAAA;IAChB,yBAAkB,CAAA;IAClB,qBAAc,CAAA;IACd,uBAAgB,CAAA;IAChB,wBAAiB,CAAA;IACjB,uBAAgB,CAAA;IAChB,yBAAkB,CAAA;IAClB,2BAAoB,CAAA;IACpB,qBAAc,CAAA;IACd,sBAAe,CAAA;IACf,sBAAe,CAAA;IACf,oBAAa,CAAA;IACb,uBAAgB,CAAA;IAChB,sBAAe,CAAA;IACf,wBAAiB,CAAA;IACjB,wBAAiB,CAAA;IACjB,2BAAoB,CAAA;IACpB,wBAAiB,CAAA;IACjB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,yBAAkB,CAAA;IAClB,0BAAmB,CAAA;IACnB,qBAAc,CAAA;IACd,2BAAoB,CAAA;IACpB,0BAAmB,CAAA;IACnB,yBAAkB,CAAA;IAClB,wBAAiB,CAAA;IACjB,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,qBAAc,CAAA;IACd,qBAAc,CAAA;IACd,qBAAc,CAAA;IACd,sBAAe,CAAA;IACf,gCAAyB,CAAA;IACzB,yBAAkB,CAAA;IAClB,2BAAoB,CAAA;IACpB,uBAAgB,CAAA;IAChB,wBAAiB,CAAA;IACjB,0BAAmB,CAAA;IACnB,4BAAqB,CAAA;IACrB,uBAAgB,CAAA;IAChB,wBAAiB,CAAA;IACjB,6BAAsB,CAAA;IACtB,2BAAoB,CAAA;IACpB,8BAAuB,CAAA;IACvB,6BAAsB,CAAA;IACtB,0BAAmB,CAAA;IACnB,0BAAmB,CAAA;AACrB,CAAC,EAvEW,GAAG,GAAH,WAAG,KAAH,WAAG,QAuEd"}
|
|
@@ -6,51 +6,51 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* IP address to listen on
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type AddressConfig = string;
|
|
10
10
|
/**
|
|
11
11
|
* Whether the Appium server should allow web browser connections from any host
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type AllowCorsConfig = boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Set which insecure features are allowed to run in this server's sessions. Features are defined on a driver level; see documentation for more details. Note that features defined via "deny-insecure" will be disabled, even if also listed here. If string, a path to a text file containing policy or a comma-delimited list.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type AllowInsecureConfig = string[];
|
|
18
18
|
/**
|
|
19
19
|
* Base path to use as the prefix for all webdriver routes running on the server
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type BasePathConfig = string;
|
|
22
22
|
/**
|
|
23
23
|
* Callback IP address (default: same as "address")
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export type CallbackAddressConfig = string;
|
|
26
26
|
/**
|
|
27
27
|
* Callback port (default: same as "port")
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export type CallbackPortConfig = number;
|
|
30
30
|
/**
|
|
31
31
|
* Add exaggerated spacing in logs to help with visual inspection
|
|
32
32
|
*/
|
|
33
|
-
export
|
|
33
|
+
export type DebugLogSpacingConfig = boolean;
|
|
34
34
|
/**
|
|
35
35
|
* Set which insecure features are not allowed to run in this server's sessions. Features are defined on a driver level; see documentation for more details. Features listed here will not be enabled even if also listed in "allow-insecure", and even if "relaxed-security" is enabled. If string, a path to a text file containing policy or a comma-delimited list.
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
37
|
+
export type DenyInsecureConfig = string[];
|
|
38
38
|
/**
|
|
39
39
|
* Number of seconds the Appium server should apply as both the keep-alive timeout and the connection timeout for all requests. A value of 0 disables the timeout.
|
|
40
40
|
*/
|
|
41
|
-
export
|
|
41
|
+
export type KeepAliveTimeoutConfig = number;
|
|
42
42
|
/**
|
|
43
43
|
* Use local timezone for timestamps
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type LocalTimezoneConfig = boolean;
|
|
46
46
|
/**
|
|
47
47
|
* Also send log output to this file
|
|
48
48
|
*/
|
|
49
|
-
export
|
|
49
|
+
export type LogConfig = string;
|
|
50
50
|
/**
|
|
51
51
|
* Log filtering rule
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type LogFilter = {
|
|
54
54
|
/**
|
|
55
55
|
* Replacement string for matched text
|
|
56
56
|
*/
|
|
@@ -64,63 +64,63 @@ export declare type LogFilter = {
|
|
|
64
64
|
/**
|
|
65
65
|
* One or more log filtering rules
|
|
66
66
|
*/
|
|
67
|
-
export
|
|
67
|
+
export type LogFiltersConfig = LogFilter[];
|
|
68
68
|
/**
|
|
69
69
|
* Log level (console[:file])
|
|
70
70
|
*/
|
|
71
|
-
export
|
|
71
|
+
export type LogLevelConfig = "info" | "info:debug" | "info:info" | "info:warn" | "info:error" | "warn" | "warn:debug" | "warn:info" | "warn:warn" | "warn:error" | "error" | "error:debug" | "error:info" | "error:warn" | "error:error" | "debug" | "debug:debug" | "debug:info" | "debug:warn" | "debug:error";
|
|
72
72
|
/**
|
|
73
73
|
* Do not use color in console output
|
|
74
74
|
*/
|
|
75
|
-
export
|
|
75
|
+
export type LogNoColorsConfig = boolean;
|
|
76
76
|
/**
|
|
77
77
|
* Show timestamps in console output
|
|
78
78
|
*/
|
|
79
|
-
export
|
|
79
|
+
export type LogTimestampConfig = boolean;
|
|
80
80
|
/**
|
|
81
81
|
* Add long stack traces to log entries. Recommended for debugging only.
|
|
82
82
|
*/
|
|
83
|
-
export
|
|
83
|
+
export type LongStacktraceConfig = boolean;
|
|
84
84
|
/**
|
|
85
85
|
* Do not check that needed files are readable and/or writable
|
|
86
86
|
*/
|
|
87
|
-
export
|
|
87
|
+
export type NoPermsCheckConfig = boolean;
|
|
88
88
|
/**
|
|
89
89
|
* Port to listen on
|
|
90
90
|
*/
|
|
91
|
-
export
|
|
91
|
+
export type PortConfig = number;
|
|
92
92
|
/**
|
|
93
93
|
* Disable additional security checks, so it is possible to use some advanced features, provided by drivers supporting this option. Only enable it if all the clients are in the trusted network and it's not the case if a client could potentially break out of the session sandbox. Specific features can be overridden by using "deny-insecure"
|
|
94
94
|
*/
|
|
95
|
-
export
|
|
95
|
+
export type RelaxedSecurityConfig = boolean;
|
|
96
96
|
/**
|
|
97
97
|
* Enables session override (clobbering)
|
|
98
98
|
*/
|
|
99
|
-
export
|
|
99
|
+
export type SessionOverrideConfig = boolean;
|
|
100
100
|
/**
|
|
101
101
|
* Cause sessions to fail if desired caps are sent in that Appium does not recognize as valid for the selected device
|
|
102
102
|
*/
|
|
103
|
-
export
|
|
103
|
+
export type StrictCapsConfig = boolean;
|
|
104
104
|
/**
|
|
105
105
|
* Absolute path to directory Appium can use to manage temp files. Defaults to C:\Windows\Temp on Windows and /tmp otherwise.
|
|
106
106
|
*/
|
|
107
|
-
export
|
|
107
|
+
export type TmpConfig = string;
|
|
108
108
|
/**
|
|
109
109
|
* Absolute path to directory Appium can use to save iOS instrument traces; defaults to <tmp>/appium-instruments
|
|
110
110
|
*/
|
|
111
|
-
export
|
|
111
|
+
export type TraceDirConfig = string;
|
|
112
112
|
/**
|
|
113
113
|
* A list of drivers to activate. By default, all installed drivers will be activated.
|
|
114
114
|
*/
|
|
115
|
-
export
|
|
115
|
+
export type UseDriversConfig = string[];
|
|
116
116
|
/**
|
|
117
117
|
* A list of plugins to activate. To activate all plugins, the value should be an array with a single item "all".
|
|
118
118
|
*/
|
|
119
|
-
export
|
|
119
|
+
export type UsePluginsConfig = string[];
|
|
120
120
|
/**
|
|
121
121
|
* Also send log output to this http listener
|
|
122
122
|
*/
|
|
123
|
-
export
|
|
123
|
+
export type WebhookConfig = string;
|
|
124
124
|
/**
|
|
125
125
|
* A schema for Appium configuration files
|
|
126
126
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appium-config.d.ts","sourceRoot":"","sources":["../../lib/appium-config.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"appium-config.d.ts","sourceRoot":"","sources":["../../lib/appium-config.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC;AACtC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,EAAE,CAAC;AAC3C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AACpC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CA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StringRecord, Constraint, Constraints } from '.';
|
|
3
3
|
import { BaseDriverCapConstraints } from './constraints';
|
|
4
4
|
export { StandardCapabilities };
|
|
5
|
-
export
|
|
5
|
+
export type W3C_APPIUM_PREFIX = 'appium';
|
|
6
6
|
/**
|
|
7
7
|
* Base capabilities as derived from {@linkcode BaseDriverCapConstraints}.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type BaseCapabilities = ConstraintsToCaps<BaseDriverCapConstraints>;
|
|
10
10
|
/**
|
|
11
11
|
* Like {@linkcode BaseCapabilities}, except all Appium-specific keys are namespaced.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type BaseNSCapabilities = CapsToNSCaps<ConstraintsToCaps<BaseDriverCapConstraints>>;
|
|
14
14
|
/**
|
|
15
15
|
* Given a {@linkcode Constraint} `C` and a type `T`, see if `inclusion`/`inclusionCaseInsensitive` is present, and create a union of its allowed literals; otherwise just use `T`.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
type ConstraintChoice<C extends Constraint, T> = C['inclusionCaseInsensitive'] extends ReadonlyArray<T> ? AnyCase<C['inclusionCaseInsensitive'][number]> : C['inclusion'] extends ReadonlyArray<T> ? C['inclusion'][number] : T;
|
|
18
18
|
/**
|
|
19
19
|
* Given {@linkcode Constraint} `C`, determine the associated type of the capability.
|
|
20
20
|
*
|
|
@@ -24,32 +24,32 @@ declare type ConstraintChoice<C extends Constraint, T> = C['inclusionCaseInsensi
|
|
|
24
24
|
* - If `isArray` is `true`, the type is always of type `string[]`. If this is incorrect, then it will be `any[]`.
|
|
25
25
|
* - There is no way to express the shape of an object if `ifObject` is `true`.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
type ConstraintToCapKind<C extends Constraint> = C['isString'] extends true ? ConstraintChoice<C, string> : C['isNumber'] extends true ? ConstraintChoice<C, number> : C['isBoolean'] extends true ? boolean : C['isArray'] extends true ? string[] : C['isObject'] extends true ? object : any;
|
|
28
28
|
/**
|
|
29
29
|
* Given {@linkcode Constraint} `C`, determine if it is required or optional.
|
|
30
30
|
*
|
|
31
31
|
* In practice, _all_ capabilities are considered optional per types, but various errors might be thrown if some are not present.
|
|
32
32
|
*/
|
|
33
|
-
export
|
|
33
|
+
export type ConstraintToCap<C extends Constraint> = C['presence'] extends true | {
|
|
34
34
|
allowEmpty: boolean;
|
|
35
35
|
} ? ConstraintToCapKind<C> : ConstraintToCapKind<C> | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* Given `string` `T`, this is a case-insensitive version of `T`.
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type AnyCase<T extends string> = string extends T ? string : T extends `${infer F1}${infer F2}${infer R}` ? `${Uppercase<F1> | Lowercase<F1>}${Uppercase<F2> | Lowercase<F2>}${AnyCase<R>}` : T extends `${infer F}${infer R}` ? `${Uppercase<F> | Lowercase<F>}${AnyCase<R>}` : '';
|
|
40
40
|
/**
|
|
41
41
|
* Given {@linkcode StringRecord} `T` and namespace string `NS`, a type with the key names prefixed by `${NS}:` _except_ for standard capabilities. `NS` defaults to `appium`.
|
|
42
42
|
*
|
|
43
43
|
* If `T` is already namespaced, well, it'll get _double_-namespaced.
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type CapsToNSCaps<T extends StringRecord, NS extends string = W3C_APPIUM_PREFIX> = {
|
|
46
46
|
[K in keyof T as K extends keyof StandardCapabilities ? K : NamespacedString<K & string, NS>]: T[K];
|
|
47
47
|
};
|
|
48
|
-
export
|
|
48
|
+
export type NamespacedString<S extends string, NS extends string = W3C_APPIUM_PREFIX> = `${NS}:${S}`;
|
|
49
49
|
/**
|
|
50
50
|
* Converts {@linkcode Constraint} `C` to a {@linkcode Capabilities} object.
|
|
51
51
|
*/
|
|
52
|
-
export
|
|
52
|
+
export type ConstraintsToCaps<C extends Constraints> = {
|
|
53
53
|
-readonly [K in keyof C]: ConstraintToCap<C[K]>;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
@@ -57,13 +57,13 @@ export declare type ConstraintsToCaps<C extends Constraints> = {
|
|
|
57
57
|
*
|
|
58
58
|
* Does not contain {@linkcode BaseCapabilities}; see {@linkcode DriverCaps}.
|
|
59
59
|
*/
|
|
60
|
-
export
|
|
60
|
+
export type Capabilities<C extends Constraints = BaseDriverCapConstraints, Extra extends StringRecord | void = void> = Partial<ConstraintsToCaps<C> & Extra>;
|
|
61
61
|
/**
|
|
62
62
|
* Like {@linkcode Capabilities}, except W3C-style.
|
|
63
63
|
*
|
|
64
64
|
* Does not contain {@linkcode BaseCapabilities}; see {@linkcode W3CDriverCaps}.
|
|
65
65
|
*/
|
|
66
|
-
export
|
|
66
|
+
export type W3CCapabilities<C extends Constraints = BaseDriverCapConstraints, Extra extends StringRecord | void = void> = {
|
|
67
67
|
alwaysMatch: NSCapabilities<C, Extra>;
|
|
68
68
|
firstMatch: NSCapabilities<C, Extra>[];
|
|
69
69
|
};
|
|
@@ -72,7 +72,7 @@ export declare type W3CCapabilities<C extends Constraints = BaseDriverCapConstra
|
|
|
72
72
|
*
|
|
73
73
|
* Does not contain {@linkcode BaseCapabilities}; see {@linkcode NSDriverCaps}.
|
|
74
74
|
*/
|
|
75
|
-
export
|
|
75
|
+
export type NSCapabilities<C extends Constraints = BaseDriverCapConstraints, Extra extends StringRecord | void = void, NS extends string = W3C_APPIUM_PREFIX> = Partial<CapsToNSCaps<ConstraintsToCaps<C> & Extra, NS>>;
|
|
76
76
|
/**
|
|
77
77
|
* Capabilities for drivers extending `BaseDriver`.
|
|
78
78
|
*
|
|
@@ -91,7 +91,7 @@ export declare type NSCapabilities<C extends Constraints = BaseDriverCapConstrai
|
|
|
91
91
|
* }
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
|
-
export
|
|
94
|
+
export type DriverCaps<C extends Constraints, Extra extends StringRecord | void = void> = Capabilities<BaseDriverCapConstraints & C, Extra>;
|
|
95
95
|
/**
|
|
96
96
|
* W3C-style capabilities for drivers extending `BaseDriver`.
|
|
97
97
|
*
|
|
@@ -106,11 +106,11 @@ export declare type DriverCaps<C extends Constraints, Extra extends StringRecord
|
|
|
106
106
|
* }
|
|
107
107
|
* ```
|
|
108
108
|
*/
|
|
109
|
-
export
|
|
109
|
+
export type W3CDriverCaps<C extends Constraints, Extra extends StringRecord | void = void> = W3CCapabilities<BaseDriverCapConstraints & C, Extra>;
|
|
110
110
|
/**
|
|
111
111
|
* Namespaced capabilities for drivers extending `BaseDriver`.
|
|
112
112
|
*
|
|
113
113
|
* Includes {@linkcode BaseCapabilities}.
|
|
114
114
|
*/
|
|
115
|
-
export
|
|
115
|
+
export type NSDriverCaps<C extends Constraints, Extra extends StringRecord | void = void> = NSCapabilities<BaseDriverCapConstraints & C, Extra>;
|
|
116
116
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../lib/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,GAAG,CAAC;AACxD,OAAO,EAAC,wBAAwB,EAAC,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAC,oBAAoB,EAAC,CAAC;AAE9B,
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../lib/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,GAAG,CAAC;AACxD,OAAO,EAAC,wBAAwB,EAAC,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAC,oBAAoB,EAAC,CAAC;AAE9B,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,wBAAw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,wBAAwB,EAChD,KAAK,SAAS,YAAY,GAAG,IAAI,GAAG,IAAI,IACtC;IACF,WAAW,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACtC,UAAU,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;CACxC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,CACxB,CAAC,SAAS,WAAW,GAAG,wBAAwB,EAChD,KAAK,SAAS,YAAY,GAAG,IAAI,GAAG,IAAI,EACxC,EAAE,SAAS,MAAM,GAAG,iBAAiB,IACnC,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;AAE5D;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,UAAU,CACpB,CAAC,SAAS,WAAW,EACrB,KAAK,SAAS,YAAY,GAAG,IAAI,GAAG,IAAI,IACtC,YAAY,CAAC,wBAAwB,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,CACvB,CAAC,SAAS,WAAW,EACrB,KAAK,SAAS,YAAY,GAAG,IAAI,GAAG,IAAI,IACtC,eAAe,CAAC,wBAAwB,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAEzD;;;;GAIG;AACH,MAAM,MAAM,YAAY,CACtB,CAAC,SAAS,WAAW,EACrB,KAAK,SAAS,YAAY,GAAG,IAAI,GAAG,IAAI,IACtC,cAAc,CAAC,wBAAwB,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ConditionalPick, MultidimensionalReadonlyArray } from 'type-fest';
|
|
2
|
+
import { Driver, DriverCommand } from './driver';
|
|
3
|
+
import { Plugin, PluginCommand } from './plugin';
|
|
4
|
+
/**
|
|
5
|
+
* Defines the shape of a payload for a {@linkcode MethodDef}.
|
|
6
|
+
*/
|
|
7
|
+
export interface PayloadParams {
|
|
8
|
+
wrap?: string;
|
|
9
|
+
unwrap?: string;
|
|
10
|
+
required?: ReadonlyArray<string> | MultidimensionalReadonlyArray<string, 2>;
|
|
11
|
+
optional?: ReadonlyArray<string> | MultidimensionalReadonlyArray<string, 2>;
|
|
12
|
+
validate?: (obj: any, protocol: string) => boolean | string | undefined;
|
|
13
|
+
makeArgs?: (obj: any) => any;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A mapping of URL paths to HTTP methods to either a {@linkcode DriverMethodDef} or {@linkcode PluginMethodDef}.
|
|
17
|
+
*/
|
|
18
|
+
export type MethodMap<T extends Plugin | Driver> = T extends Plugin ? Readonly<PluginMethodMap<T>> : T extends Driver ? Readonly<DriverMethodMap<T>> : never;
|
|
19
|
+
/**
|
|
20
|
+
* A {@linkcode MethodMap} for a {@linkcode Driver}.
|
|
21
|
+
*/
|
|
22
|
+
export interface DriverMethodMap<T extends Driver> {
|
|
23
|
+
[key: string]: {
|
|
24
|
+
GET?: DriverMethodDef<T>;
|
|
25
|
+
POST?: DriverMethodDef<T>;
|
|
26
|
+
DELETE?: DriverMethodDef<T>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Both {@linkcode DriverMethodDef} and {@linkcode PluginMethodDef} share these properties.
|
|
31
|
+
*/
|
|
32
|
+
export interface BaseMethodDef {
|
|
33
|
+
/**
|
|
34
|
+
* If true, this `Method` will never proxy.
|
|
35
|
+
*/
|
|
36
|
+
readonly neverProxy?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Specifies shape of payload
|
|
39
|
+
*/
|
|
40
|
+
readonly payloadParams?: PayloadParams;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A definition of an exposed API command in a {@linkcode Driver}.
|
|
44
|
+
*/
|
|
45
|
+
export interface DriverMethodDef<T extends Driver> extends BaseMethodDef {
|
|
46
|
+
/**
|
|
47
|
+
* Name of the command.
|
|
48
|
+
*/
|
|
49
|
+
readonly command?: keyof ConditionalPick<Required<T>, DriverCommand>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A definition of an exposed API command in a {@linkcode Plugin}.
|
|
53
|
+
*/
|
|
54
|
+
export interface PluginMethodDef<T extends Plugin> extends BaseMethodDef {
|
|
55
|
+
/**
|
|
56
|
+
* Name of the command.
|
|
57
|
+
*/
|
|
58
|
+
readonly command?: keyof ConditionalPick<Required<T>, DriverCommand>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A mapping of URL paths to HTTP methods to {@linkcode PluginMethodDef}.
|
|
62
|
+
*/
|
|
63
|
+
export interface PluginMethodMap<T extends Plugin> {
|
|
64
|
+
[key: string]: {
|
|
65
|
+
GET?: PluginMethodDef<T>;
|
|
66
|
+
POST?: PluginMethodDef<T>;
|
|
67
|
+
DELETE?: PluginMethodDef<T>;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface ExecuteMethodDef<Ext extends Plugin | Driver> {
|
|
71
|
+
command: keyof ConditionalPick<Required<Ext>, Ext extends Plugin ? PluginCommand : Ext extends Driver ? DriverCommand : never>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Properties shared by execute method definitions in both plugins and drivers
|
|
75
|
+
*/
|
|
76
|
+
export interface BaseExecuteMethodDef {
|
|
77
|
+
params?: {
|
|
78
|
+
required?: ReadonlyArray<string>;
|
|
79
|
+
optional?: ReadonlyArray<string>;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A definition of an execute method in a {@linkcode Driver}.
|
|
84
|
+
*/
|
|
85
|
+
export interface DriverExecuteMethodDef<T extends Driver> extends BaseExecuteMethodDef {
|
|
86
|
+
command: keyof ConditionalPick<T, DriverCommand>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A definition of an execute method in a {@linkcode Plugin}.
|
|
90
|
+
*/
|
|
91
|
+
export interface PluginExecuteMethodDef<T extends Plugin> extends BaseExecuteMethodDef {
|
|
92
|
+
command: keyof ConditionalPick<T, PluginCommand>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Definition of an execute method (which overloads the behavior of the `execute` command) in a {@linkcode Driver} or {@linkcode Plugin}.
|
|
96
|
+
*/
|
|
97
|
+
export type ExecuteMethodMap<T extends Plugin | Driver> = T extends Plugin ? Readonly<Record<string, PluginExecuteMethodDef<T>>> : T extends Driver ? Readonly<Record<string, DriverExecuteMethodDef<T>>> : never;
|
|
98
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../lib/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,6BAA6B,EAAC,MAAM,WAAW,CAAC;AACzE,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IACxE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;CAC9B;AACD;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,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,26 +3,26 @@ import { AppiumConfiguration, ServerConfig } from './appium-config';
|
|
|
3
3
|
/**
|
|
4
4
|
* The Appium configuration as it would be in a user-provided configuration file.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type AppiumConfig = Partial<AppiumConfiguration>;
|
|
7
7
|
/**
|
|
8
8
|
* Derive the "constant" type of the server properties from the schema.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
type AppiumServerJsonSchema = typeof AppiumConfigJsonSchema['properties']['server']['properties'];
|
|
11
11
|
/**
|
|
12
12
|
* This type associates the types generated from the schema ({@linkcode AppiumConfiguration})
|
|
13
13
|
* with the schema itself (beginning with the `server` prop).
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
type ServerConfigMapping = Associated<ServerConfig, AppiumServerJsonSchema>;
|
|
16
16
|
/**
|
|
17
17
|
* Camel-cased server config. _Not_ flattened.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export type NormalizedServerConfig = {
|
|
20
20
|
[Prop in keyof ServerConfigMapping as AppiumServerJsonSchema[Prop] extends WithDest ? AppiumServerJsonSchema[Prop]['appiumCliDest'] : KebabToCamel<Prop>]: ServerConfig[Prop];
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* "Normalized" config, which is camel-cased (instead of kebab-case, like the schema). It is _not_ flattened.
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export type NormalizedAppiumConfig = {
|
|
26
26
|
server: NormalizedServerConfig;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -30,29 +30,29 @@ export declare type NormalizedAppiumConfig = {
|
|
|
30
30
|
* {@linkcode WithDest}, and uses the _value_ of that property for the key name;
|
|
31
31
|
* otherwise uses the camel-cased value of the key name.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
type SetKeyForProp<Prop extends keyof ServerConfigMapping> = AppiumServerJsonSchema[Prop] extends WithDest ? AppiumServerJsonSchema[Prop]['appiumCliDest'] : KebabToCamel<Prop>;
|
|
34
34
|
/**
|
|
35
35
|
* Checks for the existence of default values, and ensures those properties will
|
|
36
36
|
* always be defined (eliminates `| undefined` from the type).
|
|
37
37
|
* If no default value, just a type.
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
type KeyOrDefaultForProp<Prop extends keyof ServerConfigMapping> = AppiumServerJsonSchema[Prop] extends WithDefault ? NonNullable<ServerConfig[Prop]> : ServerConfig[Prop];
|
|
40
40
|
/**
|
|
41
41
|
* The final shape of the parsed CLI arguments.
|
|
42
42
|
*
|
|
43
43
|
* These will be camel-cased unless overridden by `appiumCliDest` field in schema(s).
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type ServerArgs = {
|
|
46
46
|
[Prop in keyof ServerConfigMapping as SetKeyForProp<Prop>]: KeyOrDefaultForProp<Prop>;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Converts a kebab-cased string into a camel-cased string.
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
type KebabToCamel<S extends string> = S extends `${infer P1}-${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${KebabToCamel<P3>}` : Lowercase<S>;
|
|
52
52
|
/**
|
|
53
53
|
* Object `B` has all the keys as object `A` (even if those keys in `A` are otherwise optional).
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
type Associated<A extends object, B extends {
|
|
56
56
|
[key in keyof Required<A>]: unknown;
|
|
57
57
|
}> = {
|
|
58
58
|
[Prop in keyof Required<A>]: B[Prop];
|