@appium/base-driver 8.7.3 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/build/lib/basedriver/capabilities.d.ts +11 -163
  2. package/build/lib/basedriver/capabilities.d.ts.map +1 -1
  3. package/build/lib/basedriver/capabilities.js +355 -236
  4. package/build/lib/basedriver/capabilities.js.map +1 -1
  5. package/build/lib/basedriver/commands/event.d.ts +7 -6
  6. package/build/lib/basedriver/commands/event.d.ts.map +1 -1
  7. package/build/lib/basedriver/commands/event.js +55 -35
  8. package/build/lib/basedriver/commands/event.js.map +1 -1
  9. package/build/lib/basedriver/commands/execute.d.ts +7 -6
  10. package/build/lib/basedriver/commands/execute.d.ts.map +1 -1
  11. package/build/lib/basedriver/commands/execute.js +66 -58
  12. package/build/lib/basedriver/commands/execute.js.map +1 -1
  13. package/build/lib/basedriver/commands/find.d.ts +9 -7
  14. package/build/lib/basedriver/commands/find.d.ts.map +1 -1
  15. package/build/lib/basedriver/commands/find.js +102 -54
  16. package/build/lib/basedriver/commands/find.js.map +1 -1
  17. package/build/lib/basedriver/commands/index.d.ts +3 -7
  18. package/build/lib/basedriver/commands/index.d.ts.map +1 -1
  19. package/build/lib/basedriver/commands/index.js +30 -33
  20. package/build/lib/basedriver/commands/index.js.map +1 -1
  21. package/build/lib/basedriver/commands/log.d.ts +8 -9
  22. package/build/lib/basedriver/commands/log.d.ts.map +1 -1
  23. package/build/lib/basedriver/commands/log.js +54 -38
  24. package/build/lib/basedriver/commands/log.js.map +1 -1
  25. package/build/lib/basedriver/commands/session.d.ts +7 -6
  26. package/build/lib/basedriver/commands/session.d.ts.map +1 -1
  27. package/build/lib/basedriver/commands/session.js +46 -39
  28. package/build/lib/basedriver/commands/session.js.map +1 -1
  29. package/build/lib/basedriver/commands/settings.d.ts +7 -7
  30. package/build/lib/basedriver/commands/settings.d.ts.map +1 -1
  31. package/build/lib/basedriver/commands/settings.js +35 -28
  32. package/build/lib/basedriver/commands/settings.js.map +1 -1
  33. package/build/lib/basedriver/commands/timeout.d.ts +7 -5
  34. package/build/lib/basedriver/commands/timeout.d.ts.map +1 -1
  35. package/build/lib/basedriver/commands/timeout.js +144 -162
  36. package/build/lib/basedriver/commands/timeout.js.map +1 -1
  37. package/build/lib/basedriver/core.d.ts +6 -157
  38. package/build/lib/basedriver/core.d.ts.map +1 -1
  39. package/build/lib/basedriver/core.js +361 -230
  40. package/build/lib/basedriver/core.js.map +1 -1
  41. package/build/lib/basedriver/desired-caps.js +80 -110
  42. package/build/lib/basedriver/desired-caps.js.map +1 -1
  43. package/build/lib/basedriver/device-settings.js +57 -62
  44. package/build/lib/basedriver/device-settings.js.map +1 -1
  45. package/build/lib/basedriver/driver.d.ts +11 -262
  46. package/build/lib/basedriver/driver.d.ts.map +1 -1
  47. package/build/lib/basedriver/driver.js +362 -262
  48. package/build/lib/basedriver/driver.js.map +1 -1
  49. package/build/lib/basedriver/helpers.js +500 -495
  50. package/build/lib/basedriver/helpers.js.map +1 -1
  51. package/build/lib/basedriver/logger.d.ts +1 -1
  52. package/build/lib/basedriver/logger.d.ts.map +1 -1
  53. package/build/lib/basedriver/logger.js +5 -15
  54. package/build/lib/basedriver/logger.js.map +1 -1
  55. package/build/lib/constants.js +14 -14
  56. package/build/lib/constants.js.map +1 -1
  57. package/build/lib/express/crash.js +8 -15
  58. package/build/lib/express/crash.js.map +1 -1
  59. package/build/lib/express/express-logging.js +49 -59
  60. package/build/lib/express/express-logging.js.map +1 -1
  61. package/build/lib/express/idempotency.js +125 -177
  62. package/build/lib/express/idempotency.js.map +1 -1
  63. package/build/lib/express/logger.d.ts +1 -1
  64. package/build/lib/express/logger.d.ts.map +1 -1
  65. package/build/lib/express/logger.js +5 -15
  66. package/build/lib/express/logger.js.map +1 -1
  67. package/build/lib/express/middleware.js +82 -107
  68. package/build/lib/express/middleware.js.map +1 -1
  69. package/build/lib/express/server.d.ts +17 -5
  70. package/build/lib/express/server.d.ts.map +1 -1
  71. package/build/lib/express/server.js +259 -224
  72. package/build/lib/express/server.js.map +1 -1
  73. package/build/lib/express/static.js +64 -81
  74. package/build/lib/express/static.js.map +1 -1
  75. package/build/lib/express/websocket.js +115 -87
  76. package/build/lib/express/websocket.js.map +1 -1
  77. package/build/lib/helpers/capabilities.d.ts +1 -59
  78. package/build/lib/helpers/capabilities.d.ts.map +1 -1
  79. package/build/lib/helpers/capabilities.js +72 -69
  80. package/build/lib/helpers/capabilities.js.map +1 -1
  81. package/build/lib/index.js +64 -180
  82. package/build/lib/index.js.map +1 -1
  83. package/build/lib/jsonwp-proxy/protocol-converter.js +215 -227
  84. package/build/lib/jsonwp-proxy/protocol-converter.js.map +1 -1
  85. package/build/lib/jsonwp-proxy/proxy.d.ts.map +1 -1
  86. package/build/lib/jsonwp-proxy/proxy.js +355 -393
  87. package/build/lib/jsonwp-proxy/proxy.js.map +1 -1
  88. package/build/lib/jsonwp-status/status.js +119 -130
  89. package/build/lib/jsonwp-status/status.js.map +1 -1
  90. package/build/lib/protocol/errors.d.ts +135 -32
  91. package/build/lib/protocol/errors.d.ts.map +1 -1
  92. package/build/lib/protocol/errors.js +871 -919
  93. package/build/lib/protocol/errors.js.map +1 -1
  94. package/build/lib/protocol/helpers.js +37 -37
  95. package/build/lib/protocol/helpers.js.map +1 -1
  96. package/build/lib/protocol/index.js +22 -109
  97. package/build/lib/protocol/index.js.map +1 -1
  98. package/build/lib/protocol/protocol.js +394 -350
  99. package/build/lib/protocol/protocol.js.map +1 -1
  100. package/build/lib/protocol/routes.d.ts +1248 -4
  101. package/build/lib/protocol/routes.d.ts.map +1 -1
  102. package/build/lib/protocol/routes.js +972 -1327
  103. package/build/lib/protocol/routes.js.map +1 -1
  104. package/build/lib/protocol/validators.js +32 -39
  105. package/build/lib/protocol/validators.js.map +1 -1
  106. package/build/tsconfig.tsbuildinfo +1 -1
  107. package/lib/basedriver/capabilities.js +83 -39
  108. package/lib/basedriver/commands/event.js +10 -5
  109. package/lib/basedriver/commands/execute.js +14 -9
  110. package/lib/basedriver/commands/find.js +18 -12
  111. package/lib/basedriver/commands/index.js +21 -16
  112. package/lib/basedriver/commands/log.js +24 -18
  113. package/lib/basedriver/commands/session.js +10 -5
  114. package/lib/basedriver/commands/settings.js +9 -6
  115. package/lib/basedriver/commands/timeout.js +10 -4
  116. package/lib/basedriver/core.js +2 -3
  117. package/lib/basedriver/driver.js +12 -16
  118. package/lib/express/server.js +6 -3
  119. package/lib/protocol/errors.js +155 -44
  120. package/lib/protocol/routes.js +19 -7
  121. package/package.json +16 -18
@@ -13,159 +13,11 @@ export type ValidateCapsOpts = {
13
13
  */
14
14
  skipPresenceConstraint?: boolean | undefined;
15
15
  };
16
- export type NSCapabilities<C extends Readonly<Record<string, import("@appium/types").Constraint>> = {
17
- readonly platformName: {
18
- readonly presence: true;
19
- readonly isString: true;
20
- };
21
- readonly app: {
22
- readonly isString: true;
23
- };
24
- readonly deviceName: {
25
- readonly isString: true;
26
- };
27
- readonly platformVersion: {
28
- readonly isString: true;
29
- };
30
- readonly newCommandTimeout: {
31
- readonly isNumber: true;
32
- };
33
- readonly automationName: {
34
- readonly isString: true;
35
- };
36
- readonly autoLaunch: {
37
- readonly isBoolean: true;
38
- };
39
- readonly udid: {
40
- readonly isString: true;
41
- };
42
- readonly orientation: {
43
- readonly inclusion: readonly ["LANDSCAPE", "PORTRAIT"];
44
- };
45
- readonly autoWebview: {
46
- readonly isBoolean: true;
47
- };
48
- readonly noReset: {
49
- readonly isBoolean: true;
50
- };
51
- readonly fullReset: {
52
- readonly isBoolean: true;
53
- };
54
- readonly language: {
55
- readonly isString: true;
56
- };
57
- readonly locale: {
58
- readonly isString: true;
59
- };
60
- readonly eventTimings: {
61
- readonly isBoolean: true;
62
- };
63
- readonly printPageSourceOnFindFailure: {
64
- readonly isBoolean: true;
65
- };
66
- }, Extra extends void | import("@appium/types").StringRecord = void> = import('@appium/types').NSCapabilities<C, Extra>;
67
- export type Capabilities<C extends Readonly<Record<string, import("@appium/types").Constraint>> = {
68
- readonly platformName: {
69
- readonly presence: true;
70
- readonly isString: true;
71
- };
72
- readonly app: {
73
- readonly isString: true;
74
- };
75
- readonly deviceName: {
76
- readonly isString: true;
77
- };
78
- readonly platformVersion: {
79
- readonly isString: true;
80
- };
81
- readonly newCommandTimeout: {
82
- readonly isNumber: true;
83
- };
84
- readonly automationName: {
85
- readonly isString: true;
86
- };
87
- readonly autoLaunch: {
88
- readonly isBoolean: true;
89
- };
90
- readonly udid: {
91
- readonly isString: true;
92
- };
93
- readonly orientation: {
94
- readonly inclusion: readonly ["LANDSCAPE", "PORTRAIT"];
95
- };
96
- readonly autoWebview: {
97
- readonly isBoolean: true;
98
- };
99
- readonly noReset: {
100
- readonly isBoolean: true;
101
- };
102
- readonly fullReset: {
103
- readonly isBoolean: true;
104
- };
105
- readonly language: {
106
- readonly isString: true;
107
- };
108
- readonly locale: {
109
- readonly isString: true;
110
- };
111
- readonly eventTimings: {
112
- readonly isBoolean: true;
113
- };
114
- readonly printPageSourceOnFindFailure: {
115
- readonly isBoolean: true;
116
- };
117
- }, Extra extends void | import("@appium/types").StringRecord = void> = import('@appium/types').Capabilities<C, Extra>;
118
- export type W3CCapabilities<C extends Readonly<Record<string, import("@appium/types").Constraint>> = {
119
- readonly platformName: {
120
- readonly presence: true;
121
- readonly isString: true;
122
- };
123
- readonly app: {
124
- readonly isString: true;
125
- };
126
- readonly deviceName: {
127
- readonly isString: true;
128
- };
129
- readonly platformVersion: {
130
- readonly isString: true;
131
- };
132
- readonly newCommandTimeout: {
133
- readonly isNumber: true;
134
- };
135
- readonly automationName: {
136
- readonly isString: true;
137
- };
138
- readonly autoLaunch: {
139
- readonly isBoolean: true;
140
- };
141
- readonly udid: {
142
- readonly isString: true;
143
- };
144
- readonly orientation: {
145
- readonly inclusion: readonly ["LANDSCAPE", "PORTRAIT"];
146
- };
147
- readonly autoWebview: {
148
- readonly isBoolean: true;
149
- };
150
- readonly noReset: {
151
- readonly isBoolean: true;
152
- };
153
- readonly fullReset: {
154
- readonly isBoolean: true;
155
- };
156
- readonly language: {
157
- readonly isString: true;
158
- };
159
- readonly locale: {
160
- readonly isString: true;
161
- };
162
- readonly eventTimings: {
163
- readonly isBoolean: true;
164
- };
165
- readonly printPageSourceOnFindFailure: {
166
- readonly isBoolean: true;
167
- };
168
- }, Extra extends void | import("@appium/types").StringRecord = void> = import('@appium/types').W3CCapabilities<C, Extra>;
16
+ export type NSCapabilities<C extends Readonly<Record<string, import("@appium/types").Constraint>> = typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS, Extra extends void | import("@appium/types").StringRecord = void> = import('@appium/types').NSCapabilities<C, Extra>;
17
+ export type Capabilities<C extends Readonly<Record<string, import("@appium/types").Constraint>> = typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS, Extra extends void | import("@appium/types").StringRecord = void> = import('@appium/types').Capabilities<C, Extra>;
18
+ export type W3CCapabilities<C extends Readonly<Record<string, import("@appium/types").Constraint>> = typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS, Extra extends void | import("@appium/types").StringRecord = void> = import('@appium/types').W3CCapabilities<C, Extra>;
19
+ export type Merge<T, U> = import('type-fest').Merge<T, U>;
20
+ export type StringKeyOf<T> = import('type-fest').StringKeyOf<T>;
169
21
  /**
170
22
  * Parse capabilities
171
23
  * @template {Constraints} [C={}]
@@ -203,12 +55,11 @@ export function validateCaps<C extends Readonly<Record<string, import("@appium/t
203
55
  * @template {Constraints} [U={}]
204
56
  * @param {Capabilities<T>} [primary]
205
57
  * @param {Capabilities<U>} [secondary]
206
- * @returns {import('type-fest').Merge<Capabilities<T>, Capabilities<U>>}
58
+ * @returns {Merge<Capabilities<T>, Capabilities<U>>}
207
59
  * @see https://www.w3.org/TR/webdriver/#dfn-merging-capabilities)
208
60
  */
209
61
  export function mergeCaps<T extends Readonly<Record<string, import("@appium/types").Constraint>> = {}, U extends Readonly<Record<string, import("@appium/types").Constraint>> = {}>(primary?: Partial<import("@appium/types").ConstraintsToCaps<T> & void> | undefined, secondary?: Partial<import("@appium/types").ConstraintsToCaps<U> & void> | undefined): import("type-fest").Simplify<(import("type-fest/source/merge").SimpleMerge<import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>> & import("type-fest/source/merge").SimpleMerge<import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>> extends infer T_1 ? { [Key in keyof T_1 as import("type-fest/source/enforce-optional").RequiredFilter<import("type-fest/source/merge").SimpleMerge<import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>> & import("type-fest/source/merge").SimpleMerge<import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>>, Key>]: (import("type-fest/source/merge").SimpleMerge<import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>> & import("type-fest/source/merge").SimpleMerge<import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>>)[Key]; } : never) & (import("type-fest/source/merge").SimpleMerge<import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>> & import("type-fest/source/merge").SimpleMerge<import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>> extends infer T_2 ? { [Key_1 in keyof T_2 as import("type-fest/source/enforce-optional").OptionalFilter<import("type-fest/source/merge").SimpleMerge<import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>> & import("type-fest/source/merge").SimpleMerge<import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>>, Key_1>]?: Exclude<(import("type-fest/source/merge").SimpleMerge<import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").PickIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>> & import("type-fest/source/merge").SimpleMerge<import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<T> & void>>, import("type-fest").OmitIndexSignature<Partial<import("@appium/types").ConstraintsToCaps<U> & void>>>)[Key_1], undefined> | undefined; } : never)>;
210
62
  export const APPIUM_VENDOR_PREFIX: "appium:";
211
- export const APPIUM_OPTS_CAP: "options";
212
63
  /**
213
64
  * Get an array of all the unprefixed caps that are being used in 'alwaysMatch' and all of the 'firstMatch' object
214
65
  * @template {Constraints} [C={}]
@@ -231,15 +82,12 @@ export function isStandardCap(cap: string): boolean;
231
82
  export function stripAppiumPrefixes<C extends Readonly<Record<string, import("@appium/types").Constraint>> = {}>(caps: Partial<import("@appium/types").CapsToNSCaps<import("@appium/types").ConstraintsToCaps<C> & void, "appium">>): Partial<import("@appium/types").ConstraintsToCaps<C> & void>;
232
83
  /**
233
84
  * Return a copy of a capabilities object which has taken everything within the 'options'
234
- * capability and promoted it to the top level. Note that this function is assumed to be run after
235
- * all vendor prefixes have already been stripped from the top level. So we are dealing with e.g.
236
- * 'options' and not 'appium:options' at this point. Any prefixes _inside_ the 'options' capability
237
- * will themselves be stripped. This is designed as an internal function, not one to operate on
238
- * user-constructed capabilities.
85
+ * capability and promoted it to the top level.
239
86
  *
240
- * @param {object} originalCaps - the capabilities to analyze and promote from 'options'
241
- * @return {object!} - the capabilities with 'options' promoted if necessary
87
+ * @template {Constraints} C
88
+ * @param {import('@appium/types').W3CCapabilities<C>} originalCaps
89
+ * @return {import('@appium/types').W3CCapabilities<C>} the capabilities with 'options' promoted if necessary
242
90
  */
243
- export function promoteAppiumOptions(originalCaps: object): object;
91
+ export function promoteAppiumOptions<C extends Readonly<Record<string, import("@appium/types").Constraint>>>(originalCaps: import("@appium/types").W3CCapabilities<C, void>): import("@appium/types").W3CCapabilities<C, void>;
244
92
  export const PREFIXED_APPIUM_OPTS_CAP: string;
245
93
  //# sourceMappingURL=capabilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../lib/basedriver/capabilities.js"],"names":[],"mappings":"AA2FA;;;GAGG;AACH,uGAcE;0BA2RW,OAAO,eAAe,EAAE,WAAW;yBACnC,OAAO,eAAe,EAAE,UAAU;2BAClC,OAAO,eAAe,EAAE,YAAY;uCACpC,OAAO,eAAe,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEAWhD,OAAO,eAAe,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEAMhD,OAAO,eAAe,EAAE,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEAM9C,OAAO,eAAe,EAAE,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC;AAhO9D;;;;;;;GAOG;AACH;;;;;;EAmGC;AAGD;;;;;;GAMG;AACH,4SAuBC;AApSD;;;;;;GAMG;AACH,8SAwCC;AA7ED;;;;;;;;GAQG;AACH,kmHAkBC;AA/BD,6CAAuC;AACvC,wCAAkC;AAuKlC;;;;GAIG;AACH,0MAWC;AA/ED;;;GAGG;AACH,mCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,mSA6CC;AAkKD;;;;;;;;;;GAUG;AACH,mDAHW,MAAM,GACL,MAAM,CA8BjB;AA7WD,8CAA6E"}
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../lib/basedriver/capabilities.js"],"names":[],"mappings":"AA0FA;;;GAGG;AACH,uGAeE;0BA8TW,OAAO,eAAe,EAAE,WAAW;yBACnC,OAAO,eAAe,EAAE,UAAU;2BAClC,OAAO,eAAe,EAAE,YAAY;uCACpC,OAAO,eAAe,EAAE,wBAAwB;;;;;;;qOAWhD,OAAO,eAAe,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC;mOAMhD,OAAO,eAAe,EAAE,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;sOAM9C,OAAO,eAAe,EAAE,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC;0BAKjD,OAAO,WAAW,EAAE,KAAK,CAAC,CAAC,EAAC,CAAC,CAAC;6BAI9B,OAAO,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AA7Q/C;;;;;;;GAOG;AACH;;;;;;EAmGC;AAGD;;;;;;GAMG;AACH,4SAuBC;AApSD;;;;;;GAMG;AACH,8SAwCC;AA7ED;;;;;;;;GAQG;AACH,kmHAkBC;AA9BD,6CAAuC;AAuKvC;;;;GAIG;AACH,0MAWC;AA9ED;;;GAGG;AACH,mCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,mSA4CC;AAkKD;;;;;;;GAOG;AACH,+NAoEC;AAlZD,8CAAkE"}