appium-remote-debugger 15.2.9 → 15.2.11

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 (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/mixins/connect.d.ts +47 -31
  3. package/build/lib/mixins/connect.d.ts.map +1 -1
  4. package/build/lib/mixins/connect.js +105 -86
  5. package/build/lib/mixins/connect.js.map +1 -1
  6. package/build/lib/mixins/cookies.d.ts +17 -13
  7. package/build/lib/mixins/cookies.d.ts.map +1 -1
  8. package/build/lib/mixins/cookies.js +12 -12
  9. package/build/lib/mixins/cookies.js.map +1 -1
  10. package/build/lib/mixins/events.d.ts +32 -31
  11. package/build/lib/mixins/events.d.ts.map +1 -1
  12. package/build/lib/mixins/events.js +21 -24
  13. package/build/lib/mixins/events.js.map +1 -1
  14. package/build/lib/mixins/execute.d.ts +35 -24
  15. package/build/lib/mixins/execute.d.ts.map +1 -1
  16. package/build/lib/mixins/execute.js +34 -26
  17. package/build/lib/mixins/execute.js.map +1 -1
  18. package/build/lib/mixins/message-handlers.d.ts +63 -43
  19. package/build/lib/mixins/message-handlers.d.ts.map +1 -1
  20. package/build/lib/mixins/message-handlers.js +74 -57
  21. package/build/lib/mixins/message-handlers.js.map +1 -1
  22. package/build/lib/mixins/misc.d.ts +34 -24
  23. package/build/lib/mixins/misc.d.ts.map +1 -1
  24. package/build/lib/mixins/misc.js +27 -21
  25. package/build/lib/mixins/misc.js.map +1 -1
  26. package/build/lib/mixins/navigate.d.ts +39 -27
  27. package/build/lib/mixins/navigate.d.ts.map +1 -1
  28. package/build/lib/mixins/navigate.js +31 -31
  29. package/build/lib/mixins/navigate.js.map +1 -1
  30. package/build/lib/mixins/screenshot.d.ts +21 -11
  31. package/build/lib/mixins/screenshot.d.ts.map +1 -1
  32. package/build/lib/mixins/screenshot.js +10 -14
  33. package/build/lib/mixins/screenshot.js.map +1 -1
  34. package/build/tsconfig.tsbuildinfo +1 -1
  35. package/lib/mixins/{connect.js → connect.ts} +153 -113
  36. package/lib/mixins/cookies.ts +61 -0
  37. package/lib/mixins/events.ts +91 -0
  38. package/lib/mixins/{execute.js → execute.ts} +59 -33
  39. package/lib/mixins/message-handlers.ts +272 -0
  40. package/lib/mixins/misc.ts +136 -0
  41. package/lib/mixins/{navigate.js → navigate.ts} +44 -41
  42. package/lib/mixins/screenshot.ts +52 -0
  43. package/package.json +1 -1
  44. package/lib/mixins/cookies.js +0 -53
  45. package/lib/mixins/events.js +0 -81
  46. package/lib/mixins/message-handlers.js +0 -224
  47. package/lib/mixins/misc.js +0 -121
  48. package/lib/mixins/screenshot.js +0 -43
@@ -1,45 +1,46 @@
1
+ import type { RemoteDebugger } from '../remote-debugger';
2
+ import type { EventListener } from '../types';
3
+ export declare const events: {
4
+ readonly EVENT_PAGE_CHANGE: "remote_debugger_page_change";
5
+ readonly EVENT_FRAMES_DETACHED: "remote_debugger_frames_detached";
6
+ readonly EVENT_DISCONNECT: "remote_debugger_disconnect";
7
+ };
1
8
  /**
2
- * Keep track of the client event listeners so they can be removed
9
+ * Adds a client event listener to the RPC client and tracks it for later removal.
10
+ * The listener will be called when the specified event is emitted by the remote debugger.
3
11
  *
4
- * @this {RemoteDebugger}
5
- * @param {string} eventName
6
- * @param {import('../types').EventListener} listener
7
- * @returns {void}
12
+ * @param eventName - The name of the event to listen for.
13
+ * @param listener - The event listener function to call when the event is emitted.
8
14
  */
9
- export function addClientEventListener(this: import("../remote-debugger").RemoteDebugger, eventName: string, listener: import("../types").EventListener): void;
15
+ export declare function addClientEventListener(this: RemoteDebugger, eventName: string, listener: EventListener): void;
10
16
  /**
11
- * @this {RemoteDebugger}
12
- * @param {string} eventName
13
- * @returns {void}
17
+ * Removes all client event listeners for the specified event name from the RPC client.
18
+ * This will stop listening for the event and clean up the tracked listeners.
19
+ *
20
+ * @param eventName - The name of the event to stop listening for.
14
21
  */
15
- export function removeClientEventListener(this: import("../remote-debugger").RemoteDebugger, eventName: string): void;
22
+ export declare function removeClientEventListener(this: RemoteDebugger, eventName: string): void;
16
23
  /**
17
- * @this {RemoteDebugger}
18
- * @param {import('../types').EventListener} listener
19
- * @returns {void}
24
+ * Starts listening for JavaScript console messages by registering listeners
25
+ * for Console.messageAdded and Console.messageRepeatCountUpdated events.
26
+ *
27
+ * @param listener - The event listener function to call when console messages are received.
20
28
  */
21
- export function startConsole(this: import("../remote-debugger").RemoteDebugger, listener: import("../types").EventListener): void;
29
+ export declare function startConsole(this: RemoteDebugger, listener: EventListener): void;
22
30
  /**
23
- * @this {RemoteDebugger}
24
- * @returns {void}
31
+ * Stops listening for JavaScript console messages by removing listeners
32
+ * for Console.messageAdded and Console.messageRepeatCountUpdated events.
25
33
  */
26
- export function stopConsole(this: import("../remote-debugger").RemoteDebugger): void;
34
+ export declare function stopConsole(this: RemoteDebugger): void;
27
35
  /**
28
- * @this {RemoteDebugger}
29
- * @param {import('../types').EventListener} listener
30
- * @returns {void}
36
+ * Starts listening for network events by registering a listener for NetworkEvent.
37
+ * This aggregates all Network.* events into a single NetworkEvent.
38
+ *
39
+ * @param listener - The event listener function to call when network events are received.
31
40
  */
32
- export function startNetwork(this: import("../remote-debugger").RemoteDebugger, listener: import("../types").EventListener): void;
41
+ export declare function startNetwork(this: RemoteDebugger, listener: EventListener): void;
33
42
  /**
34
- * @this {RemoteDebugger}
35
- * @returns {void}
43
+ * Stops listening for network events by removing the listener for NetworkEvent.
36
44
  */
37
- export function stopNetwork(this: import("../remote-debugger").RemoteDebugger): void;
38
- export namespace events {
39
- let EVENT_PAGE_CHANGE: "remote_debugger_page_change";
40
- let EVENT_FRAMES_DETACHED: "remote_debugger_frames_detached";
41
- let EVENT_DISCONNECT: "remote_debugger_disconnect";
42
- }
43
- export default events;
44
- export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
45
+ export declare function stopNetwork(this: RemoteDebugger): void;
45
46
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../lib/mixins/events.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,qGAJW,MAAM,YACN,OAAO,UAAU,EAAE,aAAa,GAC9B,IAAI,CAMhB;AAED;;;;GAIG;AACH,wGAHW,MAAM,GACJ,IAAI,CAMhB;AAED;;;;GAIG;AACH,0FAHW,OAAO,UAAU,EAAE,aAAa,GAC9B,IAAI,CAMhB;AAED;;;GAGG;AACH,gFAFa,IAAI,CAMhB;AAED;;;;GAIG;AACH,0FAHW,OAAO,UAAU,EAAE,aAAa,GAC9B,IAAI,CAKhB;AAED;;;GAGG;AACH,gFAFa,IAAI,CAKhB;;;;;;;6BAKY,OAAO,oBAAoB,EAAE,cAAc"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../lib/mixins/events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,eAAO,MAAM,MAAM;;;;CAIT,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,MAAM,GAChB,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAIN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAItD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAGN;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAGtD"}
@@ -9,18 +9,17 @@ exports.startNetwork = startNetwork;
9
9
  exports.stopNetwork = stopNetwork;
10
10
  const property_accessors_1 = require("./property-accessors");
11
11
  // event emitted publically
12
- exports.events = ({
12
+ exports.events = {
13
13
  EVENT_PAGE_CHANGE: 'remote_debugger_page_change',
14
14
  EVENT_FRAMES_DETACHED: 'remote_debugger_frames_detached',
15
15
  EVENT_DISCONNECT: 'remote_debugger_disconnect',
16
- });
16
+ };
17
17
  /**
18
- * Keep track of the client event listeners so they can be removed
18
+ * Adds a client event listener to the RPC client and tracks it for later removal.
19
+ * The listener will be called when the specified event is emitted by the remote debugger.
19
20
  *
20
- * @this {RemoteDebugger}
21
- * @param {string} eventName
22
- * @param {import('../types').EventListener} listener
23
- * @returns {void}
21
+ * @param eventName - The name of the event to listen for.
22
+ * @param listener - The event listener function to call when the event is emitted.
24
23
  */
25
24
  function addClientEventListener(eventName, listener) {
26
25
  (0, property_accessors_1.getClientEventListeners)(this)[eventName] ??= [];
@@ -28,9 +27,10 @@ function addClientEventListener(eventName, listener) {
28
27
  this.requireRpcClient().on(eventName, listener);
29
28
  }
30
29
  /**
31
- * @this {RemoteDebugger}
32
- * @param {string} eventName
33
- * @returns {void}
30
+ * Removes all client event listeners for the specified event name from the RPC client.
31
+ * This will stop listening for the event and clean up the tracked listeners.
32
+ *
33
+ * @param eventName - The name of the event to stop listening for.
34
34
  */
35
35
  function removeClientEventListener(eventName) {
36
36
  for (const listener of ((0, property_accessors_1.getClientEventListeners)(this)[eventName] || [])) {
@@ -38,9 +38,10 @@ function removeClientEventListener(eventName) {
38
38
  }
39
39
  }
40
40
  /**
41
- * @this {RemoteDebugger}
42
- * @param {import('../types').EventListener} listener
43
- * @returns {void}
41
+ * Starts listening for JavaScript console messages by registering listeners
42
+ * for Console.messageAdded and Console.messageRepeatCountUpdated events.
43
+ *
44
+ * @param listener - The event listener function to call when console messages are received.
44
45
  */
45
46
  function startConsole(listener) {
46
47
  this.log.debug('Starting to listen for JavaScript console');
@@ -48,8 +49,8 @@ function startConsole(listener) {
48
49
  this.addClientEventListener('Console.messageRepeatCountUpdated', listener);
49
50
  }
50
51
  /**
51
- * @this {RemoteDebugger}
52
- * @returns {void}
52
+ * Stops listening for JavaScript console messages by removing listeners
53
+ * for Console.messageAdded and Console.messageRepeatCountUpdated events.
53
54
  */
54
55
  function stopConsole() {
55
56
  this.log.debug('Stopping to listen for JavaScript console');
@@ -57,24 +58,20 @@ function stopConsole() {
57
58
  this.removeClientEventListener('Console.messageRepeatCountUpdated');
58
59
  }
59
60
  /**
60
- * @this {RemoteDebugger}
61
- * @param {import('../types').EventListener} listener
62
- * @returns {void}
61
+ * Starts listening for network events by registering a listener for NetworkEvent.
62
+ * This aggregates all Network.* events into a single NetworkEvent.
63
+ *
64
+ * @param listener - The event listener function to call when network events are received.
63
65
  */
64
66
  function startNetwork(listener) {
65
67
  this.log.debug('Starting to listen for network events');
66
68
  this.addClientEventListener('NetworkEvent', listener);
67
69
  }
68
70
  /**
69
- * @this {RemoteDebugger}
70
- * @returns {void}
71
+ * Stops listening for network events by removing the listener for NetworkEvent.
71
72
  */
72
73
  function stopNetwork() {
73
74
  this.log.debug('Stopping to listen for network events');
74
75
  this.removeClientEventListener('NetworkEvent');
75
76
  }
76
- exports.default = exports.events;
77
- /**
78
- * @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
79
- */
80
77
  //# sourceMappingURL=events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../lib/mixins/events.js"],"names":[],"mappings":";;;AAmBA,wDAIC;AAOD,8DAIC;AAOD,oCAIC;AAMD,kCAIC;AAOD,oCAGC;AAMD,kCAGC;AA1ED,6DAE8B;AAE9B,2BAA2B;AACd,QAAA,MAAM,GAAwB,CAAC;IAC1C,iBAAiB,EAAE,6BAA6B;IAChD,qBAAqB,EAAE,iCAAiC;IACxD,gBAAgB,EAAE,4BAA4B;CAC/C,CAA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,CAAC,CAAC;IAC5D,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;IAC9D,IAAI,CAAC,sBAAsB,CAAC,mCAAmC,EAAE,QAAQ,CAAC,CAAC;AAC7E,CAAC;AAED;;;GAGG;AACH,SAAgB,WAAW;IACzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC5D,IAAI,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IACvD,IAAI,CAAC,yBAAyB,CAAC,mCAAmC,CAAC,CAAC;AACtE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAE1B,QAAuB;IAEvB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACxD,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW;IACzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACxD,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC;AACjD,CAAC"}
@@ -1,34 +1,45 @@
1
+ import type { RemoteDebugger } from '../remote-debugger';
1
2
  /**
2
- * Execute a Selenium atom in Safari
3
+ * Executes a Selenium atom in Safari by generating the atom script and
4
+ * executing it in the page context.
3
5
  *
4
- * @this {RemoteDebugger}
5
- * @param {string} atom Name of Selenium atom (see atoms/ directory)
6
- * @param {any[]} args Arguments passed to the atom
7
- * @param {string[]} frames
8
- * @returns {Promise<any>} The result received from the atom
6
+ * @param atom - Name of the Selenium atom to execute (see atoms/ directory).
7
+ * @param args - Arguments to pass to the atom function. Defaults to empty array.
8
+ * @param frames - Frame context array for frame-specific execution. Defaults to empty array.
9
+ * @returns A promise that resolves to the result received from the atom execution.
9
10
  */
10
- export function executeAtom(this: import("../remote-debugger").RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
11
+ export declare function executeAtom(this: RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
11
12
  /**
12
- * @this {RemoteDebugger}
13
- * @param {string} atom
14
- * @param {any[]} [args]
15
- * @param {string[]} [frames]
16
- * @returns {Promise<any>}
13
+ * Executes a Selenium atom asynchronously by creating a Promise in the page context
14
+ * and waiting for the atom to resolve it. Falls back to polling if Runtime.awaitPromise
15
+ * is not available.
16
+ *
17
+ * @param atom - Name of the Selenium atom to execute (see atoms/ directory).
18
+ * @param args - Arguments to pass to the atom function. Defaults to empty array.
19
+ * If args[2] is provided, it will be used as the timeout in milliseconds.
20
+ * @param frames - Frame context array for frame-specific execution. Defaults to empty array.
21
+ * @returns A promise that resolves to the result received from the atom execution.
17
22
  */
18
- export function executeAtomAsync(this: import("../remote-debugger").RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
23
+ export declare function executeAtomAsync(this: RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
19
24
  /**
20
- * @this {RemoteDebugger}
21
- * @param {string} command
22
- * @param {boolean} [override] - Deprecated and unused
23
- * @returns {Promise<any>}
25
+ * Executes a JavaScript command in the page context and returns the result.
26
+ * Optionally performs garbage collection before execution if configured.
27
+ *
28
+ * @param command - The JavaScript command string to execute.
29
+ * @param override - Deprecated and unused parameter.
30
+ * @returns A promise that resolves to the result of the JavaScript evaluation,
31
+ * converted to a usable format.
24
32
  */
25
- export function execute(this: import("../remote-debugger").RemoteDebugger, command: string, override?: boolean): Promise<any>;
33
+ export declare function execute(this: RemoteDebugger, command: string, override?: boolean): Promise<any>;
26
34
  /**
27
- * @this {RemoteDebugger}
28
- * @param {string} objectId
29
- * @param {any} fn
30
- * @param {any[]} [args]
35
+ * Calls a JavaScript function on a remote object identified by objectId.
36
+ * Optionally performs garbage collection before execution if configured.
37
+ *
38
+ * @param objectId - The object identifier of the remote object to call the function on.
39
+ * @param fn - The function declaration string to execute on the object.
40
+ * @param args - Optional array of arguments to pass to the function.
41
+ * @returns A promise that resolves to the result of the function call,
42
+ * converted to a usable format.
31
43
  */
32
- export function callFunction(this: import("../remote-debugger").RemoteDebugger, objectId: string, fn: any, args?: any[]): Promise<any>;
33
- export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
44
+ export declare function callFunction(this: RemoteDebugger, objectId: string, fn: string, args?: any[]): Promise<any>;
34
45
  //# sourceMappingURL=execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/mixins/execute.js"],"names":[],"mappings":"AAoBA;;;;;;;;GAQG;AACH,qFALW,MAAM,SACN,GAAG,EAAE,WACL,MAAM,EAAE,GACN,OAAO,CAAC,GAAG,CAAC,CAQxB;AAED;;;;;;GAMG;AACH,0FALW,MAAM,SACN,GAAG,EAAE,WACL,MAAM,EAAE,GACN,OAAO,CAAC,GAAG,CAAC,CAoFxB;AAED;;;;;GAKG;AAEH,oFALW,MAAM,aACN,OAAO,GACL,OAAO,CAAC,GAAG,CAAC,CA0BxB;AAED;;;;;GAKG;AACH,0FAJW,MAAM,MACN,GAAG,SACH,GAAG,EAAE,gBAuBf;6BAGY,OAAO,oBAAoB,EAAE,cAAc"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/mixins/execute.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMzD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,GAAG,EAAO,EAChB,MAAM,GAAE,MAAM,EAAO,GACpB,OAAO,CAAC,GAAG,CAAC,CAQd;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,GAAG,EAAO,EAChB,MAAM,GAAE,MAAM,EAAO,GACpB,OAAO,CAAC,GAAG,CAAC,CAkFd;AAED;;;;;;;;GAQG;AAEH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAuBrG;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,GAAG,EAAE,GACX,OAAO,CAAC,GAAG,CAAC,CAqBd"}
@@ -17,27 +17,33 @@ const property_accessors_1 = require("./property-accessors");
17
17
  /* How many milliseconds to wait for webkit to return a response before timing out */
18
18
  const RPC_RESPONSE_TIMEOUT_MS = 5000;
19
19
  /**
20
- * Execute a Selenium atom in Safari
20
+ * Executes a Selenium atom in Safari by generating the atom script and
21
+ * executing it in the page context.
21
22
  *
22
- * @this {RemoteDebugger}
23
- * @param {string} atom Name of Selenium atom (see atoms/ directory)
24
- * @param {any[]} args Arguments passed to the atom
25
- * @param {string[]} frames
26
- * @returns {Promise<any>} The result received from the atom
23
+ * @param atom - Name of the Selenium atom to execute (see atoms/ directory).
24
+ * @param args - Arguments to pass to the atom function. Defaults to empty array.
25
+ * @param frames - Frame context array for frame-specific execution. Defaults to empty array.
26
+ * @returns A promise that resolves to the result received from the atom execution.
27
27
  */
28
28
  async function executeAtom(atom, args = [], frames = []) {
29
29
  this.log.debug(`Executing atom '${atom}' with 'args=${JSON.stringify(args)}; frames=${frames}'`);
30
30
  const script = await (0, atoms_1.getScriptForAtom)(atom, args, frames);
31
31
  const value = await this.execute(script);
32
- this.log.debug(`Received result for atom '${atom}' execution: ${lodash_1.default.truncate((0, utils_1.simpleStringify)(value), { length: utils_1.RESPONSE_LOG_LENGTH })}`);
32
+ this.log.debug(`Received result for atom '${atom}' execution: ${lodash_1.default.truncate((0, utils_1.simpleStringify)(value), {
33
+ length: utils_1.RESPONSE_LOG_LENGTH
34
+ })}`);
33
35
  return value;
34
36
  }
35
37
  /**
36
- * @this {RemoteDebugger}
37
- * @param {string} atom
38
- * @param {any[]} [args]
39
- * @param {string[]} [frames]
40
- * @returns {Promise<any>}
38
+ * Executes a Selenium atom asynchronously by creating a Promise in the page context
39
+ * and waiting for the atom to resolve it. Falls back to polling if Runtime.awaitPromise
40
+ * is not available.
41
+ *
42
+ * @param atom - Name of the Selenium atom to execute (see atoms/ directory).
43
+ * @param args - Arguments to pass to the atom function. Defaults to empty array.
44
+ * If args[2] is provided, it will be used as the timeout in milliseconds.
45
+ * @param frames - Frame context array for frame-specific execution. Defaults to empty array.
46
+ * @returns A promise that resolves to the result received from the atom execution.
41
47
  */
42
48
  async function executeAtomAsync(atom, args = [], frames = []) {
43
49
  // helper to send directly to the web inspector
@@ -119,10 +125,13 @@ async function executeAtomAsync(atom, args = [], frames = []) {
119
125
  return (0, utils_1.convertJavascriptEvaluationResult)(res);
120
126
  }
121
127
  /**
122
- * @this {RemoteDebugger}
123
- * @param {string} command
124
- * @param {boolean} [override] - Deprecated and unused
125
- * @returns {Promise<any>}
128
+ * Executes a JavaScript command in the page context and returns the result.
129
+ * Optionally performs garbage collection before execution if configured.
130
+ *
131
+ * @param command - The JavaScript command string to execute.
132
+ * @param override - Deprecated and unused parameter.
133
+ * @returns A promise that resolves to the result of the JavaScript evaluation,
134
+ * converted to a usable format.
126
135
  */
127
136
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
128
137
  async function execute(command, override) {
@@ -134,9 +143,7 @@ async function execute(command, override) {
134
143
  await this.garbageCollect();
135
144
  }
136
145
  const rpcClient = this.requireRpcClient(true);
137
- await rpcClient.waitForPage(
138
- /** @type {import('../types').AppIdKey} */ (appIdKey),
139
- /** @type {import('../types').PageIdKey} */ (pageIdKey));
146
+ await rpcClient.waitForPage(appIdKey, pageIdKey);
140
147
  this.log.debug(`Sending javascript command: '${lodash_1.default.truncate(command, { length: 50 })}'`);
141
148
  const res = await rpcClient.send('Runtime.evaluate', {
142
149
  expression: command,
@@ -147,10 +154,14 @@ async function execute(command, override) {
147
154
  return (0, utils_1.convertJavascriptEvaluationResult)(res);
148
155
  }
149
156
  /**
150
- * @this {RemoteDebugger}
151
- * @param {string} objectId
152
- * @param {any} fn
153
- * @param {any[]} [args]
157
+ * Calls a JavaScript function on a remote object identified by objectId.
158
+ * Optionally performs garbage collection before execution if configured.
159
+ *
160
+ * @param objectId - The object identifier of the remote object to call the function on.
161
+ * @param fn - The function declaration string to execute on the object.
162
+ * @param args - Optional array of arguments to pass to the function.
163
+ * @returns A promise that resolves to the result of the function call,
164
+ * converted to a usable format.
154
165
  */
155
166
  async function callFunction(objectId, fn, args) {
156
167
  const { appIdKey, pageIdKey } = (0, utils_1.checkParams)({
@@ -171,7 +182,4 @@ async function callFunction(objectId, fn, args) {
171
182
  });
172
183
  return (0, utils_1.convertJavascriptEvaluationResult)(res);
173
184
  }
174
- /**
175
- * @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
176
- */
177
185
  //# sourceMappingURL=execute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/mixins/execute.js"],"names":[],"mappings":";;;;;AA6BA,kCAMC;AASD,4CAkFC;AASD,0BAuBC;AAQD,oCAqBC;AA3LD,qDAA6C;AAC7C,oCAKkB;AAClB,oCAA4C;AAC5C,6CAA+C;AAC/C,uCAAyC;AACzC,oDAAuB;AACvB,6DAI8B;AAE9B,qFAAqF;AACrF,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC;;;;;;;;GAQG;AACI,KAAK,UAAU,WAAW,CAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE;IAC7D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,IAAI,gBAAgB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,MAAM,GAAG,CAAC,CAAC;IACjG,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAgB,EA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,CAAC;IAEH,IAAI,IAAA,+CAA0B,EAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC9B,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,wBAAwB,EAAE;QAC3E,QAAQ;QACR,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,IAAI;QACnB,QAAQ;QACR,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,yCAAiC,EAAC,GAAG,CAAC,CAAC;AAChD,CAAC"}
@@ -1,61 +1,81 @@
1
+ import type { RemoteDebugger } from '../remote-debugger';
2
+ import type { StringRecord } from '@appium/types';
1
3
  /**
2
- * @this {RemoteDebugger}
3
- * @param {Error?} err
4
- * @param {string} appIdKey
5
- * @param {Record<string, any>} pageDict
6
- * @returns {Promise<void>}
4
+ * Handles page change notifications from the remote debugger.
5
+ * Updates the page array for the specified application and emits a page change
6
+ * event if the pages have actually changed and navigation is not in progress.
7
+ *
8
+ * @param err - Error object if an error occurred, null or undefined otherwise.
9
+ * @param appIdKey - The application identifier key for which pages have changed.
10
+ * @param pageDict - Dictionary containing the new page information.
7
11
  */
8
- export function onPageChange(this: import("../remote-debugger").RemoteDebugger, err: Error | null, appIdKey: string, pageDict: Record<string, any>): Promise<void>;
12
+ export declare function onPageChange(this: RemoteDebugger, err: Error | null | undefined, appIdKey: string, pageDict: StringRecord): Promise<void>;
9
13
  /**
10
- * @this {RemoteDebugger}
11
- * @param {Error?} err
12
- * @param {Record<string, any>} dict
13
- * @returns {Promise<void>}
14
+ * Handles notifications when a new application connects to the remote debugger.
15
+ * Updates the application dictionary with the new application information.
16
+ *
17
+ * @param err - Error object if an error occurred, null or undefined otherwise.
18
+ * @param dict - Dictionary containing the new application information including
19
+ * the WIRApplicationIdentifierKey.
14
20
  */
15
- export function onAppConnect(this: import("../remote-debugger").RemoteDebugger, err: Error | null, dict: Record<string, any>): Promise<void>;
21
+ export declare function onAppConnect(this: RemoteDebugger, err: Error | null | undefined, dict: StringRecord): Promise<void>;
16
22
  /**
17
- * @this {RemoteDebugger}
18
- * @param {Error?} err
19
- * @param {import('@appium/types').StringRecord} dict
20
- * @returns {void}
23
+ * Handles notifications when an application disconnects from the remote debugger.
24
+ * Removes the application from the dictionary and attempts to find a replacement
25
+ * if the disconnected app was the currently selected one. Emits a disconnect event
26
+ * if no applications remain.
27
+ *
28
+ * @param err - Error object if an error occurred, null or undefined otherwise.
29
+ * @param dict - Dictionary containing the disconnected application information
30
+ * including the WIRApplicationIdentifierKey.
21
31
  */
22
- export function onAppDisconnect(this: import("../remote-debugger").RemoteDebugger, err: Error | null, dict: import("@appium/types").StringRecord): void;
32
+ export declare function onAppDisconnect(this: RemoteDebugger, err: Error | null | undefined, dict: StringRecord): void;
23
33
  /**
24
- * @this {RemoteDebugger}
25
- * @param {Error?} err
26
- * @param {Record<string, any>} dict
27
- * @returns {Promise<void>}
34
+ * Handles notifications when an application's information is updated.
35
+ * Updates the application dictionary with the new information while preserving
36
+ * any existing page array data.
37
+ *
38
+ * @param err - Error object if an error occurred, null or undefined otherwise.
39
+ * @param dict - Dictionary containing the updated application information.
28
40
  */
29
- export function onAppUpdate(this: import("../remote-debugger").RemoteDebugger, err: Error | null, dict: Record<string, any>): Promise<void>;
41
+ export declare function onAppUpdate(this: RemoteDebugger, err: Error | null | undefined, dict: StringRecord): Promise<void>;
30
42
  /**
31
- * @this {RemoteDebugger}
32
- * @param {Error?} err
33
- * @param {Record<string, any>} drivers
34
- * @returns {void}
43
+ * Handles notifications containing the list of connected drivers.
44
+ * Updates the internal connected drivers list with the received information.
45
+ *
46
+ * @param err - Error object if an error occurred, null or undefined otherwise.
47
+ * @param drivers - Dictionary containing the connected driver list with
48
+ * WIRDriverDictionaryKey.
35
49
  */
36
- export function onConnectedDriverList(this: import("../remote-debugger").RemoteDebugger, err: Error | null, drivers: Record<string, any>): void;
50
+ export declare function onConnectedDriverList(this: RemoteDebugger, err: Error | null | undefined, drivers: StringRecord): void;
37
51
  /**
38
- * @this {RemoteDebugger}
39
- * @param {Error?} err
40
- * @param {Record<string, any>} state
41
- * @returns {void}
52
+ * Handles notifications about the current automation availability state.
53
+ * This state changes when 'Remote Automation' setting in Safari's advanced settings
54
+ * is toggled. The state can be either WIRAutomationAvailabilityAvailable or
55
+ * WIRAutomationAvailabilityNotAvailable.
56
+ *
57
+ * @param err - Error object if an error occurred, null or undefined otherwise.
58
+ * @param state - Dictionary containing the automation availability state with
59
+ * WIRAutomationAvailabilityKey.
42
60
  */
43
- export function onCurrentState(this: import("../remote-debugger").RemoteDebugger, err: Error | null, state: Record<string, any>): void;
61
+ export declare function onCurrentState(this: RemoteDebugger, err: Error | null | undefined, state: StringRecord): void;
44
62
  /**
45
- * @this {RemoteDebugger}
46
- * @param {Error?} err
47
- * @param {Record<string, any>} apps
48
- * @returns {Promise<void>}
63
+ * Handles notifications containing the list of connected applications.
64
+ * Translates the received information into the application dictionary format,
65
+ * filtering out any applications that are in the skipped apps list.
66
+ *
67
+ * @param err - Error object if an error occurred, null or undefined otherwise.
68
+ * @param apps - Dictionary containing the connected applications list.
49
69
  */
50
- export function onConnectedApplicationList(this: import("../remote-debugger").RemoteDebugger, err: Error | null, apps: Record<string, any>): Promise<void>;
70
+ export declare function onConnectedApplicationList(this: RemoteDebugger, err: Error | null | undefined, apps: StringRecord): Promise<void>;
51
71
  /**
52
- * Given a bundle id, finds the correct remote debugger app that is
53
- * connected.
72
+ * Given a bundle ID, finds the correct remote debugger app identifier key
73
+ * that is currently connected. Also handles proxy applications that may act
74
+ * on behalf of the requested bundle ID.
54
75
  *
55
- * @this {RemoteDebugger}
56
- * @param {string} bundleId
57
- * @returns {string|undefined}
76
+ * @param bundleId - The bundle identifier to search for.
77
+ * @returns The application identifier key if found, undefined otherwise.
78
+ * If a proxy application is found, returns the proxy's app ID instead.
58
79
  */
59
- export function getDebuggerAppKey(this: import("../remote-debugger").RemoteDebugger, bundleId: string): string | undefined;
60
- export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
80
+ export declare function getDebuggerAppKey(this: RemoteDebugger, bundleId: string): string | undefined;
61
81
  //# sourceMappingURL=message-handlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-handlers.d.ts","sourceRoot":"","sources":["../../../lib/mixins/message-handlers.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,qFALW,KAAK,OAAC,YACN,MAAM,YACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAmCzB;AAED;;;;;GAKG;AACH,qFAJW,KAAK,OAAC,QACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAMzB;AAED;;;;;GAKG;AACH,wFAJW,KAAK,OAAC,QACN,OAAO,eAAe,EAAE,YAAY,GAClC,IAAI,CAsBhB;AAED;;;;;GAKG;AACH,oFAJW,KAAK,OAAC,QACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAKzB;AAED;;;;;GAKG;AACH,8FAJW,KAAK,OAAC,WACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,IAAI,CAKhB;AAED;;;;;GAKG;AACH,uFAJW,KAAK,OAAC,SACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,IAAI,CAOhB;AAED;;;;;GAKG;AACH,mGAJW,KAAK,OAAC,QACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAiBzB;AAwBD;;;;;;;GAOG;AACH,+FAHW,MAAM,GACJ,MAAM,GAAC,SAAS,CA6B5B;6BAGY,OAAO,oBAAoB,EAAE,cAAc"}
1
+ {"version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