@appium/base-driver 9.13.1 → 9.14.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 (50) hide show
  1. package/build/lib/basedriver/commands/bidi.d.ts.map +1 -1
  2. package/build/lib/basedriver/commands/bidi.js +16 -0
  3. package/build/lib/basedriver/commands/bidi.js.map +1 -1
  4. package/build/lib/basedriver/commands/mixin.d.ts.map +1 -1
  5. package/build/lib/basedriver/commands/mixin.js +0 -1
  6. package/build/lib/basedriver/commands/mixin.js.map +1 -1
  7. package/build/lib/basedriver/commands/timeout.js +4 -1
  8. package/build/lib/basedriver/commands/timeout.js.map +1 -1
  9. package/build/lib/basedriver/core.d.ts +6 -4
  10. package/build/lib/basedriver/core.d.ts.map +1 -1
  11. package/build/lib/basedriver/core.js +30 -14
  12. package/build/lib/basedriver/core.js.map +1 -1
  13. package/build/lib/basedriver/driver.js +24 -2
  14. package/build/lib/basedriver/driver.js.map +1 -1
  15. package/build/lib/basedriver/helpers.d.ts.map +1 -1
  16. package/build/lib/basedriver/helpers.js +3 -2
  17. package/build/lib/basedriver/helpers.js.map +1 -1
  18. package/build/lib/express/express-logging.js +1 -1
  19. package/build/lib/express/express-logging.js.map +1 -1
  20. package/build/lib/express/server.d.ts.map +1 -1
  21. package/build/lib/express/server.js +1 -1
  22. package/build/lib/express/server.js.map +1 -1
  23. package/build/lib/express/websocket.js +1 -2
  24. package/build/lib/express/websocket.js.map +1 -1
  25. package/build/lib/index.js +1 -1
  26. package/build/lib/index.js.map +1 -1
  27. package/build/lib/jsonwp-proxy/proxy.js +1 -1
  28. package/build/lib/jsonwp-proxy/proxy.js.map +1 -1
  29. package/build/lib/protocol/bidi-commands.d.ts +9 -3
  30. package/build/lib/protocol/bidi-commands.js +4 -0
  31. package/build/lib/protocol/bidi-commands.js.map +1 -1
  32. package/build/lib/protocol/errors.d.ts +3 -9
  33. package/build/lib/protocol/errors.d.ts.map +1 -1
  34. package/build/lib/protocol/errors.js +4 -6
  35. package/build/lib/protocol/errors.js.map +1 -1
  36. package/lib/basedriver/commands/bidi.ts +15 -1
  37. package/lib/basedriver/commands/find.ts +1 -1
  38. package/lib/basedriver/commands/mixin.ts +0 -1
  39. package/lib/basedriver/commands/timeout.ts +5 -1
  40. package/lib/basedriver/core.ts +35 -14
  41. package/lib/basedriver/driver.ts +1 -1
  42. package/lib/basedriver/helpers.js +3 -2
  43. package/lib/express/express-logging.js +1 -1
  44. package/lib/express/server.js +2 -1
  45. package/lib/express/websocket.js +2 -2
  46. package/lib/index.js +1 -1
  47. package/lib/jsonwp-proxy/proxy.js +1 -1
  48. package/lib/protocol/bidi-commands.js +4 -0
  49. package/lib/protocol/errors.js +4 -6
  50. package/package.json +7 -7
@@ -60,7 +60,7 @@ async function createServer (app, cliArgs) {
60
60
  }
61
61
  const [cert, key] = await B.all(certKey.map((p) => fs.readFile(p, 'utf8')));
62
62
  log.debug('Enabling TLS/SPDY on the server using the provided certificate');
63
- // eslint-disable-next-line @typescript-eslint/no-var-requires
63
+
64
64
  return require('spdy').createServer({
65
65
  cert,
66
66
  key,
@@ -151,6 +151,7 @@ function configureServer({
151
151
 
152
152
  // set up static assets
153
153
  app.use(favicon(path.resolve(STATIC_DIR, 'favicon.ico')));
154
+ // eslint-disable-next-line import/no-named-as-default-member
154
155
  app.use(express.static(STATIC_DIR));
155
156
 
156
157
  // crash routes, for testing
@@ -1,4 +1,4 @@
1
- /* eslint-disable require-await */
1
+
2
2
  import _ from 'lodash';
3
3
  import B from 'bluebird';
4
4
 
@@ -41,7 +41,7 @@ async function removeWebSocketHandler(handlerPathname) {
41
41
  client.terminate();
42
42
  }
43
43
  return true;
44
- } catch (ign) {
44
+ } catch {
45
45
  // ignore
46
46
  } finally {
47
47
  delete this.webSocketsMapping[handlerPathname];
package/lib/index.js CHANGED
@@ -4,7 +4,7 @@ try {
4
4
  B.config({
5
5
  cancellation: true,
6
6
  });
7
- } catch (ign) {
7
+ } catch {
8
8
  // sometimes during testing this somehow gets required twice and results in an error about
9
9
  // cancellation not being able to be enabled after promise has been configured
10
10
  }
@@ -207,7 +207,7 @@ class JWProxy {
207
207
  if (typeof body !== 'object') {
208
208
  try {
209
209
  reqOpts.data = JSON.parse(body);
210
- } catch (e) {
210
+ } catch {
211
211
  throw new Error(`Cannot interpret the request body as valid JSON: ${truncateBody(body)}`);
212
212
  }
213
213
  } else {
@@ -13,6 +13,10 @@ const BIDI_COMMANDS = /** @type {const} */ ({
13
13
  command: 'bidiUnsubscribe',
14
14
  params: SUBSCRIPTION_REQUEST_PARAMS,
15
15
  },
16
+ status: {
17
+ command: 'bidiStatus',
18
+ params: {},
19
+ }
16
20
  },
17
21
  browsingContext: {
18
22
  navigate: {
@@ -60,16 +60,14 @@ export class ProtocolError extends BaseError {
60
60
  * Get the Bidi protocol version of an error
61
61
  * @param {string|number} id - the id used in the request for which this error forms the response
62
62
  * @see https://w3c.github.io/webdriver-bidi/#protocol-definition
63
- * @returns The object conforming to the shape of a BiDi error response
63
+ * @returns {import('@appium/types').ErrorBiDiCommandResponse} The object conforming to the shape of a BiDi error response
64
64
  */
65
65
  bidiErrObject(id) {
66
66
  // if we don't have an id, the client didn't send one, so we have nothing to send back.
67
- // send back an empty string rather than making something up
68
- if (_.isNil(id)) {
69
- id = '';
70
- }
67
+ // send back zero rather than making something up
68
+ const intId = /** @type {number} */ (_.isInteger(id) ? id : (parseInt(`${id}`, 10) || 0));
71
69
  return {
72
- id,
70
+ id: intId,
73
71
  type: 'error',
74
72
  error: this.error,
75
73
  stacktrace: this.stacktrace,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appium/base-driver",
3
- "version": "9.13.1",
3
+ "version": "9.14.1",
4
4
  "description": "Base driver class for Appium drivers",
5
5
  "keywords": [
6
6
  "automation",
@@ -44,13 +44,13 @@
44
44
  "test:types": "tsd"
45
45
  },
46
46
  "dependencies": {
47
- "@appium/support": "^6.0.0",
48
- "@appium/types": "^0.22.3",
47
+ "@appium/support": "^6.0.2",
48
+ "@appium/types": "^0.23.0",
49
49
  "@colors/colors": "1.6.0",
50
50
  "@types/async-lock": "1.4.2",
51
51
  "@types/bluebird": "3.5.42",
52
52
  "@types/express": "5.0.0",
53
- "@types/lodash": "4.17.13",
53
+ "@types/lodash": "4.17.14",
54
54
  "@types/method-override": "3.0.0",
55
55
  "@types/serve-favicon": "2.5.7",
56
56
  "async-lock": "1.4.1",
@@ -58,7 +58,7 @@
58
58
  "axios": "1.7.9",
59
59
  "bluebird": "3.7.2",
60
60
  "body-parser": "1.20.3",
61
- "express": "4.21.1",
61
+ "express": "4.21.2",
62
62
  "http-status-codes": "2.3.0",
63
63
  "lodash": "4.17.21",
64
64
  "lru-cache": "10.4.3",
@@ -67,7 +67,7 @@
67
67
  "path-to-regexp": "8.2.0",
68
68
  "serve-favicon": "2.5.0",
69
69
  "source-map-support": "0.5.21",
70
- "type-fest": "4.30.0",
70
+ "type-fest": "4.31.0",
71
71
  "validate.js": "0.13.1"
72
72
  },
73
73
  "optionalDependencies": {
@@ -80,7 +80,7 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "1d16ac6b4521b1ac06b8650c6bb5c311d8d49ae3",
83
+ "gitHead": "3467f32c8e3618db05b6b210544cfdc6a57bb73c",
84
84
  "tsd": {
85
85
  "directory": "test/types"
86
86
  }