appium-remote-debugger 12.1.3 → 12.1.5

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 (55) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/atoms.js +1 -1
  3. package/build/lib/atoms.js.map +1 -1
  4. package/build/lib/mixins/connect.js +3 -3
  5. package/build/lib/mixins/connect.js.map +1 -1
  6. package/build/lib/mixins/execute.js +1 -1
  7. package/build/lib/mixins/execute.js.map +1 -1
  8. package/build/lib/mixins/message-handlers.d.ts.map +1 -1
  9. package/build/lib/mixins/message-handlers.js +3 -7
  10. package/build/lib/mixins/message-handlers.js.map +1 -1
  11. package/build/lib/mixins/misc.js +36 -6
  12. package/build/lib/mixins/misc.js.map +1 -1
  13. package/build/lib/mixins/navigate.js +42 -9
  14. package/build/lib/mixins/navigate.js.map +1 -1
  15. package/build/lib/remote-debugger-real-device.d.ts +1 -1
  16. package/build/lib/remote-debugger-real-device.d.ts.map +1 -1
  17. package/build/lib/remote-debugger-real-device.js +2 -5
  18. package/build/lib/remote-debugger-real-device.js.map +1 -1
  19. package/build/lib/rpc/index.d.ts +2 -2
  20. package/build/lib/rpc/index.d.ts.map +1 -1
  21. package/build/lib/rpc/index.js +4 -7
  22. package/build/lib/rpc/index.js.map +1 -1
  23. package/build/lib/rpc/remote-messages.js +2 -2
  24. package/build/lib/rpc/remote-messages.js.map +1 -1
  25. package/build/lib/rpc/rpc-client-real-device.d.ts +1 -1
  26. package/build/lib/rpc/rpc-client-real-device.d.ts.map +1 -1
  27. package/build/lib/rpc/rpc-client-real-device.js +2 -2
  28. package/build/lib/rpc/rpc-client-real-device.js.map +1 -1
  29. package/build/lib/rpc/rpc-client-simulator.d.ts +1 -1
  30. package/build/lib/rpc/rpc-client-simulator.d.ts.map +1 -1
  31. package/build/lib/rpc/rpc-client-simulator.js +3 -3
  32. package/build/lib/rpc/rpc-client-simulator.js.map +1 -1
  33. package/build/lib/rpc/rpc-client.d.ts +1 -1
  34. package/build/lib/rpc/rpc-client.d.ts.map +1 -1
  35. package/build/lib/rpc/rpc-client.js +2 -2
  36. package/build/lib/rpc/rpc-client.js.map +1 -1
  37. package/build/lib/utils.js +1 -1
  38. package/build/lib/utils.js.map +1 -1
  39. package/build/tsconfig.tsbuildinfo +1 -1
  40. package/lib/atoms.js +1 -1
  41. package/lib/mixins/connect.js +2 -2
  42. package/lib/mixins/execute.js +1 -1
  43. package/lib/mixins/message-handlers.js +1 -5
  44. package/lib/mixins/misc.js +3 -3
  45. package/lib/mixins/navigate.js +8 -8
  46. package/lib/remote-debugger-real-device.ts +1 -1
  47. package/lib/rpc/index.js +2 -2
  48. package/lib/rpc/remote-messages.js +1 -1
  49. package/lib/rpc/rpc-client-real-device.js +2 -2
  50. package/lib/rpc/rpc-client-simulator.js +2 -2
  51. package/lib/rpc/rpc-client.js +5 -5
  52. package/lib/rpc/rpc-message-handler.js +1 -1
  53. package/lib/utils.js +2 -2
  54. package/package.json +3 -3
  55. package/scripts/common.js +1 -1
package/lib/atoms.js CHANGED
@@ -28,7 +28,7 @@ async function getAtom (atomName) {
28
28
  const atomFileName = path.resolve(getModuleRoot(), 'atoms', `${atomName}.js`);
29
29
  try {
30
30
  ATOMS_CACHE[atomName] = await fs.readFile(atomFileName);
31
- } catch (e) {
31
+ } catch {
32
32
  throw new Error(`Unable to load Atom '${atomName}' from file '${atomFileName}'`);
33
33
  }
34
34
  }
@@ -3,7 +3,7 @@ import {
3
3
  WEB_CONTENT_BUNDLE_ID,
4
4
  appIdsForBundle,
5
5
  } from '../utils';
6
- import events from './events';
6
+ import { events } from './events';
7
7
  import { timing, util } from '@appium/support';
8
8
  import { retryInterval, waitForCondition } from 'asyncbox';
9
9
  import _ from 'lodash';
@@ -85,7 +85,7 @@ export async function connect (timeout = APP_CONNECT_TIMEOUT_MS) {
85
85
  `Retrieved ${util.pluralize('application', _.size(getAppDict(this)), true)} ` +
86
86
  `within ${timer.getDuration().asMilliSeconds.toFixed(0)}ms`
87
87
  );
88
- } catch (err) {
88
+ } catch {
89
89
  this.log.debug(`Timed out waiting for applications to be reported`);
90
90
  }
91
91
  }
@@ -122,7 +122,7 @@ export async function executeAtomAsync (atom, args = [], frames = []) {
122
122
  await this.executeAtom(
123
123
  'execute_script', [`delete window.${promiseName};`, [null, null], subcommandTimeout], frames
124
124
  );
125
- } catch (ign) {}
125
+ } catch {}
126
126
  }
127
127
  return convertResult(res);
128
128
  }
@@ -1,4 +1,4 @@
1
- import events from './events';
1
+ import { events } from './events';
2
2
  import {
3
3
  pageArrayFromDict,
4
4
  appInfoFromDict,
@@ -27,7 +27,6 @@ import {
27
27
  * @param {Record<string, any>} pageDict
28
28
  * @returns {Promise<void>}
29
29
  */
30
- // eslint-disable-next-line require-await
31
30
  export async function onPageChange (err, appIdKey, pageDict) {
32
31
  if (_.isEmpty(pageDict)) {
33
32
  return;
@@ -69,7 +68,6 @@ export async function onPageChange (err, appIdKey, pageDict) {
69
68
  * @param {Record<string, any>} dict
70
69
  * @returns {Promise<void>}
71
70
  */
72
- // eslint-disable-next-line require-await
73
71
  export async function onAppConnect (err, dict) {
74
72
  const appIdKey = dict.WIRApplicationIdentifierKey;
75
73
  this.log.debug(`Notified that new application '${appIdKey}' has connected`);
@@ -110,7 +108,6 @@ export function onAppDisconnect (err, dict) {
110
108
  * @param {Record<string, any>} dict
111
109
  * @returns {Promise<void>}
112
110
  */
113
- // eslint-disable-next-line require-await
114
111
  export async function onAppUpdate (err, dict) {
115
112
  this.log.debug(`Notified that an application has been updated`);
116
113
  updateAppsWithDict.bind(this)(dict);
@@ -146,7 +143,6 @@ export function onCurrentState (err, state) {
146
143
  * @param {Record<string, any>} apps
147
144
  * @returns {Promise<void>}
148
145
  */
149
- // eslint-disable-next-line require-await
150
146
  export async function onConnectedApplicationList (err, apps) {
151
147
  this.log.debug(`Received connected applications list: ${_.keys(apps).join(', ')}`);
152
148
 
@@ -1,5 +1,5 @@
1
1
  import { checkParams } from '../utils';
2
- import B from 'bluebird';
2
+ import B, { TimeoutError as BTimeoutError } from 'bluebird';
3
3
  import {
4
4
  getAppIdKey,
5
5
  getPageIdKey,
@@ -72,7 +72,7 @@ export async function garbageCollect (timeoutMs = GARBAGE_COLLECT_TIMEOUT_MS) {
72
72
  appIdKey: getAppIdKey(this),
73
73
  pageIdKey: getPageIdKey(this),
74
74
  });
75
- } catch (err) {
75
+ } catch {
76
76
  this.log.debug(`Unable to collect garbage at this time`);
77
77
  return;
78
78
  }
@@ -86,7 +86,7 @@ export async function garbageCollect (timeoutMs = GARBAGE_COLLECT_TIMEOUT_MS) {
86
86
  ).timeout(timeoutMs);
87
87
  this.log.debug(`Garbage collection successful`);
88
88
  } catch (e) {
89
- if (e instanceof B.TimeoutError) {
89
+ if (e instanceof BTimeoutError) {
90
90
  this.log.debug(`Garbage collection timed out after ${timeoutMs}ms`);
91
91
  } else {
92
92
  this.log.debug(`Unable to collect garbage: ${e.message}`);
@@ -1,8 +1,8 @@
1
1
  import { checkParams, pageArrayFromDict } from '../utils';
2
- import events from './events';
2
+ import { events } from './events';
3
3
  import { timing, util } from '@appium/support';
4
4
  import _ from 'lodash';
5
- import B from 'bluebird';
5
+ import B, { TimeoutError as BTimeoutError } from 'bluebird';
6
6
  import { errors } from '@appium/base-driver';
7
7
  import { rpcConstants } from '../rpc';
8
8
  import {
@@ -128,7 +128,7 @@ export async function waitForDom (startPageLoadTimer) {
128
128
  const cancellationPromise = B.resolve((async () => {
129
129
  try {
130
130
  await getPageLoadDelay(this);
131
- } catch (ign) {}
131
+ } catch {}
132
132
  })());
133
133
 
134
134
  try {
@@ -159,7 +159,7 @@ export async function checkPageIsReady (timeoutMs) {
159
159
  `The pageLoadStrategy is '${getPageLoadStartegy(this) ?? PAGE_LOAD_STRATEGY.NORMAL}'`);
160
160
  return this.isPageLoadingCompleted(readyState);
161
161
  } catch (err) {
162
- if (!(err instanceof B.TimeoutError)) {
162
+ if (!(err instanceof BTimeoutError)) {
163
163
  throw err;
164
164
  }
165
165
  this.log.debug(`Page readiness check timed out after ${actualTimeoutMs}ms`);
@@ -180,7 +180,7 @@ export async function navToUrl (url) {
180
180
 
181
181
  try {
182
182
  new URL(url);
183
- } catch (e) {
183
+ } catch {
184
184
  throw new TypeError(`'${url}' is not a valid URL`);
185
185
  }
186
186
 
@@ -213,7 +213,7 @@ export async function navToUrl (url) {
213
213
  if (isReady && isPageLoading && onPageLoaded) {
214
214
  return onPageLoaded();
215
215
  }
216
- } catch (ign) {}
216
+ } catch {}
217
217
  const msLeft = PAGE_READINESS_JS_MIN_CHECK_INTERVAL_MS - pageReadyCheckStart.getDuration().asMilliSeconds;
218
218
  if (msLeft > 0 && isPageLoading) {
219
219
  await B.delay(msLeft);
@@ -299,7 +299,7 @@ export async function navToUrl (url) {
299
299
  const cancellationPromise = B.resolve((async () => {
300
300
  try {
301
301
  await getPageLoadDelay(this);
302
- } catch (ign) {}
302
+ } catch {}
303
303
  })());
304
304
 
305
305
  try {
@@ -332,7 +332,7 @@ export async function navToUrl (url) {
332
332
  pageIdKey: getPageIdKey(this),
333
333
  }, didPageFinishLoad)).timeout(CONSOLE_ENABLEMENT_TIMEOUT_MS);
334
334
  } catch (err) {
335
- if (err instanceof B.TimeoutError) {
335
+ if (err instanceof BTimeoutError) {
336
336
  throw new errors.TimeoutError(`Could not enable console events after the page load within ` +
337
337
  `${CONSOLE_ENABLEMENT_TIMEOUT_MS}ms. The Web Inspector/Safari may need to be restarted.`);
338
338
  }
@@ -1,4 +1,4 @@
1
- import RemoteDebugger from './remote-debugger';
1
+ import { RemoteDebugger } from './remote-debugger';
2
2
  import { RpcClientRealDevice } from './rpc';
3
3
  import type { RemoteDebuggerRealDeviceOptions } from './types';
4
4
 
package/lib/rpc/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import RpcClientSimulator from './rpc-client-simulator';
2
- import RpcClientRealDevice from './rpc-client-real-device';
1
+ import { RpcClientSimulator } from './rpc-client-simulator';
2
+ import { RpcClientRealDevice } from './rpc-client-real-device';
3
3
  import * as rpcConstants from './constants';
4
4
 
5
5
 
@@ -1,5 +1,5 @@
1
1
  import _ from 'lodash';
2
- import getProtocolCommand from '../protocol';
2
+ import { getProtocolCommand } from '../protocol';
3
3
 
4
4
 
5
5
  const OBJECT_GROUP = 'console';
@@ -1,5 +1,5 @@
1
1
  import log from '../logger';
2
- import RpcClient from './rpc-client';
2
+ import { RpcClient } from './rpc-client';
3
3
  import { services } from 'appium-ios-device';
4
4
 
5
5
 
@@ -47,7 +47,7 @@ export class RpcClientRealDevice extends RpcClient {
47
47
  /**
48
48
  * @override
49
49
  */
50
- async sendMessage (cmd) { // eslint-disable-line require-await
50
+ async sendMessage (cmd) {
51
51
  this.service.sendMessage(cmd);
52
52
  }
53
53
 
@@ -2,7 +2,7 @@ import log from '../logger';
2
2
  import _ from 'lodash';
3
3
  import B from 'bluebird';
4
4
  import net from 'net';
5
- import RpcClient from './rpc-client';
5
+ import { RpcClient } from './rpc-client';
6
6
  import { services } from 'appium-ios-device';
7
7
 
8
8
  export class RpcClientSimulator extends RpcClient {
@@ -170,7 +170,7 @@ export class RpcClientSimulator extends RpcClient {
170
170
  try {
171
171
  // @ts-ignore socket must be defined
172
172
  this.socket.removeListener('error', onSocketError);
173
- } catch (ign) {}
173
+ } catch {}
174
174
  });
175
175
  }
176
176
 
@@ -1,4 +1,4 @@
1
- import RemoteMessages from './remote-messages';
1
+ import { RemoteMessages } from './remote-messages';
2
2
  import { waitForCondition } from 'asyncbox';
3
3
  import log from '../logger';
4
4
  import _ from 'lodash';
@@ -435,11 +435,11 @@ export class RpcClient {
435
435
  });
436
436
  }
437
437
 
438
- async connect () { // eslint-disable-line require-await
438
+ async connect () {
439
439
  throw new Error(`Sub-classes need to implement a 'connect' function`);
440
440
  }
441
441
 
442
- async disconnect () { // eslint-disable-line require-await
442
+ async disconnect () {
443
443
  this.messageHandler?.removeAllListeners();
444
444
  }
445
445
 
@@ -448,7 +448,7 @@ export class RpcClient {
448
448
  * @returns {Promise<void>}
449
449
  */
450
450
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
451
- async sendMessage (command) { // eslint-disable-line require-await
451
+ async sendMessage (command) {
452
452
  throw new Error(`Sub-classes need to implement a 'sendMessage' function`);
453
453
  }
454
454
 
@@ -457,7 +457,7 @@ export class RpcClient {
457
457
  * @returns {Promise<void>}
458
458
  */
459
459
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
460
- async receive (data) { // eslint-disable-line require-await
460
+ async receive (data) {
461
461
  throw new Error(`Sub-classes need to implement a 'receive' function`);
462
462
  }
463
463
 
@@ -82,7 +82,7 @@ export default class RpcMessageHandler extends EventEmitters {
82
82
  }
83
83
  }
84
84
 
85
- async dispatchDataMessage (msgId, method, params, result, error) { // eslint-disable-line require-await
85
+ async dispatchDataMessage (msgId, method, params, result, error) {
86
86
  if (!_.isEmpty(msgId)) {
87
87
  log.debug(`Handling message (id: '${msgId}')`);
88
88
  }
package/lib/utils.js CHANGED
@@ -140,7 +140,7 @@ export function deferredPromise () {
140
140
  let resolve;
141
141
  /** @type {(err?: Error) => void} */
142
142
  let reject;
143
- const promise = new B((res, rej) => { // eslint-disable-line promise/param-names
143
+ const promise = new B((res, rej) => {
144
144
  resolve = res;
145
145
  reject = rej;
146
146
  });
@@ -164,7 +164,7 @@ export function convertResult (res) {
164
164
  } else if (_.isString(res)) {
165
165
  try {
166
166
  res = JSON.parse(res);
167
- } catch (err) {
167
+ } catch {
168
168
  // we might get a serialized object, but we might not
169
169
  // if we get here, it is just a value
170
170
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "keywords": [
5
5
  "appium"
6
6
  ],
7
- "version": "12.1.3",
7
+ "version": "12.1.5",
8
8
  "author": "Appium Contributors",
9
9
  "license": "Apache-2.0",
10
10
  "repository": {
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@appium/base-driver": "^9.0.0",
37
- "@appium/support": "^5.0.3",
37
+ "@appium/support": "^6.0.0",
38
38
  "appium-ios-device": "^2.0.0",
39
39
  "asyncbox": "^3.0.0",
40
40
  "bluebird": "^3.4.7",
@@ -64,7 +64,7 @@
64
64
  "singleQuote": true
65
65
  },
66
66
  "devDependencies": {
67
- "@appium/eslint-config-appium-ts": "^0.x",
67
+ "@appium/eslint-config-appium-ts": "^1.x",
68
68
  "@appium/tsconfig": "^0.x",
69
69
  "@appium/types": "^0.x",
70
70
  "@semantic-release/changelog": "^6.0.1",
package/scripts/common.js CHANGED
@@ -27,7 +27,7 @@ const LAST_UPDATE_FILE = path.resolve(ATOMS_DIRECTORY, 'lastupdate');
27
27
  async function rmDir (dir) {
28
28
  try {
29
29
  await fs.promises.access(dir, fs.constants.R_OK);
30
- } catch (e) {
30
+ } catch {
31
31
  return;
32
32
  }
33
33